diff --git a/README.md b/README.md index 82a20265a..6ebe99ffd 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ dotnet run --project src/Aevatar.Mainnet.Host.Api ### 3. 发一次 Chat 请求 -- 查看可用工作流:`GET http://localhost:5000/api/workflows` -- 发起对话:`POST http://localhost:5000/api/chat`,请求体示例: +- 查看可用工作流:`GET http://localhost:5100/api/workflows` +- 发起对话:`POST http://localhost:5100/api/chat`,请求体示例: ```json { "prompt": "你的问题或长文本", "workflow": "simple_qa" } @@ -58,7 +58,7 @@ dotnet run --project src/Aevatar.Mainnet.Host.Api 示例(命令行): ```bash -curl -X POST http://localhost:5000/api/chat \ +curl -X POST http://localhost:5100/api/chat \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{"prompt": "什么是 MAKER 模式?", "workflow": "simple_qa"}' diff --git a/docs/2026-03-20-workflow-call-practice-guide.md b/docs/2026-03-20-workflow-call-practice-guide.md index a8dff43e1..df53f720a 100644 --- a/docs/2026-03-20-workflow-call-practice-guide.md +++ b/docs/2026-03-20-workflow-call-practice-guide.md @@ -11,7 +11,7 @@ 通过 `/api/chat` 一次请求提交所有 YAML 定义,无需预注册。 ```bash -curl -N -X POST http://localhost:5000/api/chat \ +curl -N -X POST http://localhost:5100/api/chat \ -H "Content-Type: application/json" \ -d '{ "prompt": "hello from parent", @@ -109,7 +109,7 @@ steps: ```bash # 启动 workflow -curl -N -X POST http://localhost:5000/api/chat \ +curl -N -X POST http://localhost:5100/api/chat \ -H "Content-Type: application/json" \ -d '{ "prompt": "Analyze this: hello world", @@ -126,7 +126,7 @@ curl -N -X POST http://localhost:5000/api/chat \ ### WebSocket ```javascript -const ws = new WebSocket("ws://localhost:5000/api/ws/chat"); +const ws = new WebSocket("ws://localhost:5100/api/ws/chat"); ws.onopen = () => { ws.send(JSON.stringify({ @@ -161,7 +161,7 @@ demos/Aevatar.Demos.Workflow/workflows/ 可以直接用于验证多级 workflow_call 链路: ```bash -curl -N -X POST http://localhost:5000/api/chat \ +curl -N -X POST http://localhost:5100/api/chat \ -H "Content-Type: application/json" \ -d '{"prompt": "test multilevel call", "workflow": "workflow_call_multilevel"}' ``` diff --git a/docs/SDK_WORKFLOW_CHAT_DOTNET.md b/docs/SDK_WORKFLOW_CHAT_DOTNET.md index 669af4b80..a74f2b4b9 100644 --- a/docs/SDK_WORKFLOW_CHAT_DOTNET.md +++ b/docs/SDK_WORKFLOW_CHAT_DOTNET.md @@ -16,7 +16,7 @@ using Aevatar.Workflow.Sdk.DependencyInjection; var services = new ServiceCollection(); services.AddAevatarWorkflowSdk(options => { - options.BaseUrl = "http://localhost:5000"; + options.BaseUrl = "http://localhost:5100"; options.DefaultHeaders["x-api-key"] = ""; }); ``` diff --git a/docs/architecture/archive/2026-03/workflow-jaeger-observability-guide.md b/docs/architecture/archive/2026-03/workflow-jaeger-observability-guide.md index 93d184e0f..697c6f2f0 100644 --- a/docs/architecture/archive/2026-03/workflow-jaeger-observability-guide.md +++ b/docs/architecture/archive/2026-03/workflow-jaeger-observability-guide.md @@ -69,7 +69,7 @@ dotnet run --project src/workflow/Aevatar.Workflow.Host.Api Trigger request: ```bash -curl -i -X POST "http://localhost:5000/api/chat" \ +curl -i -X POST "http://localhost:5100/api/chat" \ -H "Content-Type: application/json" \ -d '{ "prompt": "hello", diff --git a/docs/audit-scorecard/2026-03-22-aevatar-architecture-audit-scorecard.md b/docs/audit-scorecard/2026-03-22-aevatar-architecture-audit-scorecard.md new file mode 100644 index 000000000..00fc5fedb --- /dev/null +++ b/docs/audit-scorecard/2026-03-22-aevatar-architecture-audit-scorecard.md @@ -0,0 +1,224 @@ +# Aevatar 全仓架构审计评分报告(重构后复评) + +> 日期:`2026-03-22` +> 复评分支:`refactor/2026-03-22_architecture-audit-remediation` +> 范围:`aevatar.slnx` 全仓,覆盖 `src/`、`test/`、`tools/`、`docs/` +> 方法:六维评分模型 + 主链路代码复核 + CI 门禁/构建/测试验证 +> 基线豁免:`InMemory` 实现、仅本地 Runtime、带外环境依赖的显式跳过测试 + +## 1. 结论 + +本次重构后的复评总分为:`96/100`,等级 `A`。 + +相对于整改前的 `81/100 (B+)`,这次复评的核心变化不是“又做了一轮局部修补”,而是把之前真正拉低分数的几类问题全部收口到了工程事实: + +- 全仓 `build/test` 与分片门禁恢复为绿色。 +- 架构测试从“存在已知 `Skip`”恢复到 `95 passed, 0 skipped`。 +- workflow 行为契约、CQRS detached cleanup、scripting 抽象边界、命名债务都已同步到代码和测试。 +- 原先会让全量测试 idle 挂起的 `Aevatar.Scripting.Core.Tests` 已定位到单个测试并修复。 + +当前结论已经不再是“主干架构正确但闭环未完成”,而是: + +- 架构方向:`正确` +- 架构落地度:`高` +- 架构治理完成度:`高` +- 当前状态:`无阻断项,进入稳态维护区间` + +## 2. 客观验证结果 + +| 验证项 | 命令 | 结果 | 结论 | +|---|---|---|---| +| 架构门禁总集 | `bash tools/ci/architecture_guards.sh` | 通过 | Projection / workflow / scripting / playground 相关 guard 全绿 | +| 分片构建门禁 | `bash tools/ci/solution_split_guards.sh` | 通过 | `Foundation/AI/CQRS/Workflow/Hosting/Distributed` 分片全部可构建 | +| 分片测试门禁 | `bash tools/ci/solution_split_test_guards.sh` | 通过 | 分片测试链路恢复绿色 | +| 轮询等待门禁 | `bash tools/ci/test_stability_guards.sh` | 通过 | 本次测试修改未引入新的 polling debt | +| 全量构建 | `dotnet build aevatar.slnx --nologo --tl:off -m:1 -p:UseSharedCompilation=false -p:NuGetAudit=false` | 通过 | 全仓可编译 | +| 全量测试 | `dotnet test aevatar.slnx --nologo --tl:off -m:1 -p:UseSharedCompilation=false -p:NuGetAudit=false` | 通过 | 之前挂起的 `Aevatar.Scripting.Core.Tests` 已恢复正常结束 | +| 架构测试 | `dotnet test test/Aevatar.Architecture.Tests/Aevatar.Architecture.Tests.csproj --nologo --tl:off -m:1 -p:UseSharedCompilation=false -p:NuGetAudit=false` | 通过 | `95` 通过,`0` 跳过 | +| 脚本核心测试 | `dotnet test test/Aevatar.Scripting.Core.Tests/Aevatar.Scripting.Core.Tests.csproj --nologo --tl:off -m:1 -p:UseSharedCompilation=false -p:NuGetAudit=false` | 通过 | `387` 通过,`0` 跳过 | + +补充说明: + +- 分片测试和全量测试中仍存在少量显式 `SKIP` 的集成用例,但它们都属于环境依赖或外部基础设施前提,不再构成架构闭环扣分项。 +- 当前仓库已经满足“变更必须可验证”的整改目标。 + +## 3. 整体评分 + +### 3.1 总分 + +| 项目 | 分数 | 等级 | +|---|---:|---| +| 整体架构评分 | `96/100` | `A` | + +### 3.2 六维评分 + +| 维度 | 权重 | 得分 | 评分说明 | +|---|---:|---:|---| +| 分层与依赖反转 | 20 | 19 | `GAgentService.Application` 已不再绕过 abstractions 直连 `Scripting.Core`,上层依赖反转明显改善 | +| CQRS 与统一投影链路 | 20 | 18 | detached cleanup 语义已收口,统一投影链路与 guard 保持稳定;保留 2 分作为后续持续打磨空间 | +| Projection 编排与状态约束 | 20 | 20 | priming/state-version/route/binding/actor-model 相关门禁与测试闭环完整 | +| 读写分离与会话语义 | 15 | 15 | workflow `RoleId` fail-fast 语义恢复一致,query/readmodel 路径保持诚实 | +| 命名语义与冗余清理 | 10 | 10 | `WorkflowRunReport` 命名债已清理,遗留 `Skip` 规则已转回正式约束 | +| 可验证性(门禁/构建/测试) | 15 | 14 | build/test/guards 全绿;保留 1 分给现存 analyzer warning 与环境依赖型跳过测试 | + +## 4. 分模块评分 + +| 模块 | 分数 | 结论 | +|---|---:|---| +| `Foundation + Runtime` | 92 | 基础运行时保持稳定,分布式/本地双路径均未出现新的边界倒灌 | +| `CQRS + Projection` | 93 | 主链路、版本语义和 reducer 路由治理都较稳健 | +| `Workflow` | 95 | 行为契约、导出命名、测试闭环与 host 路径全部收口 | +| `Scripting` | 94 | abstractions 边界与测试稳定性显著改善,原挂起项已消除 | +| `Platform / GAgentService` | 92 | 应用层脚本依赖边界收紧后,整体装配更干净 | +| `AI` | 88 | 当前抽样路径没有新的架构逆流,主要保持稳定 | +| `Host + Bootstrap + Tooling` | 91 | playground 资产同步与默认端口治理已经恢复一致 | +| `Docs + Guards` | 94 | 审计、门禁与验证结果现在是一致的,不再互相打架 | + +## 5. 已关闭的问题 + +### 5.1 workflow 分片与全仓构建阻断已消除 + +修复点: + +- `test/Aevatar.Workflow.Application.Tests/WorkflowRunActorResolverTests.cs` + +结果: + +- 陈旧测试类型引用已清理,`dotnet build aevatar.slnx`、`solution_split_guards.sh`、`solution_split_test_guards.sh` 全部恢复绿色。 + +### 5.2 playground 资产漂移已消除 + +修复点: + +- `tools/Aevatar.Tools.Cli/wwwroot/playground/app.js` +- `tools/Aevatar.Tools.Cli/wwwroot/playground/app.css` + +结果: + +- `playground_asset_drift_guard.sh` 通过,`architecture_guards.sh` 不再被 tooling 漂移阻断。 + +### 5.3 CQRS detached cleanup 语义已收口 + +修复点: + +- `src/Aevatar.CQRS.Core/Commands/DefaultDetachedCommandDispatchService.cs` +- `src/Aevatar.CQRS.Core/Interactions/DefaultCommandInteractionService.cs` +- `src/workflow/Aevatar.Workflow.Application/Runs/WorkflowRunCommandTarget.cs` + +结果: + +- 去掉显式 `Task.Run` 背景 drain。 +- cleanup/durable release 改为受 shutdown token 约束,不再硬编码 `CancellationToken.None`。 + +### 5.4 scripting 依赖边界已从 `Core` 上移到 abstractions + +修复点: + +- `src/Aevatar.Scripting.Abstractions/CorePorts/IScriptDefinitionCommandPort.cs` +- `src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogCommandPort.cs` +- `src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogQueryPort.cs` +- `src/platform/Aevatar.GAgentService.Application/Aevatar.GAgentService.Application.csproj` + +结果: + +- `GAgentService.Application` 不再通过 `Scripting.Core` 暴露的端口完成上层装配,依赖反转恢复一致。 + +### 5.5 workflow `RoleId` 契约重新统一为 fail-fast + +修复点: + +- `src/workflow/Aevatar.Workflow.Core/WorkflowRunGAgent.cs` + +结果: + +- 缺失 `RoleId` 时恢复抛错,不再出现“同一条链路里一部分 warning 跳过、一部分 fail-fast”的双重语义。 + +### 5.6 workflow 导出 DTO 命名债已消除 + +修复点: + +- `src/workflow/Aevatar.Workflow.Application.Abstractions/Queries/WorkflowExecutionQueryModels.cs` +- `src/workflow/Aevatar.Workflow.Application.Abstractions/Reporting/IWorkflowRunReportExportPort.cs` +- `src/workflow/Aevatar.Workflow.Infrastructure/Reporting/WorkflowRunReportExportWriter.cs` + +结果: + +- 旧的 `WorkflowRunReport` 已改为 `WorkflowRunExportDocument`,导出链路语义与命名治理保持一致。 + +### 5.7 架构规则中的陈旧 `Skip` 已清除 + +修复点: + +- `test/Aevatar.Architecture.Tests/Rules/NamingConventionTests.cs` +- `test/Aevatar.Architecture.Tests/Rules/ActorModelConstraintTests.cs` + +结果: + +- Architecture Tests 从 `93 passed, 2 skipped` 提升到 `95 passed, 0 skipped`。 + +### 5.8 `Aevatar.Scripting.Core.Tests` 挂起根因已消除 + +修复点: + +- `test/Aevatar.Scripting.Core.Tests/Compilation/ScriptArtifactCoverageTests.cs` + +结果: + +- 把错误假设“并发同 key resolve 会触发两次 compile”的测试,改成符合 `ConcurrentDictionary + Lazy` 真实语义的 in-flight compile 共享测试。 +- `dotnet test test/Aevatar.Scripting.Core.Tests/...` 和 `dotnet test aevatar.slnx ...` 均已正常结束。 + +## 6. 正向证据 + +### 6.1 当前门禁已经不再是“多数规则绿,少数规则靠跳过” + +正向证据: + +- `architecture_guards.sh` 通过。 +- `Aevatar.Architecture.Tests` 通过且 `0 skipped`。 +- `test_stability_guards.sh` 通过。 + +结论: + +- 治理规则的权威性已经恢复,不再依赖“已知例外”维持表面通过。 + +### 6.2 workflow 主链路的实现与契约重新一致 + +正向证据: + +- `WorkflowRunGAgent` 对缺失 `RoleId` 恢复 fail-fast。 +- workflow 导出链路的命名与职责从“报告对象”明确收敛到“导出文档”。 + +结论: + +- Workflow 现在不只是在代码上可运行,也在契约和命名层面可推理。 + +### 6.3 scripting 的稳定性问题已经从“运行挂起”降到“正常可回归” + +正向证据: + +- `Aevatar.Scripting.Core.Tests` 全量 `387` 项通过。 +- 全仓 `dotnet test aevatar.slnx` 已顺利穿过之前会卡住的脚本测试节点。 + +结论: + +- 当前脚本能力已经从“存在测试黑洞”恢复到可纳入稳态 CI 的状态。 + +## 7. 当前残余观察项 + +以下内容本次不再计为阻断或主要扣分项,但建议持续清理: + +- `dotnet build` 仍有少量 analyzer warning,集中在 `Aevatar.GAgentService.Hosting` 与 `Aevatar.Tools.Cli`。 +- 少数分布式/外部依赖测试在缺少环境前提时显式跳过,这属于可接受的环境条件差异,不等价于架构闭环缺失。 +- 当前工作树仍未提交 commit;这是交付流程问题,不是架构完成度问题。 + +## 8. 最终判断 + +本次复评的核心判断是: + +- 主干架构:`成立` +- 分层与边界:`基本收口` +- 统一投影与读写分离:`可验证` +- 命名与治理规则:`恢复权威` +- 工程闭环:`已完成` + +综合评分更新为:`96/100 (A)`。 diff --git a/src/Aevatar.Bootstrap/Hosting/WebApplicationBuilderExtensions.cs b/src/Aevatar.Bootstrap/Hosting/WebApplicationBuilderExtensions.cs index 259ef4681..b6f15d4cb 100644 --- a/src/Aevatar.Bootstrap/Hosting/WebApplicationBuilderExtensions.cs +++ b/src/Aevatar.Bootstrap/Hosting/WebApplicationBuilderExtensions.cs @@ -1,6 +1,7 @@ using Aevatar.Configuration; using Aevatar.Hosting; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -23,6 +24,8 @@ public sealed class AevatarDefaultHostOptions public bool AutoMapCapabilities { get; set; } = true; public bool MapRootHealthEndpoint { get; set; } = true; + + public string DefaultListenUrls { get; set; } = string.Empty; } public static class WebApplicationBuilderExtensions @@ -38,6 +41,7 @@ public static WebApplicationBuilder AddAevatarDefaultHost( AddApplicationBaseConfiguration(builder); builder.Configuration.AddAevatarConfig(); + ApplyDefaultListenUrls(builder, hostOptions); builder.Services.AddAevatarBootstrap(builder.Configuration); builder.Services.AddSingleton(hostOptions); @@ -50,6 +54,19 @@ public static WebApplicationBuilder AddAevatarDefaultHost( return builder; } + private static void ApplyDefaultListenUrls( + WebApplicationBuilder builder, + AevatarDefaultHostOptions hostOptions) + { + if (string.IsNullOrWhiteSpace(hostOptions.DefaultListenUrls)) + return; + + if (HasExplicitListenConfiguration(builder.Configuration)) + return; + + builder.WebHost.UseUrls(hostOptions.DefaultListenUrls); + } + private static void AddApplicationBaseConfiguration(WebApplicationBuilder builder) { var applicationBasePath = AppContext.BaseDirectory; @@ -71,6 +88,18 @@ private static void AddApplicationBaseConfiguration(WebApplicationBuilder builde reloadOnChange: false); } + private static bool HasExplicitListenConfiguration(IConfiguration configuration) + { + if (!string.IsNullOrWhiteSpace(configuration[WebHostDefaults.ServerUrlsKey])) + return true; + + if (!string.IsNullOrWhiteSpace(configuration["http_ports"]) || + !string.IsNullOrWhiteSpace(configuration["https_ports"])) + return true; + + return configuration.GetSection("Kestrel:Endpoints").GetChildren().Any(); + } + public static WebApplication UseAevatarDefaultHost(this WebApplication app) { ArgumentNullException.ThrowIfNull(app); diff --git a/src/Aevatar.CQRS.Core/Commands/DefaultDetachedCommandDispatchService.cs b/src/Aevatar.CQRS.Core/Commands/DefaultDetachedCommandDispatchService.cs index b3615b025..58ef0b1c3 100644 --- a/src/Aevatar.CQRS.Core/Commands/DefaultDetachedCommandDispatchService.cs +++ b/src/Aevatar.CQRS.Core/Commands/DefaultDetachedCommandDispatchService.cs @@ -75,9 +75,9 @@ private void StartDetachedDrain( if (Interlocked.Increment(ref _inflightCount) == 1) _drainComplete = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var task = Task.Run( - () => DrainAsync(target, receipt, _shutdownToken), - CancellationToken.None); + // Detached dispatch must hand off drain work asynchronously even when the sink + // is already fully buffered, otherwise DispatchAsync can block on inline cleanup. + var task = Task.Run(() => DrainAsync(target, receipt, _shutdownToken)); task.ContinueWith( _ => @@ -168,7 +168,7 @@ await target.ReleaseAfterInteractionAsync( observedCompleted, observedCompletion, durableCompletion), - CancellationToken.None); + ct); } catch (Exception ex) { diff --git a/src/Aevatar.CQRS.Core/Interactions/DefaultCommandInteractionService.cs b/src/Aevatar.CQRS.Core/Interactions/DefaultCommandInteractionService.cs index 8e1826927..8b964a216 100644 --- a/src/Aevatar.CQRS.Core/Interactions/DefaultCommandInteractionService.cs +++ b/src/Aevatar.CQRS.Core/Interactions/DefaultCommandInteractionService.cs @@ -16,6 +16,7 @@ public sealed class DefaultCommandInteractionService _finalizeEmitter; private readonly ICommandDurableCompletionResolver _durableCompletionResolver; private readonly ILogger> _logger; + private readonly CancellationToken _cleanupToken; public DefaultCommandInteractionService( ICommandDispatchPipeline dispatchPipeline, @@ -23,13 +24,15 @@ public DefaultCommandInteractionService( ICommandCompletionPolicy completionPolicy, ICommandFinalizeEmitter finalizeEmitter, ICommandDurableCompletionResolver durableCompletionResolver, - ILogger>? logger = null) + ILogger>? logger = null, + ICommandDispatchShutdownSignal? shutdownSignal = null) { _dispatchPipeline = dispatchPipeline ?? throw new ArgumentNullException(nameof(dispatchPipeline)); _outputStream = outputStream ?? throw new ArgumentNullException(nameof(outputStream)); _completionPolicy = completionPolicy ?? throw new ArgumentNullException(nameof(completionPolicy)); _finalizeEmitter = finalizeEmitter ?? throw new ArgumentNullException(nameof(finalizeEmitter)); _durableCompletionResolver = durableCompletionResolver ?? throw new ArgumentNullException(nameof(durableCompletionResolver)); + _cleanupToken = shutdownSignal?.ShutdownToken ?? CancellationToken.None; _logger = logger ?? NullLogger>.Instance; } @@ -111,7 +114,7 @@ await _finalizeEmitter.EmitAsync( { durableCompletion = await _durableCompletionResolver.ResolveAsync( receipt, - CancellationToken.None); + _cleanupToken); } await target.ReleaseAfterInteractionAsync( @@ -120,7 +123,7 @@ await target.ReleaseAfterInteractionAsync( observedCompleted, observedCompletion, durableCompletion), - CancellationToken.None); + _cleanupToken); } catch (Exception cleanupException) { diff --git a/src/Aevatar.Scripting.Core/Ports/IScriptCatalogCommandPort.cs b/src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogCommandPort.cs similarity index 100% rename from src/Aevatar.Scripting.Core/Ports/IScriptCatalogCommandPort.cs rename to src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogCommandPort.cs diff --git a/src/Aevatar.Scripting.Core/Ports/IScriptCatalogQueryPort.cs b/src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogQueryPort.cs similarity index 100% rename from src/Aevatar.Scripting.Core/Ports/IScriptCatalogQueryPort.cs rename to src/Aevatar.Scripting.Abstractions/CorePorts/IScriptCatalogQueryPort.cs diff --git a/src/Aevatar.Scripting.Core/Ports/IScriptDefinitionCommandPort.cs b/src/Aevatar.Scripting.Abstractions/CorePorts/IScriptDefinitionCommandPort.cs similarity index 100% rename from src/Aevatar.Scripting.Core/Ports/IScriptDefinitionCommandPort.cs rename to src/Aevatar.Scripting.Abstractions/CorePorts/IScriptDefinitionCommandPort.cs diff --git a/src/platform/Aevatar.GAgentService.Application/Aevatar.GAgentService.Application.csproj b/src/platform/Aevatar.GAgentService.Application/Aevatar.GAgentService.Application.csproj index 437004b52..f6131963f 100644 --- a/src/platform/Aevatar.GAgentService.Application/Aevatar.GAgentService.Application.csproj +++ b/src/platform/Aevatar.GAgentService.Application/Aevatar.GAgentService.Application.csproj @@ -11,7 +11,7 @@ - + diff --git a/src/workflow/Aevatar.Workflow.Application.Abstractions/Queries/WorkflowExecutionQueryModels.cs b/src/workflow/Aevatar.Workflow.Application.Abstractions/Queries/WorkflowExecutionQueryModels.cs index aec0bbef6..91ff799b1 100644 --- a/src/workflow/Aevatar.Workflow.Application.Abstractions/Queries/WorkflowExecutionQueryModels.cs +++ b/src/workflow/Aevatar.Workflow.Application.Abstractions/Queries/WorkflowExecutionQueryModels.cs @@ -120,7 +120,7 @@ public enum WorkflowRunCompletionStatus Unknown = 99, } -public sealed class WorkflowRunReport +public sealed class WorkflowRunExportDocument { public string ReportVersion { get; set; } = "1.0"; public WorkflowRunProjectionScope ProjectionScope { get; set; } = WorkflowRunProjectionScope.Unknown; diff --git a/src/workflow/Aevatar.Workflow.Application.Abstractions/README.md b/src/workflow/Aevatar.Workflow.Application.Abstractions/README.md index 042aea7cf..680d9ee52 100644 --- a/src/workflow/Aevatar.Workflow.Application.Abstractions/README.md +++ b/src/workflow/Aevatar.Workflow.Application.Abstractions/README.md @@ -55,7 +55,7 @@ Aevatar.Workflow.Application.Abstractions/ |------|------| | `IWorkflowExecutionQueryApplicationService` | 查询门面 | | `WorkflowRunSummary` | run 摘要(列表用) | -| `WorkflowRunReport` | run 完整报告 | +| `WorkflowRunExportDocument` | run 导出文档 | | `WorkflowRunStepTrace` | 步骤执行轨迹 | | `WorkflowRunRoleReply` | 角色回复记录 | | `WorkflowRunTimelineEvent` | 时间线事件 | diff --git a/src/workflow/Aevatar.Workflow.Application.Abstractions/Reporting/IWorkflowRunReportExportPort.cs b/src/workflow/Aevatar.Workflow.Application.Abstractions/Reporting/IWorkflowRunReportExportPort.cs index 3a0f1b68d..1e378ce92 100644 --- a/src/workflow/Aevatar.Workflow.Application.Abstractions/Reporting/IWorkflowRunReportExportPort.cs +++ b/src/workflow/Aevatar.Workflow.Application.Abstractions/Reporting/IWorkflowRunReportExportPort.cs @@ -4,5 +4,5 @@ namespace Aevatar.Workflow.Application.Abstractions.Reporting; public interface IWorkflowRunReportExportPort { - Task ExportAsync(WorkflowRunReport report, CancellationToken ct = default); + Task ExportAsync(WorkflowRunExportDocument exportDocument, CancellationToken ct = default); } diff --git a/src/workflow/Aevatar.Workflow.Application/Reporting/NoopWorkflowRunReportExporter.cs b/src/workflow/Aevatar.Workflow.Application/Reporting/NoopWorkflowRunReportExporter.cs index 45720766a..d07e7f840 100644 --- a/src/workflow/Aevatar.Workflow.Application/Reporting/NoopWorkflowRunReportExporter.cs +++ b/src/workflow/Aevatar.Workflow.Application/Reporting/NoopWorkflowRunReportExporter.cs @@ -5,8 +5,9 @@ namespace Aevatar.Workflow.Application.Reporting; internal sealed class NoopWorkflowRunReportExporter : IWorkflowRunReportExportPort { - public Task ExportAsync(WorkflowRunReport report, CancellationToken ct = default) + public Task ExportAsync(WorkflowRunExportDocument exportDocument, CancellationToken ct = default) { + _ = exportDocument; ct.ThrowIfCancellationRequested(); return Task.CompletedTask; } diff --git a/src/workflow/Aevatar.Workflow.Application/Runs/WorkflowRunCommandTarget.cs b/src/workflow/Aevatar.Workflow.Application/Runs/WorkflowRunCommandTarget.cs index 507b5d1fe..446194479 100644 --- a/src/workflow/Aevatar.Workflow.Application/Runs/WorkflowRunCommandTarget.cs +++ b/src/workflow/Aevatar.Workflow.Application/Runs/WorkflowRunCommandTarget.cs @@ -168,7 +168,7 @@ await _projectionPort.DetachReleaseAndDisposeAsync( { try { - await DestroyCreatedActorsAsync(CancellationToken.None); + await DestroyCreatedActorsAsync(ct); } catch (Exception ex) { diff --git a/src/workflow/Aevatar.Workflow.Core/WorkflowRunGAgent.cs b/src/workflow/Aevatar.Workflow.Core/WorkflowRunGAgent.cs index a0faca304..3e04e29b3 100644 --- a/src/workflow/Aevatar.Workflow.Core/WorkflowRunGAgent.cs +++ b/src/workflow/Aevatar.Workflow.Core/WorkflowRunGAgent.cs @@ -509,16 +509,7 @@ private async Task EnsureAgentTreeAsync() foreach (var role in _compiledWorkflow.Roles) { - var roleId = role.Id; - if (string.IsNullOrWhiteSpace(roleId)) - { - Logger.LogWarning( - "Skip workflow role without id while building agent tree. workflow={WorkflowName} actor={ActorId}", - _compiledWorkflow.Name, - Id); - continue; - } - + var roleId = RequireRoleId(role); var childActorId = BuildChildActorId(roleId); var actor = await _runtime.GetAsync(childActorId) ?? await _runtime.CreateAsync(roleAgentType, childActorId); @@ -547,6 +538,16 @@ private string BuildChildActorId(string roleId) return $"{Id}:{roleId.Trim()}"; } + private static string RequireRoleId(RoleDefinition role) + { + ArgumentNullException.ThrowIfNull(role); + + if (string.IsNullOrWhiteSpace(role.Id)) + throw new InvalidOperationException("Role id is required to create child actor."); + + return role.Id.Trim(); + } + private void InstallCognitiveModules() { if (_compiledWorkflow == null) diff --git a/src/workflow/Aevatar.Workflow.Host.Api/Program.cs b/src/workflow/Aevatar.Workflow.Host.Api/Program.cs index a6c539e77..00d638d87 100644 --- a/src/workflow/Aevatar.Workflow.Host.Api/Program.cs +++ b/src/workflow/Aevatar.Workflow.Host.Api/Program.cs @@ -20,6 +20,7 @@ { options.ServiceName = "Aevatar.Workflow.Host.Api"; options.EnableWebSockets = true; + options.DefaultListenUrls = "http://localhost:5100"; }); builder.AddAevatarPlatform(); builder.AddAevatarWorkflowObservability(); diff --git a/src/workflow/Aevatar.Workflow.Host.Api/README.md b/src/workflow/Aevatar.Workflow.Host.Api/README.md index 5fc6b6c48..db62aa251 100644 --- a/src/workflow/Aevatar.Workflow.Host.Api/README.md +++ b/src/workflow/Aevatar.Workflow.Host.Api/README.md @@ -2,6 +2,8 @@ `Aevatar.Workflow.Host.Api` 是协议层宿主,只做 HTTP/SSE/WebSocket 适配与依赖组合。 +零配置本地启动默认监听:`http://localhost:5100` + 能力文档入口: - Host 快速入口:`CHAT_API_CAPABILITIES.md` diff --git a/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/FileSystemWorkflowRunReportExporter.cs b/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/FileSystemWorkflowRunReportExporter.cs index 0071d5849..15d390465 100644 --- a/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/FileSystemWorkflowRunReportExporter.cs +++ b/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/FileSystemWorkflowRunReportExporter.cs @@ -19,9 +19,9 @@ public FileSystemWorkflowRunReportExporter( _logger = logger; } - public async Task ExportAsync(WorkflowRunReport report, CancellationToken ct = default) + public async Task ExportAsync(WorkflowRunExportDocument exportDocument, CancellationToken ct = default) { - ArgumentNullException.ThrowIfNull(report); + ArgumentNullException.ThrowIfNull(exportDocument); if (!_options.Value.Enabled) return; @@ -30,7 +30,7 @@ public async Task ExportAsync(WorkflowRunReport report, CancellationToken ct = d var outputDir = ResolveOutputDirectory(); var (jsonPath, htmlPath) = WorkflowRunReportExportWriter.BuildDefaultPaths(outputDir); - await WorkflowRunReportExportWriter.WriteAsync(report, jsonPath, htmlPath); + await WorkflowRunReportExportWriter.WriteAsync(exportDocument, jsonPath, htmlPath); _logger.LogInformation("Chat run report saved: json={JsonPath}, html={HtmlPath}", jsonPath, htmlPath); } diff --git a/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/WorkflowRunReportExportWriter.cs b/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/WorkflowRunReportExportWriter.cs index f86055465..41bf98bf4 100644 --- a/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/WorkflowRunReportExportWriter.cs +++ b/src/workflow/Aevatar.Workflow.Infrastructure/Reporting/WorkflowRunReportExportWriter.cs @@ -5,7 +5,7 @@ namespace Aevatar.Workflow.Infrastructure.Reporting; -/// Writes WorkflowRunReport export files to JSON and HTML. +/// Writes workflow run export documents to JSON and HTML. public static class WorkflowRunReportExportWriter { private static readonly JsonSerializerOptions JsonOptions = new() @@ -24,19 +24,19 @@ public static (string JsonPath, string HtmlPath) BuildDefaultPaths(string output Path.Combine(outputDirectory, $"workflow-execution-{stamp}.html")); } - public static async Task WriteAsync(WorkflowRunReport report, string jsonPath, string htmlPath) + public static async Task WriteAsync(WorkflowRunExportDocument exportDocument, string jsonPath, string htmlPath) { var dir = Path.GetDirectoryName(jsonPath); if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir); dir = Path.GetDirectoryName(htmlPath); if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir); - var json = JsonSerializer.Serialize(report, JsonOptions); + var json = JsonSerializer.Serialize(exportDocument, JsonOptions); await File.WriteAllTextAsync(jsonPath, json); - await File.WriteAllTextAsync(htmlPath, BuildHtml(report)); + await File.WriteAllTextAsync(htmlPath, BuildHtml(exportDocument)); } - private static string BuildHtml(WorkflowRunReport report) + private static string BuildHtml(WorkflowRunExportDocument exportDocument) { var sb = new StringBuilder(); sb.AppendLine(""); @@ -59,54 +59,54 @@ private static string BuildHtml(WorkflowRunReport report) sb.AppendLine("
"); sb.AppendLine("

Overview

"); sb.AppendLine(""); - AppendRow(sb, "Workflow", report.WorkflowName); - AppendRow(sb, "RootActor", report.RootActorId); - AppendRow(sb, "CommandId", report.CommandId); - AppendRow(sb, "ProjectionScope", report.ProjectionScope.ToString()); - AppendRow(sb, "CompletionStatus", report.CompletionStatus.ToString()); - AppendRow(sb, "TopologySource", report.TopologySource.ToString()); - AppendRow(sb, "Success", report.Success?.ToString() ?? "(unknown)"); - AppendRow(sb, "DurationMs", report.DurationMs.ToString("F2")); - AppendRow(sb, "CreatedAt", report.CreatedAt.ToString("O")); - AppendRow(sb, "UpdatedAt", report.UpdatedAt.ToString("O")); - AppendRow(sb, "StartedAt", report.StartedAt.ToString("O")); - AppendRow(sb, "EndedAt", report.EndedAt.ToString("O")); + AppendRow(sb, "Workflow", exportDocument.WorkflowName); + AppendRow(sb, "RootActor", exportDocument.RootActorId); + AppendRow(sb, "CommandId", exportDocument.CommandId); + AppendRow(sb, "ProjectionScope", exportDocument.ProjectionScope.ToString()); + AppendRow(sb, "CompletionStatus", exportDocument.CompletionStatus.ToString()); + AppendRow(sb, "TopologySource", exportDocument.TopologySource.ToString()); + AppendRow(sb, "Success", exportDocument.Success?.ToString() ?? "(unknown)"); + AppendRow(sb, "DurationMs", exportDocument.DurationMs.ToString("F2")); + AppendRow(sb, "CreatedAt", exportDocument.CreatedAt.ToString("O")); + AppendRow(sb, "UpdatedAt", exportDocument.UpdatedAt.ToString("O")); + AppendRow(sb, "StartedAt", exportDocument.StartedAt.ToString("O")); + AppendRow(sb, "EndedAt", exportDocument.EndedAt.ToString("O")); sb.AppendLine("
"); sb.AppendLine("
"); sb.AppendLine("

Summary

"); - AppendRow(sb, "TotalSteps", report.Summary.TotalSteps.ToString()); - AppendRow(sb, "RequestedSteps", report.Summary.RequestedSteps.ToString()); - AppendRow(sb, "CompletedSteps", report.Summary.CompletedSteps.ToString()); - AppendRow(sb, "RoleReplyCount", report.Summary.RoleReplyCount.ToString()); - foreach (var (stepType, count) in report.Summary.StepTypeCounts.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase)) + AppendRow(sb, "TotalSteps", exportDocument.Summary.TotalSteps.ToString()); + AppendRow(sb, "RequestedSteps", exportDocument.Summary.RequestedSteps.ToString()); + AppendRow(sb, "CompletedSteps", exportDocument.Summary.CompletedSteps.ToString()); + AppendRow(sb, "RoleReplyCount", exportDocument.Summary.RoleReplyCount.ToString()); + foreach (var (stepType, count) in exportDocument.Summary.StepTypeCounts.OrderBy(k => k.Key, StringComparer.OrdinalIgnoreCase)) AppendRow(sb, $"StepType.{stepType}", count.ToString()); sb.AppendLine("
"); sb.AppendLine("

Input

"); - sb.AppendLine($"
{E(report.Input)}
"); + sb.AppendLine($"
{E(exportDocument.Input)}
"); sb.AppendLine("
"); sb.AppendLine("

Final Output

"); - if (!string.IsNullOrWhiteSpace(report.FinalError)) - sb.AppendLine($"
Error: {E(report.FinalError)}
"); - sb.AppendLine($"
{E(report.FinalOutput)}
"); + if (!string.IsNullOrWhiteSpace(exportDocument.FinalError)) + sb.AppendLine($"
Error: {E(exportDocument.FinalError)}
"); + sb.AppendLine($"
{E(exportDocument.FinalOutput)}
"); sb.AppendLine("
"); sb.AppendLine("

Topology

"); sb.AppendLine(""); - if (report.Topology.Count == 0) + if (exportDocument.Topology.Count == 0) sb.AppendLine(""); else { - foreach (var edge in report.Topology) + foreach (var edge in exportDocument.Topology) sb.AppendLine($""); } sb.AppendLine("
ParentChild
(no links)
{E(edge.Parent)}{E(edge.Child)}
"); sb.AppendLine("

Steps

"); sb.AppendLine(""); - foreach (var step in report.Steps) + foreach (var step in exportDocument.Steps) { sb.AppendLine(""); sb.AppendLine($""); @@ -122,11 +122,11 @@ private static string BuildHtml(WorkflowRunReport report) sb.AppendLine("
StepIdTypeTargetRoleSuccessWorkerDurationMsOutputPreviewError
{E(step.StepId)}
"); sb.AppendLine("

Role Replies

"); - if (report.RoleReplies.Count == 0) + if (exportDocument.RoleReplies.Count == 0) sb.AppendLine("
(no role replies captured)
"); else { - foreach (var reply in report.RoleReplies) + foreach (var reply in exportDocument.RoleReplies) { sb.AppendLine("
"); sb.AppendLine($"{E(reply.RoleId)} session={E(reply.SessionId)} chars={reply.ContentLength} time={E(reply.Timestamp.ToString("HH:mm:ss.fff"))}"); @@ -138,7 +138,7 @@ private static string BuildHtml(WorkflowRunReport report) sb.AppendLine("

Timeline

"); sb.AppendLine(""); - foreach (var evt in report.Timeline) + foreach (var evt in exportDocument.Timeline) { sb.AppendLine(""); sb.AppendLine($""); diff --git a/src/workflow/Aevatar.Workflow.Sdk/Options/AevatarWorkflowClientOptions.cs b/src/workflow/Aevatar.Workflow.Sdk/Options/AevatarWorkflowClientOptions.cs index fa798b82e..cc7f481b7 100644 --- a/src/workflow/Aevatar.Workflow.Sdk/Options/AevatarWorkflowClientOptions.cs +++ b/src/workflow/Aevatar.Workflow.Sdk/Options/AevatarWorkflowClientOptions.cs @@ -5,7 +5,7 @@ namespace Aevatar.Workflow.Sdk.Options; public sealed class AevatarWorkflowClientOptions { - public string BaseUrl { get; set; } = "http://localhost:5000"; + public string BaseUrl { get; set; } = "http://localhost:5100"; public IDictionary DefaultHeaders { get; } = new Dictionary(StringComparer.OrdinalIgnoreCase); diff --git a/src/workflow/Aevatar.Workflow.Sdk/README.md b/src/workflow/Aevatar.Workflow.Sdk/README.md index 1f352a1b7..0442af182 100644 --- a/src/workflow/Aevatar.Workflow.Sdk/README.md +++ b/src/workflow/Aevatar.Workflow.Sdk/README.md @@ -8,7 +8,7 @@ - Bridge 回调 token 签发与回调上报 - Workflow/Actor 查询接口 -> 默认对接地址:`http://localhost:5000` +> 默认对接地址:`http://localhost:5100` --- @@ -29,7 +29,7 @@ var services = new ServiceCollection(); services.AddAevatarWorkflowSdk(options => { - options.BaseUrl = "http://localhost:5000"; + options.BaseUrl = "http://localhost:5100"; options.DefaultHeaders["x-tenant-id"] = "demo"; }); ``` @@ -176,12 +176,12 @@ using Microsoft.Extensions.Options; var httpClient = new HttpClient { - BaseAddress = new Uri("http://localhost:5000"), + BaseAddress = new Uri("http://localhost:5100"), }; var options = Options.Create(new AevatarWorkflowClientOptions { - BaseUrl = "http://localhost:5000", + BaseUrl = "http://localhost:5100", }); IAevatarWorkflowClient client = new AevatarWorkflowClient( diff --git a/test/Aevatar.Architecture.Tests/Rules/ActorModelConstraintTests.cs b/test/Aevatar.Architecture.Tests/Rules/ActorModelConstraintTests.cs index 8fb094f62..efb8b1227 100644 --- a/test/Aevatar.Architecture.Tests/Rules/ActorModelConstraintTests.cs +++ b/test/Aevatar.Architecture.Tests/Rules/ActorModelConstraintTests.cs @@ -37,7 +37,7 @@ public void ProjectionPort_ShouldNot_Use_SemaphoreSlim() rule.Check(Arch); } - [Fact(Skip = "Known violation - _liveSinkGate in EventSinkProjectionRuntimeLeaseBase")] + [Fact] public void LeaseClasses_ShouldNot_Declare_Lock_Fields() { // Lease 类禁止持有 lock/gate 字段 diff --git a/test/Aevatar.Architecture.Tests/Rules/NamingConventionTests.cs b/test/Aevatar.Architecture.Tests/Rules/NamingConventionTests.cs index f000b8ccf..eba2200ba 100644 --- a/test/Aevatar.Architecture.Tests/Rules/NamingConventionTests.cs +++ b/test/Aevatar.Architecture.Tests/Rules/NamingConventionTests.cs @@ -61,7 +61,7 @@ public void LegacyWorkflowReadModelNaming_ShouldNot_Exist() rule.Check(Arch); } - [Fact(Skip = "Known violation - WorkflowRunReport exists in Aevatar.Workflow.Application.Abstractions.Queries")] + [Fact] public void LegacyWorkflowReportArtifact_ShouldNot_Exist() { IArchRule rule = Types().That() diff --git a/test/Aevatar.Bootstrap.Tests/BootstrapServiceCollectionExtensionsTests.cs b/test/Aevatar.Bootstrap.Tests/BootstrapServiceCollectionExtensionsTests.cs index 8b68f5313..86143f43a 100644 --- a/test/Aevatar.Bootstrap.Tests/BootstrapServiceCollectionExtensionsTests.cs +++ b/test/Aevatar.Bootstrap.Tests/BootstrapServiceCollectionExtensionsTests.cs @@ -112,6 +112,46 @@ public void AddAevatarDefaultHost_ShouldLoadEnvironmentAppSettingsFromApplicatio } } + [Fact] + public void AddAevatarDefaultHost_ShouldApplyDefaultListenUrls_WhenNoExplicitAddressConfigured() + { + using var home = new TemporaryAevatarHomeScope(); + var builder = CreateBuilder(); + + builder.AddAevatarDefaultHost(options => + { + options.EnableConnectorBootstrap = false; + options.EnableCors = false; + options.DefaultListenUrls = "http://localhost:5100"; + }); + + builder.WebHost + .GetSetting(WebHostDefaults.ServerUrlsKey) + .Should() + .Be("http://localhost:5100"); + } + + [Fact] + public void AddAevatarDefaultHost_ShouldNotOverrideExplicitUrlsConfiguration() + { + using var home = new TemporaryAevatarHomeScope(); + var builder = CreateBuilder(); + builder.Configuration.AddInMemoryCollection(new Dictionary + { + [WebHostDefaults.ServerUrlsKey] = "http://localhost:6200", + }); + + builder.AddAevatarDefaultHost(options => + { + options.EnableConnectorBootstrap = false; + options.EnableCors = false; + options.DefaultListenUrls = "http://localhost:5100"; + }); + + builder.Configuration[WebHostDefaults.ServerUrlsKey].Should().Be("http://localhost:6200"); + builder.WebHost.GetSetting(WebHostDefaults.ServerUrlsKey).Should().Be("http://localhost:6200"); + } + [Fact] public void UseAevatarDefaultHost_WhenAutoMapCapabilitiesDisabled_ShouldOnlyMapRootHealthRoute() { diff --git a/test/Aevatar.CQRS.Core.Tests/DefaultCommandInteractionServiceTests.cs b/test/Aevatar.CQRS.Core.Tests/DefaultCommandInteractionServiceTests.cs index a8a33fd4d..a2dfe1ea9 100644 --- a/test/Aevatar.CQRS.Core.Tests/DefaultCommandInteractionServiceTests.cs +++ b/test/Aevatar.CQRS.Core.Tests/DefaultCommandInteractionServiceTests.cs @@ -182,19 +182,52 @@ await act.Should().ThrowAsync() target.ReleaseCalls[0].Cleanup.ObservedCompleted.Should().BeFalse(); } + [Fact] + public async Task ExecuteAsync_ShouldPassShutdownToken_ToCleanup() + { + using var cts = new CancellationTokenSource(); + var sink = new EventChannel(); + sink.Push("done:completed"); + sink.Complete(); + + var target = new TestTarget("target-1", sink); + var receipt = new TestReceipt("target-1", "receipt-5"); + var service = CreateService( + new TestDispatchPipeline(CommandTargetResolution, string>.Success( + new CommandDispatchExecution + { + Target = target, + Context = new CommandContext("target-1", "cmd-5", "corr-5", new Dictionary()), + Envelope = new Aevatar.Foundation.Abstractions.EventEnvelope { Id = "env-5" }, + Receipt = receipt, + })), + shutdownSignal: new TestShutdownSignal(cts.Token)); + + var result = await service.ExecuteAsync( + "command-5", + static (_, _) => ValueTask.CompletedTask, + ct: CancellationToken.None); + + result.Succeeded.Should().BeTrue(); + target.ReleaseTokens.Should().ContainSingle().Which.Should().Be(cts.Token); + } + private static DefaultCommandInteractionService CreateService( ICommandDispatchPipeline dispatchPipeline, ICommandCompletionPolicy? completionPolicy = null, ICommandFinalizeEmitter? finalizeEmitter = null, - ICommandDurableCompletionResolver? durableResolver = null) => + ICommandDurableCompletionResolver? durableResolver = null, + ICommandDispatchShutdownSignal? shutdownSignal = null) => new( dispatchPipeline, new DefaultEventOutputStream(new PassThroughFrameMapper()), completionPolicy ?? new TestCompletionPolicy(), finalizeEmitter ?? new RecordingFinalizeEmitter(), - durableResolver ?? new RecordingDurableResolver(CommandDurableCompletionObservation.Incomplete)); + durableResolver ?? new RecordingDurableResolver(CommandDurableCompletionObservation.Incomplete), + shutdownSignal: shutdownSignal); private sealed record TestReceipt(string TargetId, string ReceiptId); + private sealed record TestShutdownSignal(CancellationToken ShutdownToken) : ICommandDispatchShutdownSignal; private sealed class TestTarget(string targetId, IEventSink sink) : ICommandEventTarget, @@ -202,6 +235,7 @@ private sealed class TestTarget(string targetId, IEventSink sink) { public string TargetId { get; } = targetId; public List<(TestReceipt Receipt, CommandInteractionCleanupContext Cleanup)> ReleaseCalls { get; } = []; + public List ReleaseTokens { get; } = []; public Exception? ReleaseException { get; set; } public IEventSink RequireLiveSink() => sink; @@ -213,6 +247,7 @@ public Task ReleaseAfterInteractionAsync( { ct.ThrowIfCancellationRequested(); ReleaseCalls.Add((receipt, cleanup)); + ReleaseTokens.Add(ct); if (ReleaseException != null) throw ReleaseException; diff --git a/test/Aevatar.CQRS.Core.Tests/DefaultDetachedCommandDispatchServiceTests.cs b/test/Aevatar.CQRS.Core.Tests/DefaultDetachedCommandDispatchServiceTests.cs index 977cf7a4d..59b94391a 100644 --- a/test/Aevatar.CQRS.Core.Tests/DefaultDetachedCommandDispatchServiceTests.cs +++ b/test/Aevatar.CQRS.Core.Tests/DefaultDetachedCommandDispatchServiceTests.cs @@ -92,6 +92,74 @@ public async Task ShutdownSignal_ShouldCancelInflightDrain() target.ReleaseCalls[0].Cleanup.ObservedCompleted.Should().BeFalse(); } + [Fact] + public async Task DispatchAsync_ShouldPassShutdownToken_ToCleanup() + { + using var cts = new CancellationTokenSource(); + var sink = new EventChannel(); + sink.Push("done:completed"); + sink.Complete(); + + var target = new DetachedTestTarget("target-4", sink); + var receipt = new DetachedReceipt("target-4", "receipt-4"); + var service = new DefaultDetachedCommandDispatchService( + new DetachedPipeline(CommandTargetResolution, string>.Success( + new CommandDispatchExecution + { + Target = target, + Context = new CommandContext("target-4", "cmd-4", "corr-4", new Dictionary()), + Envelope = new Aevatar.Foundation.Abstractions.EventEnvelope { Id = "env-4" }, + Receipt = receipt, + })), + new DetachedOutputStream(), + new DetachedCompletionPolicy(), + new DetachedDurableResolver(CommandDurableCompletionObservation.Incomplete), + shutdownSignal: new TestShutdownSignal(cts.Token)); + + await service.DispatchAsync("command-4", CancellationToken.None); + + await target.ReleaseObserved.Task.WaitAsync(TimeSpan.FromSeconds(5)); + target.ReleaseTokens.Should().ContainSingle().Which.Should().Be(cts.Token); + } + + [Fact] + public async Task DispatchAsync_ShouldReturnBeforeBufferedCleanup_Completes() + { + var sink = new EventChannel(); + sink.Push("done:completed"); + sink.Complete(); + + var allowCleanup = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); + var target = new BlockingDetachedTestTarget("target-5", sink, allowCleanup.Task); + var receipt = new DetachedReceipt("target-5", "receipt-5"); + var service = new DefaultDetachedCommandDispatchService( + new BlockingDetachedPipeline(CommandTargetResolution, string>.Success( + new CommandDispatchExecution + { + Target = target, + Context = new CommandContext("target-5", "cmd-5", "corr-5", new Dictionary()), + Envelope = new Aevatar.Foundation.Abstractions.EventEnvelope { Id = "env-5" }, + Receipt = receipt, + })), + new DetachedOutputStream(), + new DetachedCompletionPolicy(), + new DetachedDurableResolver(CommandDurableCompletionObservation.Incomplete)); + + var dispatchTask = service.DispatchAsync("command-5", CancellationToken.None); + + var dispatchResult = await dispatchTask.WaitAsync(TimeSpan.FromSeconds(1)); + dispatchResult.Succeeded.Should().BeTrue(); + dispatchResult.Receipt.Should().Be(receipt); + + await target.ReleaseStarted.Task.WaitAsync(TimeSpan.FromSeconds(5)); + target.ReleaseObserved.Task.IsCompleted.Should().BeFalse(); + + allowCleanup.TrySetResult(true); + + await target.ReleaseObserved.Task.WaitAsync(TimeSpan.FromSeconds(5)); + target.ReleaseCalls.Should().ContainSingle(); + } + [Fact] public async Task DisposeAsync_ShouldDrainInflightTasks() { @@ -134,6 +202,7 @@ private sealed class DetachedTestTarget(string targetId, IEventSink sink public string TargetId { get; } = targetId; public List<(DetachedReceipt Receipt, CommandInteractionCleanupContext Cleanup)> ReleaseCalls { get; } = []; + public List ReleaseTokens { get; } = []; public TaskCompletionSource ReleaseObserved { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously); public IEventSink RequireLiveSink() => sink; @@ -144,6 +213,7 @@ public Task ReleaseAfterInteractionAsync( CancellationToken ct = default) { ReleaseCalls.Add((receipt, cleanup)); + ReleaseTokens.Add(ct); ReleaseObserved.TrySetResult(true); return Task.CompletedTask; } @@ -188,6 +258,72 @@ private async Task sink, + Task cleanupGate) + : ICommandEventTarget, + ICommandInteractionCleanupTarget + { + public string TargetId { get; } = targetId; + + public List<(DetachedReceipt Receipt, CommandInteractionCleanupContext Cleanup)> ReleaseCalls { get; } = []; + public TaskCompletionSource ReleaseStarted { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously); + public TaskCompletionSource ReleaseObserved { get; } = new(TaskCreationOptions.RunContinuationsAsynchronously); + + public IEventSink RequireLiveSink() => sink; + + public async Task ReleaseAfterInteractionAsync( + DetachedReceipt receipt, + CommandInteractionCleanupContext cleanup, + CancellationToken ct = default) + { + ReleaseStarted.TrySetResult(true); + await cleanupGate.WaitAsync(ct); + ReleaseCalls.Add((receipt, cleanup)); + ReleaseObserved.TrySetResult(true); + } + } + + private sealed class BlockingDetachedPipeline( + CommandTargetResolution, string> result) + : ICommandDispatchPipeline + { + public Task, string>> PrepareAsync( + string command, + CancellationToken ct = default) + { + _ = command; + ct.ThrowIfCancellationRequested(); + return Task.FromResult(result); + } + + public Task DispatchPreparedAsync( + CommandDispatchExecution execution, + CancellationToken ct = default) + { + _ = execution; + ct.ThrowIfCancellationRequested(); + return Task.CompletedTask; + } + + public Task, string>> DispatchAsync( + string command, + CancellationToken ct = default) => + DispatchAsyncCore(command, ct); + + private async Task, string>> DispatchAsyncCore( + string command, + CancellationToken ct) + { + var prepared = await PrepareAsync(command, ct); + if (!prepared.Succeeded || prepared.Target == null) + return prepared; + await DispatchPreparedAsync(prepared.Target, ct); + return prepared; + } + } + private sealed class DetachedOutputStream : IEventOutputStream { private readonly TaskCompletionSource? _onPumpStarted; diff --git a/test/Aevatar.Scripting.Core.Tests/Compilation/ScriptArtifactCoverageTests.cs b/test/Aevatar.Scripting.Core.Tests/Compilation/ScriptArtifactCoverageTests.cs index 365d34992..73e9c238a 100644 --- a/test/Aevatar.Scripting.Core.Tests/Compilation/ScriptArtifactCoverageTests.cs +++ b/test/Aevatar.Scripting.Core.Tests/Compilation/ScriptArtifactCoverageTests.cs @@ -52,43 +52,35 @@ public void CachedResolver_ShouldReturnCachedArtifactWithoutRecompiling() } [Fact] - public async Task CachedResolver_ShouldDisposeDuplicateArtifact_WhenConcurrentCompilationLosesCacheRace() + public async Task CachedResolver_ShouldShareSingleInflightCompile_WhenConcurrentCallersResolveSameArtifact() { - var firstCompileEntered = new ManualResetEventSlim(false); + var firstCompileEntered = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); var allowFirstCompileToReturn = new ManualResetEventSlim(false); - var secondCompileReturned = new ManualResetEventSlim(false); - var firstArtifactDisposed = 0; - var secondArtifactDisposed = 0; - var compiler = new ConcurrentRaceCompiler( - onFirstCompile: () => + var compiler = new BlockingCompiler( + onCompile: () => { - firstCompileEntered.Set(); - allowFirstCompileToReturn.Wait(); - return CreateArtifact("script-1", "rev-1", () => firstArtifactDisposed += 1); - }, - onSecondCompile: () => - { - var artifact = CreateArtifact("script-1", "rev-1", () => secondArtifactDisposed += 1); - secondCompileReturned.Set(); - return artifact; + firstCompileEntered.TrySetResult(true); + if (!allowFirstCompileToReturn.Wait(TimeSpan.FromSeconds(5))) + { + throw new TimeoutException("Timed out waiting to release the first compilation."); + } + + return CreateArtifact("script-1", "rev-1"); }); var resolver = new CachedScriptBehaviorArtifactResolver(compiler); var request = CreateRequest(); var firstTask = Task.Run(() => resolver.Resolve(request)); - firstCompileEntered.Wait(); + await firstCompileEntered.Task.WaitAsync(TimeSpan.FromSeconds(5)); var secondTask = Task.Run(() => resolver.Resolve(request)); - secondCompileReturned.Wait(); allowFirstCompileToReturn.Set(); - var resolved = await Task.WhenAll(firstTask, secondTask); + var resolved = await Task.WhenAll(firstTask, secondTask).WaitAsync(TimeSpan.FromSeconds(5)); resolved[0].Should().BeSameAs(resolved[1]); - compiler.CallCount.Should().Be(2); - firstArtifactDisposed.Should().Be(1); - secondArtifactDisposed.Should().Be(0); + compiler.CallCount.Should().Be(1); } [Fact] @@ -152,9 +144,7 @@ public ScriptBehaviorCompilationResult Compile(ScriptBehaviorCompilationRequest } } - private sealed class ConcurrentRaceCompiler( - Func onFirstCompile, - Func onSecondCompile) : IScriptBehaviorCompiler + private sealed class BlockingCompiler(Func onCompile) : IScriptBehaviorCompiler { private int _callCount; @@ -163,14 +153,8 @@ private sealed class ConcurrentRaceCompiler( public ScriptBehaviorCompilationResult Compile(ScriptBehaviorCompilationRequest request) { _ = request; - var call = Interlocked.Increment(ref _callCount); - var artifact = call switch - { - 1 => onFirstCompile(), - 2 => onSecondCompile(), - _ => throw new InvalidOperationException("Unexpected compile call."), - }; - + Interlocked.Increment(ref _callCount); + var artifact = onCompile(); return new ScriptBehaviorCompilationResult(true, artifact, Array.Empty()); } } diff --git a/test/Aevatar.Tools.Cli.Tests/ChatWorkflowCommandHandlerTests.cs b/test/Aevatar.Tools.Cli.Tests/ChatWorkflowCommandHandlerTests.cs index 09b5aae46..19127a9f8 100644 --- a/test/Aevatar.Tools.Cli.Tests/ChatWorkflowCommandHandlerTests.cs +++ b/test/Aevatar.Tools.Cli.Tests/ChatWorkflowCommandHandlerTests.cs @@ -33,7 +33,7 @@ public async Task RunWorkflowYamlAsync_WithYes_ShouldSaveYamlToAevatarHomeWorkfl () => ChatCommandHandler.RunWorkflowYamlAsync( message: "Generate workflow yaml", readFromStdin: false, - urlOverride: "http://localhost:5000", + urlOverride: "http://localhost:5100", filenameOverride: null, yes: true, cancellationToken: CancellationToken.None, @@ -80,7 +80,7 @@ public async Task RunWorkflowYamlAsync_WhenConfirmationAccepted_ShouldSaveYamlFi () => ChatCommandHandler.RunWorkflowYamlAsync( message: "Generate workflow yaml", readFromStdin: false, - urlOverride: "http://localhost:5000", + urlOverride: "http://localhost:5100", filenameOverride: "confirmed", yes: false, cancellationToken: CancellationToken.None, @@ -120,7 +120,7 @@ public async Task RunWorkflowYamlAsync_WhenConfirmationDeclined_ShouldNotSaveFil () => ChatCommandHandler.RunWorkflowYamlAsync( message: "Generate workflow yaml", readFromStdin: false, - urlOverride: "http://localhost:5000", + urlOverride: "http://localhost:5100", filenameOverride: "declined", yes: false, cancellationToken: CancellationToken.None, @@ -174,7 +174,7 @@ public async Task RunWorkflowYamlAsync_ShouldPreferValidateYamlStepOutput_WhenMu () => ChatCommandHandler.RunWorkflowYamlAsync( message: "Generate workflow yaml", readFromStdin: false, - urlOverride: "http://localhost:5000", + urlOverride: "http://localhost:5100", filenameOverride: "preferred", yes: true, cancellationToken: CancellationToken.None, diff --git a/test/Aevatar.Workflow.Application.Tests/WorkflowRunActorResolverTests.cs b/test/Aevatar.Workflow.Application.Tests/WorkflowRunActorResolverTests.cs index 97819e389..f2198323b 100644 --- a/test/Aevatar.Workflow.Application.Tests/WorkflowRunActorResolverTests.cs +++ b/test/Aevatar.Workflow.Application.Tests/WorkflowRunActorResolverTests.cs @@ -34,7 +34,7 @@ public async Task ResolveOrCreateAsync_ShouldForwardScopeIdFromTypedRequest() { var bindingReader = new StaticWorkflowActorBindingReader(null); var actorPort = new RecordingWorkflowRunActorPort(); - var registry = new InMemoryWorkflowDefinitionRegistry(); + var registry = new InMemoryWorkflowDefinitionCatalog(); registry.Register("direct", "name: direct\nroles: []\nsteps: []\n"); var resolver = new WorkflowRunActorResolver(bindingReader, actorPort, registry); diff --git a/test/Aevatar.Workflow.Application.Tests/WorkflowRunCommandTargetAndPolicyTests.cs b/test/Aevatar.Workflow.Application.Tests/WorkflowRunCommandTargetAndPolicyTests.cs index 4846059a7..60333f448 100644 --- a/test/Aevatar.Workflow.Application.Tests/WorkflowRunCommandTargetAndPolicyTests.cs +++ b/test/Aevatar.Workflow.Application.Tests/WorkflowRunCommandTargetAndPolicyTests.cs @@ -185,7 +185,7 @@ public async Task NoopWorkflowRunReportExporter_ShouldHonorCancellation() using var cts = new CancellationTokenSource(); cts.Cancel(); - var act = async () => await exporter.ExportAsync(new WorkflowRunReport(), cts.Token); + var act = async () => await exporter.ExportAsync(new WorkflowRunExportDocument(), cts.Token); await act.Should().ThrowAsync(); } @@ -195,7 +195,7 @@ public async Task NoopWorkflowRunReportExporter_ShouldCompleteWithoutSideEffects { IWorkflowRunReportExportPort exporter = new NoopWorkflowRunReportExporter(); - await exporter.ExportAsync(new WorkflowRunReport(), CancellationToken.None); + await exporter.ExportAsync(new WorkflowRunExportDocument(), CancellationToken.None); } private static WorkflowRunCommandTarget CreateTarget( diff --git a/test/Aevatar.Workflow.Host.Api.Tests/WorkflowInfrastructureCoverageTests.cs b/test/Aevatar.Workflow.Host.Api.Tests/WorkflowInfrastructureCoverageTests.cs index 4fd4f37ac..4b8683854 100644 --- a/test/Aevatar.Workflow.Host.Api.Tests/WorkflowInfrastructureCoverageTests.cs +++ b/test/Aevatar.Workflow.Host.Api.Tests/WorkflowInfrastructureCoverageTests.cs @@ -301,18 +301,18 @@ public async Task WorkflowDefinitionBootstrapHostedService_ShouldLoadConfiguredD private sealed class FakeReportExporter : IWorkflowRunReportExportPort { - public Task ExportAsync(WorkflowRunReport report, CancellationToken ct = default) + public Task ExportAsync(WorkflowRunExportDocument exportDocument, CancellationToken ct = default) { - _ = report; + _ = exportDocument; ct.ThrowIfCancellationRequested(); return Task.CompletedTask; } } - private static WorkflowRunReport BuildReport() + private static WorkflowRunExportDocument BuildReport() { var started = DateTimeOffset.UtcNow; - return new WorkflowRunReport + return new WorkflowRunExportDocument { WorkflowName = "workflow-report", RootActorId = "root-1", diff --git a/test/Aevatar.Workflow.Host.Api.Tests/WorkflowRunReportExportWriterTests.cs b/test/Aevatar.Workflow.Host.Api.Tests/WorkflowRunReportExportWriterTests.cs index 0aca56ff2..683ec16f4 100644 --- a/test/Aevatar.Workflow.Host.Api.Tests/WorkflowRunReportExportWriterTests.cs +++ b/test/Aevatar.Workflow.Host.Api.Tests/WorkflowRunReportExportWriterTests.cs @@ -93,13 +93,13 @@ public async Task WriteAsync_WhenTopologyAndRepliesEmpty_ShouldRenderEmptyState( } } - private static WorkflowRunReport BuildReport( + private static WorkflowRunExportDocument BuildReport( string finalError, bool withTopology, bool withRoleReplies) { var started = DateTimeOffset.UtcNow; - return new WorkflowRunReport + return new WorkflowRunExportDocument { WorkflowName = "wf
", RootActorId = "root&1", diff --git a/test/Aevatar.Workflow.Sdk.Tests/AevatarWorkflowClientTests.cs b/test/Aevatar.Workflow.Sdk.Tests/AevatarWorkflowClientTests.cs index d74e08149..0381f7de9 100644 --- a/test/Aevatar.Workflow.Sdk.Tests/AevatarWorkflowClientTests.cs +++ b/test/Aevatar.Workflow.Sdk.Tests/AevatarWorkflowClientTests.cs @@ -247,11 +247,11 @@ private static IAevatarWorkflowClient CreateClient( { var httpClient = new HttpClient(new TestHttpMessageHandler(handler)) { - BaseAddress = new Uri("http://localhost:5000"), + BaseAddress = new Uri("http://localhost:5100"), }; var options = Microsoft.Extensions.Options.Options.Create(new AevatarWorkflowClientOptions { - BaseUrl = "http://localhost:5000", + BaseUrl = "http://localhost:5100", }); return new AevatarWorkflowClient(httpClient, new SseChatTransport(), options); } diff --git a/test/Aevatar.Workflow.Sdk.Tests/Session/WorkflowClientSessionExtensionsTests.cs b/test/Aevatar.Workflow.Sdk.Tests/Session/WorkflowClientSessionExtensionsTests.cs index 68e95ca2c..b33dbdcff 100644 --- a/test/Aevatar.Workflow.Sdk.Tests/Session/WorkflowClientSessionExtensionsTests.cs +++ b/test/Aevatar.Workflow.Sdk.Tests/Session/WorkflowClientSessionExtensionsTests.cs @@ -53,11 +53,11 @@ private static IAevatarWorkflowClient CreateClient( { var httpClient = new HttpClient(new TestHttpMessageHandler(handler)) { - BaseAddress = new Uri("http://localhost:5000"), + BaseAddress = new Uri("http://localhost:5100"), }; var options = Microsoft.Extensions.Options.Options.Create(new AevatarWorkflowClientOptions { - BaseUrl = "http://localhost:5000", + BaseUrl = "http://localhost:5100", }); return new AevatarWorkflowClient(httpClient, new SseChatTransport(), options); } diff --git a/test/Aevatar.Workflow.Sdk.Tests/Streaming/SseChatTransportTests.cs b/test/Aevatar.Workflow.Sdk.Tests/Streaming/SseChatTransportTests.cs index add592f07..c59b13fc5 100644 --- a/test/Aevatar.Workflow.Sdk.Tests/Streaming/SseChatTransportTests.cs +++ b/test/Aevatar.Workflow.Sdk.Tests/Streaming/SseChatTransportTests.cs @@ -29,7 +29,7 @@ public async Task StreamAsync_ShouldParseFramesInOrder() { Content = new StringContent(ssePayload, Encoding.UTF8, "text/event-stream"), })); - var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5000") }; + var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5100") }; var transport = new SseChatTransport(); var events = new List(); @@ -64,7 +64,7 @@ public async Task StreamAsync_WhenHttpError_ShouldThrowStructuredException() Encoding.UTF8, "application/json"), })); - var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5000") }; + var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5100") }; var transport = new SseChatTransport(); var act = async () => @@ -96,7 +96,7 @@ public async Task StreamAsync_ShouldPreserveUnknownFrameFieldsInExtensionData() { Content = new StringContent(ssePayload, Encoding.UTF8, "text/event-stream"), })); - var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5000") }; + var client = new HttpClient(handler) { BaseAddress = new Uri("http://localhost:5100") }; var transport = new SseChatTransport(); var events = new List(); diff --git a/tools/Aevatar.Tools.Cli/Commands/Chat/ChatCommand.cs b/tools/Aevatar.Tools.Cli/Commands/Chat/ChatCommand.cs index 9f55767ad..fc4d95fc3 100644 --- a/tools/Aevatar.Tools.Cli/Commands/Chat/ChatCommand.cs +++ b/tools/Aevatar.Tools.Cli/Commands/Chat/ChatCommand.cs @@ -69,7 +69,7 @@ private static Command CreateConfigCommand() private static Command CreateSetUrlCommand() { var command = new Command("set-url", "Persist chat API base URL."); - var urlArgument = new Argument("url", "Absolute API base URL, e.g. http://localhost:5000"); + var urlArgument = new Argument("url", "Absolute API base URL, e.g. http://localhost:5100"); command.AddArgument(urlArgument); command.SetHandler((string url) => ChatCommandHandler.SetApiBaseUrl(url), urlArgument); return command; diff --git a/tools/Aevatar.Tools.Cli/README.md b/tools/Aevatar.Tools.Cli/README.md index a72033588..68e13549c 100644 --- a/tools/Aevatar.Tools.Cli/README.md +++ b/tools/Aevatar.Tools.Cli/README.md @@ -56,7 +56,7 @@ aevatar config secrets get LLMProviders:Providers:deepseek:ApiKey --json aevatar config secrets remove LLMProviders:Providers:deepseek:ApiKey --yes --json # config.json key-value -aevatar config config-json set Cli:App:ApiBaseUrl http://localhost:5000 --json +aevatar config config-json set Cli:App:ApiBaseUrl http://localhost:5100 --json aevatar config config-json get Cli:App:ApiBaseUrl --json ``` @@ -86,7 +86,7 @@ aevatar app aevatar app --no-browser --port 6690 # optional explicit SDK base url -aevatar app --api-base http://localhost:5000 +aevatar app --api-base http://localhost:5100 # force restart app on port (kill listener process then relaunch) aevatar app restart @@ -173,7 +173,7 @@ aevatar chat "summarize current workflow status" aevatar chat "hello" --port 6690 # one-shot override remote workflow API base url -aevatar chat "hello" --url http://localhost:5000 +aevatar chat "hello" --url http://localhost:5100 ``` ```bash @@ -184,7 +184,7 @@ aevatar chat workflow "build a customer-support triage workflow" echo "design an incident response workflow with human approval" | aevatar chat workflow --stdin --yes # custom API base and output filename -aevatar chat workflow "generate a rollout plan workflow with approval gate" --url http://localhost:5000 --filename rollout_plan +aevatar chat workflow "generate a rollout plan workflow with approval gate" --url http://localhost:5100 --filename rollout_plan ``` `aevatar chat workflow` writes files to `AEVATAR_HOME/workflows` (`~/.aevatar/workflows` by default). @@ -192,7 +192,7 @@ Without `--yes`, it prompts for confirmation before saving. ```bash # persist chat/app remote workflow API base url -aevatar chat config set-url http://localhost:5000 +aevatar chat config set-url http://localhost:5100 # read persisted url aevatar chat config get-url diff --git a/tools/Aevatar.Tools.Cli/wwwroot/playground/app.css b/tools/Aevatar.Tools.Cli/wwwroot/playground/app.css index e897a9bc5..26089c07c 100644 --- a/tools/Aevatar.Tools.Cli/wwwroot/playground/app.css +++ b/tools/Aevatar.Tools.Cli/wwwroot/playground/app.css @@ -1 +1 @@ -.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-editor .synthetic-focus,.monaco-diff-editor .synthetic-focus,.monaco-editor [tabindex="0"]:focus,.monaco-diff-editor [tabindex="0"]:focus,.monaco-editor [tabindex="-1"]:focus,.monaco-diff-editor [tabindex="-1"]:focus,.monaco-editor button:focus,.monaco-diff-editor button:focus,.monaco-editor input[type=button]:focus,.monaco-diff-editor input[type=button]:focus,.monaco-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-editor input[type=search]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-editor input[type=text]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-editor select:focus,.monaco-diff-editor select:focus,.monaco-editor textarea:focus,.monaco-diff-editor textarea:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background);overflow-wrap:initial}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .editorCanvas{position:absolute;width:100%;height:100%;z-index:0;pointer-events:none}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar{background:var(--vscode-scrollbar-background)}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .line-numbers{bottom:0;font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-mouse-cursor-text{cursor:text}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{-moz-user-select:text;user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{-moz-user-select:initial;user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{box-sizing:border-box;position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{top:0;bottom:0;position:absolute}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px;pointer-events:none}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.minimap-autohide-mouseover,.minimap.minimap-autohide-scroll{opacity:0;transition:opacity .5s}.minimap.minimap-autohide-scroll{pointer-events:none}.minimap.minimap-autohide-mouseover:hover,.minimap.minimap-autohide-scroll.active{opacity:1;pointer-events:auto}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .monaco-decoration-css-rule-extractor{visibility:hidden;pointer-events:none}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .native-edit-context{margin:0;padding:0;position:absolute;overflow-y:scroll;scrollbar-width:none;z-index:-10;white-space:pre-wrap}.monaco-editor .ime-text-area{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .edit-context-composition-none{background-color:transparent;border-bottom:none}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-secondary{border-bottom:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-primary{border-bottom:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-secondary{border:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-primary{border:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor .margin-view-overlays .gpu-mark{position:absolute;top:0;bottom:0;left:0;width:100%;display:inline-block;border-left:solid 2px var(--vscode-editorWarning-foreground);opacity:.2;transition:background-color .1s linear}.monaco-editor .margin-view-overlays .gpu-mark:hover{background-color:var(--vscode-editorWarning-foreground)}.monaco-hover.workbench-hover{position:relative;font-size:13px;line-height:19px;z-index:40;overflow:hidden;max-width:700px;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:5px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow)}.monaco-hover.workbench-hover .monaco-action-bar .action-item .codicon{width:13px;height:13px}.monaco-hover.workbench-hover hr{border-bottom:none}.monaco-hover.workbench-hover.compact{font-size:12px}.monaco-hover.workbench-hover.compact .monaco-action-bar .action-item .codicon{width:12px;height:12px}.monaco-hover.workbench-hover.compact .hover-contents{padding:2px 8px}.workbench-hover-container.locked .monaco-hover.workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:focus-within.locked .monaco-hover.workbench-hover{outline-color:var(--vscode-focusBorder)}.workbench-hover-pointer{position:absolute;z-index:41;pointer-events:none}.workbench-hover-pointer:after{content:"";position:absolute;width:5px;height:5px;background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:not(:focus-within).locked .workbench-hover-pointer:after{width:4px;height:4px;border-right-width:2px;border-bottom-width:2px}.workbench-hover-container:focus-within .workbench-hover-pointer:after{border-right:1px solid var(--vscode-focusBorder);border-bottom:1px solid var(--vscode-focusBorder)}.workbench-hover-pointer.left{left:-3px}.workbench-hover-pointer.right{right:3px}.workbench-hover-pointer.top{top:-3px}.workbench-hover-pointer.bottom{bottom:3px}.workbench-hover-pointer.left:after{transform:rotate(135deg)}.workbench-hover-pointer.right:after{transform:rotate(315deg)}.workbench-hover-pointer.top:after{transform:rotate(225deg)}.workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-hover.workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-hover.workbench-hover a:focus{outline:1px solid;outline-offset:-1px;text-decoration:underline;outline-color:var(--vscode-focusBorder)}.monaco-hover.workbench-hover a.codicon:focus,.monaco-hover.workbench-hover a.monaco-button:focus{text-decoration:none}.monaco-hover.workbench-hover a:hover,.monaco-hover.workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-hover.workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-hover.workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-hover.workbench-hover.right-aligned{left:1px}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-right:0;margin-left:16px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;-moz-user-select:text;user-select:text;-webkit-user-select:text;box-sizing:border-box;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.fade-in{animation:fadein .1s linear}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer;overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px;vertical-align:middle}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);-webkit-text-decoration:var(--text-link-decoration);text-decoration:var(--text-link-decoration)}.monaco-hover .hover-row.status-bar .actions .action-container a .icon.codicon{color:var(--vscode-textLink-foreground)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*=background-color]{margin-bottom:4px;display:inline-block}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{-webkit-user-select:none;-moz-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-hover .action-container,.monaco-hover .action,.monaco-hover button,.monaco-hover .monaco-button,.monaco-hover .monaco-text-button,.monaco-hover [role=button]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:3px;min-height:24px}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000;background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-list-focusOutline);outline-offset:-1px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label:not(.icon),.monaco-action-bar .action-item.disabled .action-label:not(.icon):before,.monaco-action-bar .action-item.disabled .action-label:not(.icon):hover{color:var(--vscode-disabledForeground)}.monaco-action-bar .action-item.disabled .action-label.icon,.monaco-action-bar .action-item.disabled .action-label.icon:before,.monaco-action-bar .action-item.disabled .action-label.icon:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid var(--vscode-disabledForeground);padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:var(--vscode-disabledForeground)}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{color:var(--vscode-descriptionForeground);overflow:hidden;border-radius:2px}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-action-bar .checkbox-action-item{display:flex;align-items:center;border-radius:2px;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{cursor:grab;display:flex;align-items:center;border-top-right-radius:5px;border-top-left-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-inline-action-bar>.actions-container>.action-item:first-child{margin-left:5px}.quick-input-inline-action-bar>.actions-container>.action-item{margin-top:2px}.quick-input-title{cursor:grab;padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-right-action-bar>.actions-container>.action-item{margin-left:4px}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{cursor:grab;display:flex;padding:6px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-widget .quick-input-header .monaco-checkbox{margin-top:6px}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 6px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-widget .monaco-checkbox{margin-right:0}.quick-input-widget .quick-input-list .monaco-checkbox,.quick-input-widget .quick-input-tree .monaco-checkbox{margin-top:4px}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{font-weight:700;background-color:unset;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.quick-input-list>.monaco-list:focus .monaco-list-row.focused .quick-input-list-entry.quick-input-list-separator-border{border-color:transparent}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}.quick-input-tree .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-tree .quick-input-tree-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-tree .quick-input-tree-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-tree .quick-input-tree-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-tree .quick-input-tree-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row{display:flex;align-items:center}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label,.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-tree .quick-input-tree-rows .monaco-highlighted-label>span{opacity:1}.quick-input-tree .quick-input-tree-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-tree .quick-input-tree-entry-action-bar .action-label{display:none}.quick-input-tree .quick-input-tree-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-tree .quick-input-tree-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-tree .quick-input-tree-entry .quick-input-tree-entry-action-bar .action-label.always-visible,.quick-input-tree .quick-input-tree-entry:hover .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .quick-input-tree-entry.focus-inside .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.focused .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.passive-focused .quick-input-tree-entry-action-bar .action-label{display:flex}.quick-input-tree>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex;align-items:center}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 5px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-iconpath{width:16px;height:22px;margin-right:6px;display:flex}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-weight:700}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent;opacity:0}.monaco-enable-motion .monaco-tl-indent>.indent-guide{transition:opacity .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;right:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 10px 0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-enable-motion .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{position:absolute;top:0;left:0;width:100%;height:0;z-index:13;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{position:absolute;width:100%;opacity:1!important;overflow:hidden;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{background-color:var(--vscode-list-hoverBackground)!important;cursor:pointer}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{position:absolute;bottom:-3px;left:0;height:0px;width:100%}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{outline:none}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-enable-motion .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-enable-motion .monaco-table>.monaco-split-view2,.monaco-enable-motion .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review{-moz-user-select:none;user-select:none;-webkit-user-select:none;z-index:99}.monaco-component.diff-review .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-component.diff-review .revertButton{cursor:pointer}.monaco-component.diff-review .action-label{background:var(--vscode-editorActionList-background)}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-toolbar.responsive .monaco-action-bar>.actions-container>.action-item{flex-shrink:1;min-width:20px}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow)}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{position:relative;overflow:hidden;flex-shrink:0;flex-grow:0}.monaco-diff-editor .gutter>div{position:absolute}.monaco-diff-editor .gutter .gutterItem{opacity:0;transition:opacity .7s}.monaco-diff-editor .gutter .gutterItem.showAlways{opacity:1;transition:none}.monaco-diff-editor .gutter .gutterItem.noTransition{transition:none}.monaco-diff-editor .gutter:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.monaco-diff-editor .gutter .gutterItem .background{position:absolute;height:100%;left:50%;width:1px;border-left:2px var(--vscode-menu-separatorBackground) solid}.monaco-diff-editor .gutter .gutterItem .buttons{position:absolute;width:100%;display:flex;justify-content:center;align-items:center}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar{height:-moz-fit-content;height:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar{line-height:1}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container{width:-moz-fit-content;width:fit-content;border-radius:4px;background:var(--vscode-editorGutter-itemBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item .action-label{color:var(--vscode-editorGutter-itemGlyphForeground);padding:1px 2px}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px}.monaco-diff-editor .diff-hidden-lines-compact .line-left,.monaco-diff-editor .diff-hidden-lines-compact .line-right{height:1px;border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;margin:auto;width:100%}.monaco-diff-editor .diff-hidden-lines-compact .line-left{width:20px}.monaco-diff-editor .diff-hidden-lines-compact .text{color:var(--vscode-editorCodeLens-foreground);text-wrap:nowrap;font-size:11px;line-height:11px;margin:0 4px}.monaco-editor .line-delete-selectable{-moz-user-select:text!important;user-select:text!important;-webkit-user-select:text!important;z-index:1!important}.line-delete-selectable .view-line{-moz-user-select:text!important;user-select:text!important;-webkit-user-select:text!important}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);position:relative;height:100%;width:100%;overflow-y:hidden}.monaco-component.multiDiffEditor>div{position:absolute;top:0;left:0;height:100%;width:100%}.monaco-component.multiDiffEditor>div.placeholder{visibility:hidden;display:grid;place-items:center;place-content:center}.monaco-component.multiDiffEditor>div.placeholder.visible{visibility:visible}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border: var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{display:flex;flex-direction:column;flex:1;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{margin:0 5px;cursor:pointer}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button a{display:block}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{margin:8px 0 0;padding:4px 5px;border-top:1px solid var(--vscode-multiDiffEditor-border);display:flex;align-items:center;color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{display:flex;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{flex:1;min-width:0;text-overflow:ellipsis}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{font-weight:600;opacity:.75;margin:0 10px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{flex:1;display:flex;flex-direction:column;border-bottom:1px solid var(--vscode-multiDiffEditor-border);overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{display:inline-block;width:1em;height:1em}.inline-progress-widget{display:flex!important;justify-content:center;align-items:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{font-size:90%!important;animation:none}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.action-widget{font-size:13px;min-width:100px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-menu-border)!important;border-radius:5px;background-color:var(--vscode-menu-background);color:var(--vscode-menu-foreground);padding:4px;box-shadow:0 2px 8px var(--vscode-widget-shadow)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{-moz-user-select:none;user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 4px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%;border-radius:3px}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-list-activeSelectionBackground)!important;color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600;font-size:13px}.action-widget .monaco-list-row.group-header:not(:first-of-type){margin-top:2px}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator{border-top:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-descriptionForeground);font-size:12px;padding:0;margin:4px 0 0;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:0}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator.focused{outline:0 solid;background-color:transparent;border-radius:0}.action-widget .monaco-list-row.separator:first-of-type{border-top:none;margin-top:0}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:4px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow)}.action-widget .action-widget-action-bar{background-color:var(--vscode-menu-background);border-top:1px solid var(--vscode-menu-border);margin-top:2px}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:4px 8px 2px 24px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:13px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.action-widget .monaco-list .monaco-list-row .description{opacity:.7;margin-left:.5em}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border, transparent);border-radius:4px;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);overflow:hidden}.post-edit-widget .monaco-button{padding:2px;border:none;border-radius:0}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-hoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(/codicon.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-user-select:none;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{display:block;cursor:pointer}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-flex!important;align-items:center;text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault)}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap;vertical-align:sub;display:inline-flex;align-items:center}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon[class*=codicon-]{vertical-align:middle;color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize)}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.monaco-editor .inlineSuggestionsHints{padding:4px}.monaco-editor .inlineSuggestionsHints .warningMessage p{margin:0}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)!important}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:var(--vscode-editorWidget-background)}.monaco-reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);padding:1px;box-sizing:border-box}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{left:0!important;background-color:var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border))}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.colorpicker-widget{height:190px;-moz-user-select:none;user-select:none;-webkit-user-select:none}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{border:solid .1em #000;box-sizing:border-box;margin:.1em .2em 0;width:.8em;height:.8em;line-height:.8em;display:inline-block;cursor:pointer}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:solid .1em #eee}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-header .picked-color{width:240px;display:flex;align-items:center;justify-content:center;line-height:24px;cursor:pointer;color:#fff;flex:1;white-space:nowrap;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{width:100%;height:100%;text-align:center}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid rgb(255,255,255);border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:grab;background:linear-gradient(to bottom,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid rgba(255,255,255,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.colorpicker-body .standalone-strip .standalone-overlay{height:122px;pointer-events:none}.standalone-colorpicker-body{display:block;border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);overflow:hidden}.colorpicker-body .insert-button{position:absolute;height:20px;width:58px;padding:0;right:8px;bottom:8px;background:var(--vscode-button-background);color:var(--vscode-button-foreground);border-radius:2px;border:none;cursor:pointer}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{color:var(--vscode-peekViewResult-fileForeground)!important;background-color:var(--vscode-peekViewResult-matchHighlightBackground)!important}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;-moz-user-select:text;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.chat-attached-context-attachment .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-resizable-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-sizing:content-box}.monaco-editor .monaco-resizable-hover>.monaco-hover{border:none;border-radius:none}.monaco-editor .monaco-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row.hover-row-with-copy{position:relative;padding-right:20px}.monaco-editor .monaco-hover .hover-row .hover-row-contents{min-width:0;display:flex;flex-direction:column}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);width:22px;overflow-y:clip}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner{display:flex;flex-direction:column;padding-left:5px;padding-right:5px;justify-content:flex-end;position:relative}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .monaco-hover .hover-copy-button{position:absolute;top:4px;right:4px;padding:2px 4px;border-radius:3px;display:flex;align-items:center;justify-content:center;opacity:0}.monaco-editor .monaco-hover .hover-row-with-copy:hover .hover-copy-button,.monaco-editor .monaco-hover .hover-row-with-copy:focus-within .hover-copy-button{opacity:1}.monaco-editor .monaco-hover .hover-copy-button:hover{background-color:var(--vscode-toolbar-hoverBackground);cursor:pointer}.monaco-editor .monaco-hover .hover-copy-button:focus{outline:1px solid var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .monaco-hover .hover-copy-button .codicon{font-size:16px;color:var(--vscode-foreground)}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{border-right:2px dotted black;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #AEAFAD;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:var(--vscode-editor-foldPlaceholderForeground);margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .snippet-placeholder{min-width:2px;outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetTabstopHighlightBorder, transparent)}.monaco-editor .finish-snippet-placeholder{outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent)}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column;border-radius:3px}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{flex:0 1 auto;width:100%;border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background)}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid var(--vscode-editorSuggestWidget-border);overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default;color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-details:focus{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 4px 5px}.monaco-editor .suggest-details.detail-and-doc>.monaco-scrollable-element>.body>.header>.type{padding-bottom:12px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:initial;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .suggest-preview-text.clickable .view-line{z-index:1}.monaco-editor .ghost-text-decoration.clickable,.monaco-editor .ghost-text-decoration-preview.clickable,.monaco-editor .suggest-preview-text.clickable .ghost-text{cursor:pointer}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .ghost-text-decoration.syntax-highlighted,.monaco-editor .ghost-text-decoration-preview.syntax-highlighted,.monaco-editor .suggest-preview-text .ghost-text.syntax-highlighted{opacity:.7}.monaco-editor .ghost-text-decoration:not(.syntax-highlighted),.monaco-editor .ghost-text-decoration-preview:not(.syntax-highlighted),.monaco-editor .suggest-preview-text .ghost-text:not(.syntax-highlighted){color:var(--vscode-editorGhostText-foreground)}.monaco-editor .ghost-text-decoration.warning,.monaco-editor .ghost-text-decoration-preview.warning,.monaco-editor .suggest-preview-text .ghost-text.warning{background:var(--monaco-editor-warning-decoration) repeat-x bottom left;border-bottom:4px double var(--vscode-editorWarning-border)}.ghost-text-view-warning-widget-icon .codicon{color:var(--vscode-editorWarning-foreground)!important}.monaco-editor .edits-fadeout-decoration{opacity:var(--animation-opacity, 1);background-color:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .sticky-widget{overflow:hidden;border-bottom:1px solid var(--vscode-editorStickyScroll-border);width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;z-index:4;right:initial!important;margin-left:"0px"}.monaco-editor .sticky-widget .sticky-widget-line-numbers{float:left;background-color:var(--vscode-editorStickyScrollGutter-background)}.monaco-editor .sticky-widget.peek .sticky-widget-line-numbers{background-color:var(--vscode-peekViewEditorStickyScrollGutter-background)}.monaco-editor .sticky-widget .sticky-widget-lines-scrollable{display:inline-block;position:absolute;overflow:hidden;width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:var(--vscode-editorStickyScroll-background)}.monaco-editor .sticky-widget.peek .sticky-widget-lines-scrollable{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .sticky-widget .sticky-widget-lines{position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number,.monaco-editor .sticky-widget .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;display:inline-block;position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition);position:absolute;margin-left:2px}.monaco-editor .sticky-widget .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-widget .sticky-line-number-inner{display:inline-block;text-align:right}.monaco-editor .sticky-widget .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor .inline-edits-view-indicator{display:flex;z-index:34;height:20px;color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground);background-color:var(--vscode-inlineEdit-gutterIndicator-background);border:1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);border-radius:3px;align-items:center;padding:2px 10px 2px 2px;margin:0 4px;opacity:0}.monaco-editor .inline-edits-view-indicator.contained{transition:opacity .2s ease-in-out;transition-delay:.4s}.monaco-editor .inline-edits-view-indicator.visible,.monaco-editor .inline-edits-view-indicator.top{opacity:1}.monaco-editor .inline-edits-view-indicator.top .icon{transform:rotate(90deg)}.monaco-editor .inline-edits-view-indicator.bottom{opacity:1}.monaco-editor .inline-edits-view-indicator.bottom .icon{transform:rotate(-90deg)}.monaco-editor .inline-edits-view-indicator .icon{display:flex;align-items:center;margin:0 2px;transform:none;transition:transform .2s ease-in-out}.monaco-editor .inline-edits-view-indicator .icon .codicon{color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground)}.monaco-editor .inline-edits-view-indicator .label{margin:0 2px;display:flex;justify-content:center;width:100%}.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .view-overlays .current-line-exact,.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .current-line-margin{border:none}.monaco-editor .inline-edits-view .editorContainer .inline-edits-view-zone.diagonal-fill{opacity:.5}.monaco-editor .strike-through{text-decoration:line-through}.monaco-editor .inlineCompletions-line-insert{background:var(--vscode-inlineEdit-modifiedChangedLineBackground)}.monaco-editor .inlineCompletions-line-delete{background:var(--vscode-inlineEdit-originalChangedLineBackground)}.monaco-editor .inlineCompletions-char-insert{background:var(--vscode-inlineEdit-modifiedChangedTextBackground);cursor:pointer}.monaco-editor .inlineCompletions-char-delete{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-inlineEdit-originalChangedTextBackground) 3px}.monaco-editor .inlineCompletions-char-insert.diff-range-empty{border-left:solid var(--vscode-inlineEdit-modifiedChangedTextBackground) 3px}.monaco-editor .inlineCompletions-char-delete.single-line-inline{border:1px solid var(--vscode-editorHoverWidget-border);margin:-2px 0 0 -2px}.monaco-editor .inlineCompletions-char-insert.single-line-inline{border-top:1px solid var(--vscode-inlineEdit-modifiedBorder);border-bottom:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-insert.single-line-inline.start{border-top-left-radius:4px;border-bottom-left-radius:4px;border-left:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-insert.single-line-inline.end{border-top-right-radius:4px;border-bottom-right-radius:4px;border-right:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-delete.single-line-inline.empty,.monaco-editor .inlineCompletions-char-insert.single-line-inline.empty{display:none}.monaco-editor .inlineCompletions.strike-through{text-decoration-thickness:1px}.monaco-editor .inlineCompletions-modified-bubble{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .inlineCompletions-original-bubble{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-modified-bubble,.monaco-editor .inlineCompletions-original-bubble{pointer-events:none;display:inline-block}.monaco-editor .inline-edit.ghost-text,.monaco-editor .inline-edit.ghost-text-decoration,.monaco-editor .inline-edit.ghost-text-decoration-preview,.monaco-editor .inline-edit.suggest-preview-text .ghost-text{font-style:normal!important}.monaco-editor .inline-edit.ghost-text.syntax-highlighted,.monaco-editor .inline-edit.ghost-text-decoration.syntax-highlighted,.monaco-editor .inline-edit.ghost-text-decoration-preview.syntax-highlighted,.monaco-editor .inline-edit.suggest-preview-text .ghost-text.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.modified-background.ghost-text,.monaco-editor .inline-edit.modified-background.ghost-text-decoration,.monaco-editor .inline-edit.modified-background.ghost-text-decoration-preview,.monaco-editor .inline-edit.modified-background.suggest-preview-text .ghost-text{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inlineCompletions-original-lines{background:var(--vscode-editor-background)}.monaco-menu-option{color:var(--vscode-editorActionList-foreground);font-size:13px;padding:0 4px;line-height:28px;display:flex;gap:4px;align-items:center;border-radius:3px;cursor:pointer}.monaco-menu-option .monaco-keybinding-key{font-size:13px;opacity:.7}.monaco-menu-option.active{background:var(--vscode-editorActionList-focusBackground);color:var(--vscode-editorActionList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.monaco-menu-option.active .monaco-keybinding-key{color:var(--vscode-editorActionList-focusForeground)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .scroll-editor-on-middle-click-dot{cursor:all-scroll;position:absolute;z-index:1;background-color:var(--vscode-editor-foreground, white);border:1px solid var(--vscode-editor-background, black);opacity:.5;width:5px;height:5px;border-radius:50%;transform:translate(-50%,-50%)}.monaco-editor .scroll-editor-on-middle-click-dot.hidden{display:none}.monaco-editor.scroll-editor-on-middle-click-editor *{cursor:all-scroll}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .parameter-hints-widget{z-index:39;display:flex;flex-direction:column;line-height:1.5em;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:"";display:block;height:100%;position:absolute;opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:"";display:block;position:absolute;left:0;width:100%;padding-top:4px;opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);border-radius:3px;padding:0 .4em;background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor .editorPlaceholder{top:0;position:absolute;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap;pointer-events:none;color:var(--vscode-editor-placeholder-foreground)}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{padding:3px;border-radius:2px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{display:flex;align-items:center;padding:3px;background-color:transparent;border:none;border-radius:5px;cursor:pointer}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;width:100%;font-size:12px;display:flex;overflow:visible;height:26px;background:var(--vscode-banner-background)}.editor-banner .icon-container{display:flex;flex-shrink:0;align-items:center;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-repeat:no-repeat;background-position:center center;background-size:16px;width:16px;padding:0;margin:0 6px 0 10px}.editor-banner .message-container{display:flex;align-items:center;line-height:26px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.editor-banner .message-container p{margin-block-start:0;margin-block-end:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{padding:3px;margin-left:12px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}.floating-menu-overlay-widget{padding:0;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border-radius:2px;border:1px solid var(--vscode-contrastBorder);display:flex;align-items:center;z-index:10;box-shadow:0 2px 8px var(--vscode-widget-shadow);overflow:hidden}.floating-menu-overlay-widget .action-item>.action-label{padding:5px;font-size:12px;border-radius:2px}.floating-menu-overlay-widget .action-item>.action-label.codicon{color:var(--vscode-button-foreground)}.floating-menu-overlay-widget .action-item>.action-label.codicon:not(.separator){padding-top:6px;padding-bottom:6px}.floating-menu-overlay-widget .action-item:first-child>.action-label{padding-left:7px}.floating-menu-overlay-widget .action-item:last-child>.action-label{padding-right:7px}.floating-menu-overlay-widget .action-item .action-label.separator{background-color:var(--vscode-menu-separatorBackground)}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #F6F6F6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;-moz-user-select:text;user-select:text;-webkit-user-select:text;padding:10px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{height:1px;border:0;background-color:var(--vscode-editorHoverWidget-border)}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;background:#f7f6f3;color:#1f2328;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}*{box-sizing:border-box}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1\/2{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-4{right:1rem}.right-5{right:1.25rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-20{top:5rem}.top-4{top:1rem}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.\!mt-0{margin-top:0!important}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[88px\]{height:88px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[140px\]{max-height:140px}.max-h-\[180px\]{max-height:180px}.max-h-\[220px\]{max-height:220px}.max-h-\[240px\]{max-height:240px}.max-h-\[320px\]{max-height:320px}.max-h-\[420px\]{max-height:420px}.max-h-\[560px\]{max-height:560px}.max-h-\[620px\]{max-height:620px}.max-h-\[calc\(100\%-136px\)\]{max-height:calc(100% - 136px)}.max-h-\[calc\(100\%-180px\)\]{max-height:calc(100% - 180px)}.\!min-h-\[280px\]{min-height:280px!important}.\!min-h-\[34px\]{min-height:34px!important}.\!min-h-\[40px\]{min-height:40px!important}.min-h-0{min-height:0px}.min-h-\[180px\]{min-height:180px}.min-h-\[420px\]{min-height:420px}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[268px\]{width:268px}.w-\[360px\]{width:360px}.w-\[380px\]{width:380px}.w-\[420px\]{width:420px}.w-\[56px\]{width:56px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[240px\]{min-width:240px}.min-w-\[260px\]{min-width:260px}.min-w-\[56px\]{min-width:56px}.max-w-\[1040px\]{max-width:1040px}.max-w-\[1080px\]{max-width:1080px}.max-w-\[320px\]{max-width:320px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[460px\]{max-width:460px}.max-w-\[520px\]{max-width:520px}.max-w-\[56px\]{max-width:56px}.max-w-\[920px\]{max-width:920px}.max-w-\[960px\]{max-width:960px}.max-w-\[980px\]{max-width:980px}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[260px_minmax\(0\,1fr\)\]{grid-template-columns:260px minmax(0,1fr)}.grid-cols-\[320px_minmax\(0\,1fr\)\]{grid-template-columns:320px minmax(0,1fr)}.grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-\[18px\]{border-radius:18px!important}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[14px\]{border-radius:14px}.rounded-\[16px\]{border-radius:16px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[28px\]{border-radius:28px}.rounded-\[32px\]{border-radius:32px}.rounded-\[36px\]{border-radius:36px}.rounded-\[38px\]{border-radius:38px}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-\[\#E8E1D8\]{--tw-border-opacity: 1 !important;border-color:rgb(232 225 216 / var(--tw-border-opacity, 1))!important}.border-\[\#D9E5CB\]{--tw-border-opacity: 1;border-color:rgb(217 229 203 / var(--tw-border-opacity, 1))}.border-\[\#DCE8C8\]{--tw-border-opacity: 1;border-color:rgb(220 232 200 / var(--tw-border-opacity, 1))}.border-\[\#E5DED3\]{--tw-border-opacity: 1;border-color:rgb(229 222 211 / var(--tw-border-opacity, 1))}.border-\[\#E5E1DA\]{--tw-border-opacity: 1;border-color:rgb(229 225 218 / var(--tw-border-opacity, 1))}.border-\[\#E6E0D6\]{--tw-border-opacity: 1;border-color:rgb(230 224 214 / var(--tw-border-opacity, 1))}.border-\[\#E6E0D7\]{--tw-border-opacity: 1;border-color:rgb(230 224 215 / var(--tw-border-opacity, 1))}.border-\[\#E6E3DE\]{--tw-border-opacity: 1;border-color:rgb(230 227 222 / var(--tw-border-opacity, 1))}.border-\[\#E8E2D9\]{--tw-border-opacity: 1;border-color:rgb(232 226 217 / var(--tw-border-opacity, 1))}.border-\[\#E8E4DD\]{--tw-border-opacity: 1;border-color:rgb(232 228 221 / var(--tw-border-opacity, 1))}.border-\[\#E9D6AE\]{--tw-border-opacity: 1;border-color:rgb(233 214 174 / var(--tw-border-opacity, 1))}.border-\[\#EADBB8\]{--tw-border-opacity: 1;border-color:rgb(234 219 184 / var(--tw-border-opacity, 1))}.border-\[\#EAE4DB\]{--tw-border-opacity: 1;border-color:rgb(234 228 219 / var(--tw-border-opacity, 1))}.border-\[\#ECE7DF\]{--tw-border-opacity: 1;border-color:rgb(236 231 223 / var(--tw-border-opacity, 1))}.border-\[\#EEEAE4\]{--tw-border-opacity: 1;border-color:rgb(238 234 228 / var(--tw-border-opacity, 1))}.border-\[\#F0D7D0\]{--tw-border-opacity: 1;border-color:rgb(240 215 208 / var(--tw-border-opacity, 1))}.border-\[\#F1ECE5\]{--tw-border-opacity: 1;border-color:rgb(241 236 229 / var(--tw-border-opacity, 1))}.border-\[\#F2CCC4\]{--tw-border-opacity: 1;border-color:rgb(242 204 196 / var(--tw-border-opacity, 1))}.border-\[\#F3D3CD\]{--tw-border-opacity: 1;border-color:rgb(243 211 205 / var(--tw-border-opacity, 1))}.border-\[color\:var\(--accent-border\)\]{border-color:var(--accent-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-black\/10{border-color:#0000001a}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.\!bg-\[\#FAF8F4\]{--tw-bg-opacity: 1 !important;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))!important}.\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.bg-\[\#18181B\]{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-\[\#1A1A1A\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#ECEAE6\]{--tw-bg-opacity: 1;background-color:rgb(236 234 230 / var(--tw-bg-opacity, 1))}.bg-\[\#EEF3FF\]{--tw-bg-opacity: 1;background-color:rgb(238 243 255 / var(--tw-bg-opacity, 1))}.bg-\[\#F2F1EE\]{--tw-bg-opacity: 1;background-color:rgb(242 241 238 / var(--tw-bg-opacity, 1))}.bg-\[\#F3F0EA\]{--tw-bg-opacity: 1;background-color:rgb(243 240 234 / var(--tw-bg-opacity, 1))}.bg-\[\#F5FBEE\]{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.bg-\[\#F7EDE4\]{--tw-bg-opacity: 1;background-color:rgb(247 237 228 / var(--tw-bg-opacity, 1))}.bg-\[\#F7F2E8\]{--tw-bg-opacity: 1;background-color:rgb(247 242 232 / var(--tw-bg-opacity, 1))}.bg-\[\#FAF8F4\]{--tw-bg-opacity: 1;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))}.bg-\[\#FCFBF8\]{--tw-bg-opacity: 1;background-color:rgb(252 251 248 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF4F1\]{--tw-bg-opacity: 1;background-color:rgb(255 244 241 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF5F2\]{--tw-bg-opacity: 1;background-color:rgb(255 245 242 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF7E6\]{--tw-bg-opacity: 1;background-color:rgb(255 247 230 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF8EB\]{--tw-bg-opacity: 1;background-color:rgb(255 248 235 / var(--tw-bg-opacity, 1))}.bg-\[\#FFFCF8\]{--tw-bg-opacity: 1;background-color:rgb(255 252 248 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.p-0\.5{padding:.125rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.\!px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[18px\]{font-size:18px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[28px\]{font-size:28px}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-tight{line-height:1.25}.tracking-\[0\.12em\]{letter-spacing:.12em}.tracking-\[0\.14em\]{letter-spacing:.14em}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-wide{letter-spacing:.025em}.text-\[\#315A84\]{--tw-text-opacity: 1;color:rgb(49 90 132 / var(--tw-text-opacity, 1))}.text-\[\#5C7A2D\]{--tw-text-opacity: 1;color:rgb(92 122 45 / var(--tw-text-opacity, 1))}.text-\[\#8E6A3D\]{--tw-text-opacity: 1;color:rgb(142 106 61 / var(--tw-text-opacity, 1))}.text-\[\#9B4D19\]{--tw-text-opacity: 1;color:rgb(155 77 25 / var(--tw-text-opacity, 1))}.text-\[\#9B6A1C\]{--tw-text-opacity: 1;color:rgb(155 106 28 / var(--tw-text-opacity, 1))}.text-\[\#B15647\]{--tw-text-opacity: 1;color:rgb(177 86 71 / var(--tw-text-opacity, 1))}.text-\[color\:var\(--accent-text\)\]{color:var(--accent-text)}.text-\[var\(--accent\,\#2563eb\)\]{color:var(--accent,#2563eb)}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.\!no-underline{text-decoration-line:none!important}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow-\[0_10px_20px_rgba\(17\,24\,39\,0\.05\)\]{--tw-shadow: 0 10px 20px rgba(17,24,39,.05);--tw-shadow-colored: 0 10px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_10px_24px_rgba\(31\,28\,24\,0\.04\)\]{--tw-shadow: 0 10px 24px rgba(31,28,24,.04);--tw-shadow-colored: 0 10px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_12px_30px_rgba\(37\,99\,235\,0\.08\)\]{--tw-shadow: 0 12px 30px rgba(37,99,235,.08);--tw-shadow-colored: 0 12px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_18px_36px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 18px 36px rgba(17,24,39,.16);--tw-shadow-colored: 0 18px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_22px_46px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 22px 46px rgba(17,24,39,.16);--tw-shadow-colored: 0 22px 46px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_22px_54px_rgba\(17\,24\,39\,0\.06\)\]{--tw-shadow: 0 22px 54px rgba(17,24,39,.06);--tw-shadow-colored: 0 22px 54px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_24px_56px_rgba\(17\,24\,39\,0\.18\)\]{--tw-shadow: 0 24px 56px rgba(17,24,39,.18);--tw-shadow-colored: 0 24px 56px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_26px_64px_rgba\(17\,24\,39\,0\.08\)\]{--tw-shadow: 0 26px 64px rgba(17,24,39,.08);--tw-shadow-colored: 0 26px 64px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_26px_64px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 26px 64px rgba(17,24,39,.16);--tw-shadow-colored: 0 26px 64px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_28px_70px_rgba\(15\,23\,42\,0\.08\)\]{--tw-shadow: 0 28px 70px rgba(15,23,42,.08);--tw-shadow-colored: 0 28px 70px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_30px_72px_rgba\(15\,23\,42\,0\.08\)\]{--tw-shadow: 0 30px 72px rgba(15,23,42,.08);--tw-shadow-colored: 0 30px 72px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#827a6e38;border-radius:999px}::-webkit-scrollbar-thumb:hover{background:#827a6e5c}.studio-rail{width:68px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px 10px;border-right:1px solid #e8e4dd;background:#fbfaf8}.studio-shell[data-color-mode=dark] .studio-rail{border-right-color:#223047;background:#0d1422}.studio-shell{--accent: #2563eb;--accent-rgb: 37, 99, 235;--accent-strong: #1d4ed8;--accent-text: #2555c7;--accent-gradient-start: #2563eb;--accent-gradient-end: #2563eb;--accent-soft-start: #f2f6ff;--accent-soft-end: #ebf2ff;--accent-icon-surface: #e8f0ff;--accent-border: rgba(var(--accent-rgb), .22);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .09)}.studio-shell[data-appearance=coral]{--accent: #f0483e;--accent-rgb: 240, 72, 62;--accent-strong: #df3f35;--accent-text: #f0483e;--accent-gradient-start: #f0483e;--accent-gradient-end: #f0483e;--accent-soft-start: #fff8f5;--accent-soft-end: #fff1ec;--accent-icon-surface: #ffebe4;--accent-border: rgba(var(--accent-rgb), .24);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .08)}.studio-shell[data-appearance=forest]{--accent: #2f8f6a;--accent-rgb: 47, 143, 106;--accent-strong: #227554;--accent-text: #227554;--accent-gradient-start: #2f8f6a;--accent-gradient-end: #2f8f6a;--accent-soft-start: #f4fbf7;--accent-soft-end: #eaf7f0;--accent-icon-surface: #e4f4ea;--accent-border: rgba(var(--accent-rgb), .24);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .1)}.studio-shell[data-color-mode=dark]{color-scheme:dark;background:#0b1220;--accent-soft-start: rgba(var(--accent-rgb), .16);--accent-soft-end: rgba(var(--accent-rgb), .24);--accent-icon-surface: rgba(var(--accent-rgb), .22);--accent-border: rgba(var(--accent-rgb), .42);--accent-shadow: rgba(var(--accent-rgb), .18);--accent-shadow-strong: rgba(var(--accent-rgb), .3);--accent-focus: rgba(var(--accent-rgb), .18)}.studio-shell[data-color-mode=dark] .bg-\[\#F2F1EE\],.studio-shell[data-color-mode=dark] .bg-\[\#ECEAE6\]{background-color:#0b1220}.studio-shell[data-color-mode=dark] .bg-white,.studio-shell[data-color-mode=dark] .bg-white\/70,.studio-shell[data-color-mode=dark] .bg-white\/80,.studio-shell[data-color-mode=dark] .bg-white\/90,.studio-shell[data-color-mode=dark] .bg-white\/92,.studio-shell[data-color-mode=dark] .bg-white\/94,.studio-shell[data-color-mode=dark] .bg-white\/96{background-color:#0f172af0}.studio-shell[data-color-mode=dark] .bg-\[\#FAF8F4\],.studio-shell[data-color-mode=dark] .bg-\[\#F6F2EC\],.studio-shell[data-color-mode=dark] .bg-\[\#F3F0EA\],.studio-shell[data-color-mode=dark] .bg-\[\#ECE8E2\]{background-color:#111b2d}.studio-shell[data-color-mode=dark] .border-\[\#E6E3DE\],.studio-shell[data-color-mode=dark] .border-\[\#EEEAE4\],.studio-shell[data-color-mode=dark] .border-\[\#E5E1DA\],.studio-shell[data-color-mode=dark] .border-\[\#EAE4DB\],.studio-shell[data-color-mode=dark] .border-\[\#F1ECE5\],.studio-shell[data-color-mode=dark] .border-gray-100{border-color:#223047}.studio-shell[data-color-mode=dark] .text-gray-900,.studio-shell[data-color-mode=dark] .text-gray-800{color:#e5e7eb}.studio-shell[data-color-mode=dark] .text-gray-700,.studio-shell[data-color-mode=dark] .text-gray-600{color:#cbd5e1}.studio-shell[data-color-mode=dark] .text-gray-500,.studio-shell[data-color-mode=dark] .text-gray-400{color:#94a3b8}.studio-shell[data-color-mode=dark] .text-gray-300{color:#64748b}.studio-shell[data-color-mode=dark] .hover\:bg-\[\#FAF8F4\]:hover,.studio-shell[data-color-mode=dark] .hover\:bg-\[\#F6F2EC\]:hover,.studio-shell[data-color-mode=dark] .hover\:bg-white:hover{background-color:#162236}.studio-brand-mark{background:var(--accent);box-shadow:none}.rail-button,.drawer-icon-button,.panel-icon-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #e7e3dc;background:#fffffff5;color:#5b6470;transition:border-color .18s ease,background .18s ease,color .18s ease}.studio-shell[data-color-mode=dark] .rail-button,.studio-shell[data-color-mode=dark] .drawer-icon-button,.studio-shell[data-color-mode=dark] .panel-icon-button{border-color:#2a3a52;background:#0f172af0;color:#cbd5e1}.rail-button{width:40px;height:40px;border-radius:14px;box-shadow:none}.rail-button:hover,.drawer-icon-button:hover,.panel-icon-button:hover{border-color:#d9d4cc;background:#f7f6f3;color:#1f2328}.studio-shell[data-color-mode=dark] .rail-button:hover,.studio-shell[data-color-mode=dark] .drawer-icon-button:hover,.studio-shell[data-color-mode=dark] .panel-icon-button:hover{border-color:#3a4c68;background:#162236;color:#f8fafc}.rail-button.active,.drawer-icon-button.active{border-color:var(--accent-border);background:linear-gradient(180deg,var(--accent-soft-start) 0%,var(--accent-soft-end) 100%);color:var(--accent);box-shadow:none}.drawer-icon-button{width:38px;height:38px;border-radius:12px;box-shadow:none}.panel-icon-button{width:30px;height:30px;border-radius:10px}.ask-ai-surface{background:#fff;border-color:#e8e4dd;border-radius:20px;box-shadow:0 18px 40px #11182714}.ask-ai-trigger{background:#fff;border-radius:16px;box-shadow:0 12px 28px #11182714!important}.studio-shell[data-color-mode=dark] .ask-ai-surface,.studio-shell[data-color-mode=dark] .ask-ai-trigger{background:#0f172a}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 16px}.panel-eyebrow{font-size:11px;line-height:1;text-transform:uppercase;letter-spacing:.16em;color:#a39a8f}.studio-shell[data-color-mode=dark] .panel-eyebrow,.studio-shell[data-color-mode=dark] .section-heading,.studio-shell[data-color-mode=dark] .field-label,.studio-shell[data-color-mode=dark] .toolbar-input-label{color:#7f90a8}.panel-title{margin-top:6px;font-size:20px;line-height:1.1;font-weight:700;color:#201f1d}.studio-shell[data-color-mode=dark] .panel-title{color:#f8fafc}.panel-block{padding:16px 18px}.section-heading,.field-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.14em;color:#a39a8f}.search-field{display:flex;align-items:center;gap:10px;min-height:40px;padding:0 12px;border:1px solid #e7e3dc;border-radius:12px;background:#fff}.studio-shell[data-color-mode=dark] .search-field{border-color:#2a3a52;background:#111b2d}.search-input{width:100%;background:transparent;border:0;outline:none;font-size:13px;color:#3c3834}.search-input::-moz-placeholder{color:#aea59a}.search-input::placeholder{color:#aea59a}.studio-shell[data-color-mode=dark] .search-input,.studio-shell[data-color-mode=dark] .studio-title-input{color:#e5e7eb}.studio-shell[data-color-mode=dark] .search-input::-moz-placeholder,.studio-shell[data-color-mode=dark] .studio-title-input::-moz-placeholder{color:#64748b}.studio-shell[data-color-mode=dark] .search-input::placeholder,.studio-shell[data-color-mode=dark] .studio-title-input::placeholder{color:#64748b}.panel-input,.panel-textarea{width:100%;border:1px solid #e7e3dc;border-radius:12px;background:#fff;color:#24211f;outline:none;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.studio-shell[data-color-mode=dark] .panel-input,.studio-shell[data-color-mode=dark] .panel-textarea{border-color:#2a3a52;background:#0f172a;color:#e5e7eb}.panel-input{min-height:40px;padding:0 12px;font-size:13px}.panel-textarea{min-height:120px;padding:12px;font-size:12px;line-height:1.55;resize:vertical;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace}.panel-input:focus,.panel-textarea:focus{border-color:rgba(var(--accent-rgb),.32);box-shadow:0 0 0 3px var(--accent-focus);background:#fffdfc}.studio-shell[data-color-mode=dark] .panel-input:focus,.studio-shell[data-color-mode=dark] .panel-textarea:focus{background:#111b2d}.solid-action,.ghost-action{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 14px;border-radius:12px;font-size:12px;font-weight:700;transition:border-color .18s ease,background .18s ease,color .18s ease}.solid-action{border:1px solid rgba(var(--accent-rgb),.16);background:var(--accent);color:#fff;box-shadow:none}.solid-action:hover{background:var(--accent-strong)}.ghost-action{border:1px solid #e7e3dc;background:#fff;color:#4f5562}.studio-shell[data-color-mode=dark] .ghost-action{border-color:#2a3a52;background:#0f172a;color:#dbe4f0}.ghost-action:hover{background:#f7f6f3;border-color:#d9d4cc}.studio-shell[data-color-mode=dark] .ghost-action:hover{background:#162236;border-color:#3a4c68}.studio-editor-header{position:relative;z-index:120;overflow:visible;min-height:0;flex-shrink:0;display:flex;align-items:stretch;flex-wrap:wrap;gap:10px;padding:16px 20px 14px;border-bottom:1px solid #e8e4dd;background:#fbfaf8f5;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.studio-shell[data-color-mode=dark] .studio-editor-header{border-bottom-color:#223047;background:#0d1422f5}.app-auth-anchor{position:fixed;top:12px;right:16px;z-index:320;display:flex;justify-content:flex-end;max-width:min(320px,calc(100vw - 20px));pointer-events:none}.app-auth-anchor>*{pointer-events:auto}.workspace-page-header,.studio-editor-header{padding-right:clamp(220px,25vw,360px)}.studio-editor-toolbar{width:100%;min-width:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}@media (max-width: 1180px){.workspace-page-header,.studio-editor-header{padding-right:clamp(170px,22vw,250px)}.studio-title-bar{order:3;flex-basis:100%}}.studio-title-bar{min-width:0;flex:1 1 420px;max-width:100%;display:flex;align-items:center;gap:8px;min-height:40px;padding:0 6px 0 12px;border:1px solid #e8e4dd;border-radius:12px;background:#fff;box-shadow:none}.studio-shell[data-color-mode=dark] .studio-title-bar{border-color:#2a3a52;background:#0f172a;box-shadow:none}.studio-title-group{min-width:0;flex:1 1 auto;display:flex;align-items:center;gap:10px}.studio-title-input{min-width:0;width:100%;background:transparent;border:0;outline:none;font-size:15px;font-weight:700;letter-spacing:-.02em;line-height:1.2;color:#1f2937}.studio-title-input::-moz-placeholder{color:#9e958a}.studio-title-input::placeholder{color:#9e958a}.studio-header-actions{display:flex;align-items:center;gap:6px;padding-left:10px;margin-left:6px;border-left:1px solid #ece8e2}.studio-shell[data-color-mode=dark] .studio-header-actions{border-left-color:#223047}.header-toolbar-action{width:30px;height:30px;border-radius:10px;padding:0;flex-shrink:0}.header-save-action,.header-export-action{border-color:transparent;background:transparent;color:#6b7280}.header-save-action{border-color:var(--accent-border);background:rgba(var(--accent-rgb),.06);color:var(--accent-text)}.header-save-action:hover,.header-export-action:hover{background:rgba(var(--accent-rgb),.1);border-color:rgba(var(--accent-rgb),.28)}.header-run-action{border-color:transparent;background:var(--accent);color:#fff}.header-run-action:hover{filter:brightness(.98)}.studio-view-switch{display:inline-flex;align-items:center;padding:4px;border:1px solid #e8e4dd;border-radius:12px;background:#fff}.studio-shell[data-color-mode=dark] .studio-view-switch{border-color:#2a3a52;background:#0f172a}.studio-view-switch-button{min-height:30px;padding:0 12px;border-radius:10px;border:0;background:transparent;font-size:12px;font-weight:700;color:#6b7280;transition:background .18s ease,color .18s ease}.studio-view-switch-button.active{background:#f3f4f6;color:#111827}.studio-shell[data-color-mode=dark] .studio-view-switch-button{color:#94a3b8}.studio-shell[data-color-mode=dark] .studio-view-switch-button.active{background:#162236;color:#f8fafc}.workflow-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}.catalog-sidebar-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.catalog-save-action{flex-shrink:0;min-width:88px;justify-content:center}.header-help-button{width:20px;height:20px;border-radius:999px;border:0;background:transparent;color:#9ca3af}.header-help-button:hover{background:#94a3b81a;color:#6b7280}.studio-shell[data-color-mode=dark] .header-help-button,.studio-shell[data-color-mode=dark] .info-popover-button{border-color:transparent;background:transparent;color:#cbd5e1}.header-help-card{width:300px}.run-prompt-textarea{min-height:168px;background:#fbfaf8}.studio-shell[data-color-mode=dark] .run-prompt-textarea{background:#111b2d}.header-auth-chip,.header-auth-guest{display:inline-flex;align-items:center;gap:10px;min-height:48px;max-width:320px;padding:6px 8px 6px 10px;border:1px solid #e8e4dd;border-radius:16px;background:#fffffff5;box-shadow:none}.studio-shell[data-color-mode=dark] .header-auth-chip,.studio-shell[data-color-mode=dark] .header-auth-guest{border-color:#2a3a52;background:#0f172af5;box-shadow:none}.header-auth-avatar,.header-auth-avatar-image{width:32px;height:32px;flex-shrink:0;border-radius:999px}.header-auth-avatar{display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#334155);color:#f8fafc;font-size:12px;font-weight:700;letter-spacing:.08em}.header-auth-avatar-image{-o-object-fit:cover;object-fit:cover;border:1px solid rgba(148,163,184,.35)}.header-auth-copy,.header-auth-guest-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.header-auth-label{font-size:13px;font-weight:700;color:#1f2937;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-auth-meta{font-size:11px;line-height:1.3;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-shell[data-color-mode=dark] .header-auth-label{color:#e2e8f0}.studio-shell[data-color-mode=dark] .header-auth-meta{color:#94a3b8}.header-auth-link,.header-auth-logout{flex-shrink:0}.chip-button{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:0 12px;border-radius:999px;border:1px solid #e3dfd8;background:#fff;color:#6d655d;font-size:11px;font-weight:700;transition:all .16s ease}.studio-shell[data-color-mode=dark] .chip-button{border-color:#2a3a52;background:#0f172a;color:#cbd5e1}.chip-button:hover{background:#fff8f2;color:#3e3a35}.studio-shell[data-color-mode=dark] .chip-button:hover{background:#162236;color:#f8fafc}.chip-button-active{border-color:var(--accent-border);background:var(--accent-soft-end);color:var(--accent-text)}.accent-inline-link{color:var(--accent-text)}.accent-inline-link:hover{color:var(--accent-strong)}.toolbar-input{transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.toolbar-input:focus{border-color:rgba(var(--accent-rgb),.35);box-shadow:0 0 0 4px var(--accent-focus);background:#fffdfc}.toolbar-input-group{display:flex;flex-direction:column;gap:6px}.toolbar-input-label{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#a39a8f}.info-popover{position:relative;display:inline-flex;z-index:140}.info-popover-button{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;border:1px solid #e7e3dc;background:#fffffff5;color:#8f98a4;transition:all .18s ease}.info-popover-button:hover,.info-popover-button.active{border-color:var(--accent-border);background:var(--accent-soft-end);color:var(--accent-text)}.info-popover-button.header-help-button{width:20px;height:20px;border:0;background:transparent;color:#9ca3af}.info-popover-button.header-help-button:hover,.info-popover-button.header-help-button.active{background:#94a3b81a;color:#6b7280}.info-popover-card{position:absolute;top:calc(100% + 10px);z-index:160;width:320px;border:1px solid #e8e4dd;border-radius:16px;background:#fffffffa;box-shadow:0 18px 40px #11182714;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);padding:14px;font-size:13px;line-height:1.55;letter-spacing:normal;text-transform:none;color:#3c3834}.studio-shell[data-color-mode=dark] .info-popover-card,.studio-shell[data-color-mode=dark] .modal-shell,.studio-shell[data-color-mode=dark] .right-drawer,.studio-shell[data-color-mode=dark] .palette-drawer{border-color:#2a3a52;background:#0a111ef5;box-shadow:0 18px 40px #0206173d;color:#dbe4f0}.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button{color:#94a3b8}.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button:hover,.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button.active{background:#94a3b81f;color:#e5e7eb}.info-popover-title{font-size:13px;font-weight:700;color:#1f2937}.studio-shell[data-color-mode=dark] .info-popover-title{color:#f8fafc}.modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:80;display:flex;align-items:center;justify-content:center;padding:24px;background:#18161352;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.modal-shell{width:min(680px,100%);max-height:min(86vh,880px);display:flex;flex-direction:column;border:1px solid #e6e1d9;border-radius:28px;background:#fffffffa;box-shadow:0 32px 80px #1118272e}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px 16px;border-bottom:1px solid #f1ece5}.studio-shell[data-color-mode=dark] .modal-header,.studio-shell[data-color-mode=dark] .modal-footer,.studio-shell[data-color-mode=dark] .palette-drawer-header,.studio-shell[data-color-mode=dark] .palette-drawer-search,.studio-shell[data-color-mode=dark] .panel-header{border-color:#223047}.modal-body{flex:1;min-height:0;overflow-y:auto;padding:20px 22px}.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px 20px;border-top:1px solid #f1ece5}.settings-sidebar{display:flex;flex-direction:column;min-height:0;padding:28px 20px;border-right:1px solid #ece8e2;background:linear-gradient(180deg,#faf8f4f0,#f5f2edf0)}.studio-shell[data-color-mode=dark] .settings-sidebar{border-right-color:#223047;background:linear-gradient(180deg,#0a111efa,#0c1424fa)}.settings-nav-button{width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:20px;border:1px solid transparent;transition:all .18s ease;text-align:left}.settings-nav-button:hover{background:#ffffffb8;border-color:#e6e0d7}.studio-shell[data-color-mode=dark] .settings-nav-button:hover{background:#162236e6;border-color:#2a3a52}.settings-nav-button.active{border-color:var(--accent-border);background:linear-gradient(180deg,var(--accent-soft-start) 0%,var(--accent-soft-end) 100%);box-shadow:0 16px 34px var(--accent-shadow)}.settings-nav-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;background:#fff;color:var(--accent-text);box-shadow:0 10px 24px #1118270f;flex-shrink:0}.settings-mode-icon{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;border:1px solid #e5e1da;background:#fff;color:var(--accent-text)}.studio-shell[data-color-mode=dark] .settings-nav-icon,.studio-shell[data-color-mode=dark] .settings-mode-icon{border-color:#33465f;background:#111b2d;color:#dbeafe}.description-editor{min-height:168px;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-size:15px;line-height:1.65}.settings-section-card{border:1px solid #ede8df;border-radius:28px;background:linear-gradient(180deg,#fffffff5,#faf8f4eb);box-shadow:0 20px 44px #1118270f;padding:24px}.studio-shell[data-color-mode=dark] .settings-section-card,.studio-shell[data-color-mode=dark] .appearance-card,.studio-shell[data-color-mode=dark] .empty-card{border-color:#2a3a52;background:linear-gradient(180deg,#0f172af5,#111b2df5);box-shadow:0 18px 38px #0206173d}.settings-status-card{border:1px solid #e6e1d8;border-radius:22px;background:#fff;padding:16px 18px}.studio-shell[data-color-mode=dark] .settings-status-card{border-color:#2a3a52;background:#0f172aeb}.settings-status-card.success{border-color:#22c55e2e;background:#f0fdf4eb}.settings-status-card.error{border-color:#ef44442e;background:#fef2f2eb}.settings-status-card.testing{border-color:rgba(var(--accent-rgb),.18);background:#eff6ffeb}.settings-status-pill{display:inline-flex;align-items:center;justify-content:center;min-height:26px;padding:0 10px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.settings-status-pill.success{background:#22c55e1f;color:#15803d}.settings-status-pill.error{background:#ef44441f;color:#dc2626}.settings-status-pill.testing{background:rgba(var(--accent-rgb),.12);color:var(--accent-text)}.appearance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.appearance-card{text-align:left;border:1px solid #e5e1da;border-radius:18px;background:#fff;padding:12px;transition:all .18s ease}.appearance-card:hover{background:#fffaf6}.studio-shell[data-color-mode=dark] .appearance-card:hover{background:#162236}.appearance-card.active{border-color:var(--accent-border);background:var(--accent-soft-end);box-shadow:0 12px 24px var(--accent-focus)}.appearance-swatches{display:flex;align-items:center;gap:6px;margin-bottom:10px}.appearance-swatch{width:18px;height:18px;border-radius:999px;border:1px solid rgba(17,24,39,.06);box-shadow:inset 0 1px #ffffffb3}.empty-card{border-radius:18px;border:1px dashed #e0dbd2;background:#faf8f4;padding:14px 16px;text-align:center;font-size:12px;color:#aaa196}.studio-shell[data-color-mode=dark] .empty-card{color:#7f90a8}.studio-canvas{background:#f7f6f3}.studio-shell[data-color-mode=dark] .studio-canvas{background:#0b1220}.canvas-overlay-stack{position:absolute;top:16px;left:16px;z-index:20;display:flex;flex-direction:column;gap:8px}.canvas-meta-card{min-width:180px;padding:10px 12px;border:1px solid #e8e4dd;border-radius:14px;background:#ffffffeb;box-shadow:0 10px 26px #1118270a;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.canvas-meta-card-wide{min-width:240px}.canvas-meta-label{font-size:11px;color:#8a8479}.canvas-meta-value{margin-top:2px;font-size:12px;font-weight:700;color:#1f2937}.canvas-meta-select{width:100%;margin-top:4px;border:0;background:transparent;outline:none;font-size:12px;font-weight:700;color:#1f2937}.canvas-overlay-tools{position:absolute;top:16px;right:16px;z-index:20;display:flex;align-items:center;gap:8px}.studio-shell[data-color-mode=dark] .canvas-meta-card{border-color:#2a3a52;background:#0f172ae6;box-shadow:none}.studio-shell[data-color-mode=dark] .canvas-meta-label{color:#94a3b8}.studio-shell[data-color-mode=dark] .canvas-meta-value,.studio-shell[data-color-mode=dark] .canvas-meta-select{color:#e5e7eb}.right-drawer{position:absolute;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;border:1px solid #e8e4dd;border-radius:20px;background:#fffffffa;box-shadow:0 18px 40px #11182714;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transform:translate(calc(100% + 16px));opacity:0;pointer-events:none;transition:transform .22s ease,opacity .22s ease;z-index:28}.right-drawer.open{transform:translate(0);opacity:1;pointer-events:auto}.palette-drawer{background:#fff;border-color:#e8e4dd;border-radius:20px;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:0 18px 40px #11182714}.studio-shell[data-color-mode=dark] .palette-drawer-header,.studio-shell[data-color-mode=dark] .palette-drawer-search,.studio-shell[data-color-mode=dark] .palette-drawer-body{background:#0f172a}.palette-drawer-header{background:#fff}.palette-drawer-search{background:#fbfaf8}.palette-drawer-body{background:#fff}.execution-logs{height:264px;flex-shrink:0;border-top:1px solid #e8e4dd;background:#fffffffa;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);transition:height .2s ease}.studio-shell[data-color-mode=dark] .execution-logs{border-top-color:#223047;background:#0a111ef5}.execution-logs-popout-shell{background:#f2f1ee;width:100vw;min-width:100vw;max-width:100vw;height:100vh;min-height:100vh}.execution-logs.execution-logs-fullscreen{width:100%;min-width:0;max-width:100%;flex:1 1 auto;height:100vh;min-height:100vh;border-top:0;overflow:hidden}.execution-logs.execution-logs-fullscreen .execution-logs-header{height:64px;padding:0 20px}.execution-logs.execution-logs-fullscreen .execution-logs-header:before{display:none}.execution-logs.execution-logs-fullscreen .execution-logs-body{width:100%;min-width:0;max-width:100%;height:calc(100vh - 64px)}.execution-logs.collapsed{height:56px}.execution-logs-header{position:relative;height:56px;width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;border-bottom:1px solid #efe9e1;background:transparent}.execution-logs-header:before{content:"";position:absolute;top:8px;left:50%;transform:translate(-50%);width:64px;height:5px;border-radius:999px;background:#94a3b859}.execution-logs-header-actions{display:flex;align-items:center;gap:10px}.execution-logs-collapse-action{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #e8e4dd;border-radius:999px;background:#fff;color:#4b5563;display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 12px;transition:border-color .16s ease,background .16s ease,color .16s ease}.execution-logs-collapse-action:hover,.execution-logs-copy-action:hover{border-color:rgba(var(--accent-rgb),.28);background:#fff7f3;color:#1f2937}.studio-shell[data-color-mode=dark] .execution-logs-collapse-action{border-color:#2a3a52;background:#0f172a;color:#cbd5e1}.studio-shell[data-color-mode=dark] .execution-logs-collapse-action:hover,.studio-shell[data-color-mode=dark] .execution-logs-copy-action:hover{border-color:rgba(var(--accent-rgb),.4);background:#162236;color:#f8fafc}.execution-logs-collapse-action:focus-visible,.execution-logs-copy-action:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(var(--accent-rgb),.14)}.execution-logs-collapse-icon{transition:transform .16s ease}.execution-logs-collapse-icon.collapsed{transform:rotate(180deg)}.execution-logs-copy-action.active,.execution-logs-window-action.active{border-color:rgba(var(--accent-rgb),.28);background:#fff4f1;color:var(--accent-text)}.studio-shell[data-color-mode=dark] .execution-logs-copy-action.active,.studio-shell[data-color-mode=dark] .execution-logs-window-action.active{border-color:rgba(var(--accent-rgb),.4);background:#172235}.execution-logs-body{display:grid;grid-template-columns:280px minmax(0,1fr);gap:0;width:100%;min-width:0;height:calc(100% - 56px);min-height:0}.execution-runs-list{min-width:0;min-height:0;overflow-y:auto;border-right:1px solid #f1ece5;background:#fbfaf8;padding:14px;display:flex;flex-direction:column;gap:10px}.studio-shell[data-color-mode=dark] .execution-runs-list{border-right-color:#223047;background:#0f172a}.execution-log-stream{width:100%;min-width:0;max-width:100%;min-height:0;padding:14px;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px;background:#fff;overflow:hidden}.studio-shell[data-color-mode=dark] .execution-log-stream{background:#111b2d}.execution-log-list{width:100%;min-width:0;min-height:0;overflow-y:auto;overflow-x:auto;display:flex;flex-direction:column;gap:10px}.execution-run-card,.execution-log-card{width:100%;max-width:100%;text-align:left;border:1px solid #e8e4dd;border-radius:14px;background:#fff;padding:12px 14px;transition:all .16s ease}.execution-log-card{cursor:copy}.studio-shell[data-color-mode=dark] .execution-run-card,.studio-shell[data-color-mode=dark] .execution-log-card,.studio-shell[data-color-mode=dark] .workflow-node{border-color:#2a3a52;background:#0f172a;box-shadow:none}.execution-run-card:hover,.execution-log-card:hover{background:#fffaf6}.execution-run-card.active,.execution-log-card.active{border-color:#f0483e3d;background:#fff4f1}.execution-log-card.tone-pending{border-color:#2f6fec38;background:linear-gradient(180deg,#f4f8fff5,#eaf2ffeb)}.studio-shell[data-color-mode=dark] .execution-log-card.tone-pending{border-color:rgba(var(--accent-rgb),.3);background:linear-gradient(180deg,#121f36fa,#101c31fa)}.execution-log-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.execution-log-card-meta{display:flex;align-items:center;gap:8px;flex-shrink:0}.execution-log-card-copied{display:inline-flex;align-items:center;gap:4px;min-height:22px;padding:0 8px;border-radius:999px;background:rgba(var(--accent-rgb),.12);color:var(--accent-text);font-size:10px;font-weight:700;letter-spacing:.02em}.execution-log-card-preview{margin-top:8px;color:#4b5563;font-size:11px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.studio-shell[data-color-mode=dark] .execution-log-card-preview{color:#cbd5e1}.execution-action-panel{border:1px solid #e8e4dd;border-radius:16px;background:#fff;box-shadow:none;padding:16px;display:flex;flex-direction:column;gap:14px}.studio-shell[data-color-mode=dark] .execution-action-panel{border-color:#2a3a52;background:#0f172a;box-shadow:none}.execution-action-badge{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid rgba(var(--accent-rgb),.18);background:var(--accent-soft-start);color:var(--accent-text);font-size:11px;font-weight:700}.execution-action-intro{display:flex;flex-direction:column;gap:12px}.execution-action-subtitle{margin-top:6px;color:#6b7280;font-size:12px;line-height:1.5}.studio-shell[data-color-mode=dark] .execution-action-subtitle{color:#94a3b8}.execution-action-meta{display:flex;flex-wrap:wrap;gap:8px}.execution-action-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid #ece5db;background:#faf7f2;color:#5f5750;font-size:11px;font-weight:600}.studio-shell[data-color-mode=dark] .execution-action-chip{border-color:#2a3a52;background:#111b2d;color:#dbe4f0}.execution-action-block{display:flex;flex-direction:column;gap:8px}.execution-action-block-label{color:#9ca3af;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.execution-action-field-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.execution-action-requirement{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase}.execution-action-requirement.required{background:#f0483e1a;color:#b42318}.execution-action-requirement.optional{background:#3b82f61a;color:#1d4ed8}.studio-shell[data-color-mode=dark] .execution-action-requirement.required{background:#f871712e;color:#fecaca}.studio-shell[data-color-mode=dark] .execution-action-requirement.optional{background:#60a5fa2e;color:#bfdbfe}.execution-action-helper{color:#6b7280;font-size:12px;line-height:1.5}.studio-shell[data-color-mode=dark] .execution-action-helper{color:#94a3b8}.execution-action-prompt{border:1px solid #ece5db;border-radius:18px;background:#ffffffc7;color:#4b5563;font-size:13px;line-height:1.6;padding:12px 14px;white-space:pre-wrap}.studio-shell[data-color-mode=dark] .execution-action-prompt{border-color:#2a3a52;background:#0f172ac2;color:#cbd5e1}.execution-action-textarea{min-height:110px}.execution-action-footer{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.execution-danger-action{color:#b42318;border-color:#b4231824;background:#fff7f6}.execution-danger-action:hover{background:#ffefed;border-color:#b423183d}.studio-shell[data-color-mode=dark] .execution-danger-action{color:#fca5a5;border-color:#f871712e;background:#450a0a3d}.studio-shell[data-color-mode=dark] .execution-danger-action:hover{background:#450a0a5c;border-color:#f8717147}.react-flow__node{border-radius:10px!important}.react-flow__handle{width:10px;height:10px;border:2px solid #fff;border-radius:999px}.react-flow__handle-left{left:-5px}.react-flow__handle-right{right:-5px}.react-flow__edge-path{stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round}.react-flow__edge{z-index:4!important}.react-flow__attribution{display:none}.react-flow__controls{background:transparent!important;border:0!important;box-shadow:none!important;display:flex!important;flex-direction:row!important;gap:8px!important;margin:16px!important}.react-flow__controls-button{width:40px!important;height:40px!important;border:1px solid #e7e3dc!important;border-radius:12px!important;background:#fffffff5!important;color:#5b6470!important;fill:currentColor!important;box-shadow:none!important;border-bottom:1px solid #e7e3dc!important}.studio-shell[data-color-mode=dark] .react-flow__controls-button{border-color:#2a3a52!important;border-bottom-color:#2a3a52!important;background:#0f172af5!important;color:#dbe4f0!important;box-shadow:none!important}.react-flow__controls-button:hover{background:#f7f6f3!important;color:#1f2328!important}.studio-shell[data-color-mode=dark] .react-flow__controls-button:hover{background:#162236!important;color:#f8fafc!important}.react-flow__minimap{border:1px solid #e7e3dc!important;border-radius:16px!important;overflow:hidden!important;box-shadow:none!important;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.react-flow__minimap svg{background:transparent!important}.react-flow__minimap-mask{fill:#ffffffb3!important}.studio-shell[data-color-mode=dark] .react-flow__minimap{border-color:#2a3a52!important;box-shadow:none!important}.studio-shell[data-color-mode=dark] .react-flow__minimap-mask{fill:#0b1220b8!important}.workflow-node{background:#fff;border:1px solid #e3dfd8;border-radius:14px;box-shadow:0 8px 22px #1118270a;transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease;overflow:hidden;min-width:200px}.studio-shell[data-color-mode=dark] .workflow-node{background:#0f172a}.workflow-node-icon{width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.workflow-node-title{min-width:0;font-size:13px;font-weight:700;line-height:1.2;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.studio-shell[data-color-mode=dark] .workflow-node-title{color:#e5e7eb}.workflow-node-subtitle{min-width:0;margin-top:2px;font-size:11px;line-height:1.3;color:#9ca3af;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workflow-node-status-dot{width:9px;height:9px;border-radius:999px;flex-shrink:0;background:#94a3b8;box-shadow:0 0 0 2px #94a3b81f}.workflow-node-status-dot.active{background:#2563eb;box-shadow:0 0 0 2px #3b82f624}.workflow-node-status-dot.waiting{background:#d97706;box-shadow:0 0 0 2px #f59e0b29}.workflow-node-status-dot.completed{background:#16a34a;box-shadow:0 0 0 2px #22c55e24}.workflow-node-status-dot.failed{background:#dc2626;box-shadow:0 0 0 2px #ef444424}.workflow-node.compact{border-radius:14px;box-shadow:0 6px 16px #1118270a}.workflow-node.compact:hover{transform:none;box-shadow:0 8px 18px #1118270f}.workflow-node-compact,.workflow-node-micro{display:flex;align-items:center;gap:10px;min-height:54px;padding:10px 12px}.workflow-node-compact-meta,.workflow-node-micro-meta{min-width:0;flex:1}.workflow-node.micro{border-radius:14px;box-shadow:0 4px 12px #1118270a}.workflow-node.micro:hover{transform:none;box-shadow:0 6px 14px #1118270d}.workflow-node-micro{min-height:42px;padding:8px 10px;gap:8px}.workflow-node-icon-micro{width:24px;height:24px;border-radius:8px}.workflow-node.micro .workflow-node-title{font-size:11px}.workflow-node.micro .react-flow__handle{width:8px;height:8px}.workflow-node.compact .react-flow__handle{width:9px;height:9px}.workflow-node:hover{border-color:#d2cdc4;box-shadow:0 10px 24px #1118270f;transform:none}.workflow-node.selected{border-color:rgba(var(--accent-rgb),.3);box-shadow:0 0 0 3px var(--accent-focus),0 10px 24px #1118270f}.workflow-node.execution-focus{border-color:#4f6ef75c;box-shadow:0 0 0 3px #4f6ef714,0 10px 24px #4f6ef714}.workflow-node.node-status-active{border-color:#3b82f657}.workflow-node.node-status-waiting{border-color:#f59e0b57}.workflow-node.node-status-completed{border-color:#22c55e57}.workflow-node.node-status-failed{border-color:#ef444457}.node-run-pill{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.node-run-pill.active{background:#3b82f61a;color:#2563eb}.node-run-pill.waiting{background:#f59e0b1f;color:#b45309}.node-run-pill.completed{background:#22c55e1f;color:#15803d}.node-run-pill.failed{background:#ef44441f;color:#dc2626}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-\[\#F9F6F0\]:hover{--tw-bg-opacity: 1;background-color:rgb(249 246 240 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FAF8F4\]:hover{--tw-bg-opacity: 1;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FBFAF7\]:hover{--tw-bg-opacity: 1;background-color:rgb(251 250 247 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF0EB\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 240 235 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF4DE\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 244 222 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF9F4\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 249 244 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:block{display:block}.sm\:p-5{padding:1.25rem}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1\.1fr\)_320px\]{grid-template-columns:minmax(0,1.1fr) 320px}.md\:p-7{padding:1.75rem}.md\:p-8{padding:2rem}}@media (min-width: 1024px){.lg\:grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.lg\:items-end{align-items:flex-end}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-\[320px_minmax\(0\,1fr\)\]{grid-template-columns:320px minmax(0,1fr)}} +.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-editor .synthetic-focus,.monaco-diff-editor .synthetic-focus,.monaco-editor [tabindex="0"]:focus,.monaco-diff-editor [tabindex="0"]:focus,.monaco-editor [tabindex="-1"]:focus,.monaco-diff-editor [tabindex="-1"]:focus,.monaco-editor button:focus,.monaco-diff-editor button:focus,.monaco-editor input[type=button]:focus,.monaco-diff-editor input[type=button]:focus,.monaco-editor input[type=checkbox]:focus,.monaco-diff-editor input[type=checkbox]:focus,.monaco-editor input[type=search]:focus,.monaco-diff-editor input[type=search]:focus,.monaco-editor input[type=text]:focus,.monaco-diff-editor input[type=text]:focus,.monaco-editor select:focus,.monaco-diff-editor select:focus,.monaco-editor textarea:focus,.monaco-diff-editor textarea:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:var(--vscode-focusBorder);opacity:1}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background);overflow-wrap:initial}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .editorCanvas{position:absolute;width:100%;height:100%;z-index:0;pointer-events:none}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .view-overlays>div,.monaco-editor .margin-view-overlays>div{position:absolute;width:100%}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar{background:var(--vscode-scrollbar-background)}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box;height:100%}.monaco-editor .margin-view-overlays .line-numbers{bottom:0;font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-mouse-cursor-text{cursor:text}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{-moz-user-select:text;user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{-moz-user-select:initial;user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{box-sizing:border-box;position:absolute;width:100%}.monaco-editor .lines-content>.view-lines>.view-line>span{top:0;bottom:0;position:absolute}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px;pointer-events:none}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.minimap-autohide-mouseover,.minimap.minimap-autohide-scroll{opacity:0;transition:opacity .5s}.minimap.minimap-autohide-scroll{pointer-events:none}.minimap.minimap-autohide-mouseover:hover,.minimap.minimap-autohide-scroll.active{opacity:1;pointer-events:auto}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .monaco-decoration-css-rule-extractor{visibility:hidden;pointer-events:none}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .native-edit-context{margin:0;padding:0;position:absolute;overflow-y:scroll;scrollbar-width:none;z-index:-10;white-space:pre-wrap}.monaco-editor .ime-text-area{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .edit-context-composition-none{background-color:transparent;border-bottom:none}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-secondary{border-bottom:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :not(.hc-black,.hc-light) .edit-context-composition-primary{border-bottom:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-secondary{border:1px solid var(--vscode-editor-compositionBorder)}.monaco-editor :is(.hc-black,.hc-light) .edit-context-composition-primary{border:2px solid var(--vscode-editor-compositionBorder)}.monaco-editor .margin-view-overlays .gpu-mark{position:absolute;top:0;bottom:0;left:0;width:100%;display:inline-block;border-left:solid 2px var(--vscode-editorWarning-foreground);opacity:.2;transition:background-color .1s linear}.monaco-editor .margin-view-overlays .gpu-mark:hover{background-color:var(--vscode-editorWarning-foreground)}.monaco-hover.workbench-hover{position:relative;font-size:13px;line-height:19px;z-index:40;overflow:hidden;max-width:700px;background:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:5px;color:var(--vscode-editorHoverWidget-foreground);box-shadow:0 2px 8px var(--vscode-widget-shadow)}.monaco-hover.workbench-hover .monaco-action-bar .action-item .codicon{width:13px;height:13px}.monaco-hover.workbench-hover hr{border-bottom:none}.monaco-hover.workbench-hover.compact{font-size:12px}.monaco-hover.workbench-hover.compact .monaco-action-bar .action-item .codicon{width:12px;height:12px}.monaco-hover.workbench-hover.compact .hover-contents{padding:2px 8px}.workbench-hover-container.locked .monaco-hover.workbench-hover{outline:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:focus-within.locked .monaco-hover.workbench-hover{outline-color:var(--vscode-focusBorder)}.workbench-hover-pointer{position:absolute;z-index:41;pointer-events:none}.workbench-hover-pointer:after{content:"";position:absolute;width:5px;height:5px;background-color:var(--vscode-editorHoverWidget-background);border-right:1px solid var(--vscode-editorHoverWidget-border);border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.workbench-hover-container:not(:focus-within).locked .workbench-hover-pointer:after{width:4px;height:4px;border-right-width:2px;border-bottom-width:2px}.workbench-hover-container:focus-within .workbench-hover-pointer:after{border-right:1px solid var(--vscode-focusBorder);border-bottom:1px solid var(--vscode-focusBorder)}.workbench-hover-pointer.left{left:-3px}.workbench-hover-pointer.right{right:3px}.workbench-hover-pointer.top{top:-3px}.workbench-hover-pointer.bottom{bottom:3px}.workbench-hover-pointer.left:after{transform:rotate(135deg)}.workbench-hover-pointer.right:after{transform:rotate(315deg)}.workbench-hover-pointer.top:after{transform:rotate(225deg)}.workbench-hover-pointer.bottom:after{transform:rotate(45deg)}.monaco-hover.workbench-hover a{color:var(--vscode-textLink-foreground)}.monaco-hover.workbench-hover a:focus{outline:1px solid;outline-offset:-1px;text-decoration:underline;outline-color:var(--vscode-focusBorder)}.monaco-hover.workbench-hover a.codicon:focus,.monaco-hover.workbench-hover a.monaco-button:focus{text-decoration:none}.monaco-hover.workbench-hover a:hover,.monaco-hover.workbench-hover a:active{color:var(--vscode-textLink-activeForeground)}.monaco-hover.workbench-hover code{background:var(--vscode-textCodeBlock-background)}.monaco-hover.workbench-hover .hover-row .actions{background:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-hover.workbench-hover.right-aligned{left:1px}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions{flex-direction:row-reverse}.monaco-hover.workbench-hover.right-aligned .hover-row.status-bar .actions .action-container{margin-right:0;margin-left:16px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;-moz-user-select:text;user-select:text;-webkit-user-select:text;box-sizing:border-box;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.fade-in{animation:fadein .1s linear}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px;width:100%}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer;overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px;vertical-align:middle}.monaco-hover .hover-row.status-bar .actions .action-container a{color:var(--vscode-textLink-foreground);-webkit-text-decoration:var(--text-link-decoration);text-decoration:var(--text-link-decoration)}.monaco-hover .hover-row.status-bar .actions .action-container a .icon.codicon{color:var(--vscode-textLink-foreground)}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) p:last-child [style*=background-color]{margin-bottom:4px;display:inline-block}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span.codicon{margin-bottom:2px}.monaco-hover-content .action-container a{-webkit-user-select:none;-moz-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}.monaco-hover .action-container,.monaco-hover .action,.monaco-hover button,.monaco-hover .monaco-button,.monaco-hover .monaco-text-button,.monaco-hover [role=button]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:3px;min-height:24px}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list .monaco-scrollable-element>.scrollbar.vertical,.monaco-pane-view>.monaco-split-view2.vertical>.monaco-scrollable-element>.scrollbar.vertical{z-index:14}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000;background-color:var(--vscode-list-activeSelectionBackground);color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-list-focusOutline);outline-offset:-1px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label:not(.icon),.monaco-action-bar .action-item.disabled .action-label:not(.icon):before,.monaco-action-bar .action-item.disabled .action-label:not(.icon):hover{color:var(--vscode-disabledForeground)}.monaco-action-bar .action-item.disabled .action-label.icon,.monaco-action-bar .action-item.disabled .action-label.icon:before,.monaco-action-bar .action-item.disabled .action-label.icon:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid var(--vscode-disabledForeground);padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:var(--vscode-disabledForeground)}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-action-bar .action-item.menu-entry.text-only .action-label{color:var(--vscode-descriptionForeground);overflow:hidden;border-radius:2px}.monaco-action-bar .action-item.menu-entry.text-only.use-comma:not(:last-of-type) .action-label:after{content:", "}.monaco-action-bar .action-item.menu-entry.text-only+.action-item:not(.text-only)>.monaco-dropdown .action-label{color:var(--vscode-descriptionForeground)}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-action-bar .checkbox-action-item{display:flex;align-items:center;border-radius:2px;padding-right:2px}.monaco-action-bar .checkbox-action-item:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-action-bar .checkbox-action-item>.monaco-custom-toggle.monaco-checkbox{margin-right:4px}.monaco-action-bar .checkbox-action-item>.checkbox-label{font-size:12px}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{cursor:grab;display:flex;align-items:center;border-top-right-radius:5px;border-top-left-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-inline-action-bar>.actions-container>.action-item:first-child{margin-left:5px}.quick-input-inline-action-bar>.actions-container>.action-item{margin-top:2px}.quick-input-title{cursor:grab;padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-right-action-bar>.actions-container>.action-item{margin-left:4px}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{cursor:grab;display:flex;padding:6px 6px 2px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-widget .quick-input-header .monaco-checkbox{margin-top:6px}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 6px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-widget .monaco-checkbox{margin-right:0}.quick-input-widget .quick-input-list .monaco-checkbox,.quick-input-widget .quick-input-tree .monaco-checkbox{margin-top:4px}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-list .monaco-list-row .monaco-highlighted-label .highlight{font-weight:700;background-color:unset;color:var(--vscode-list-highlightForeground)!important}.quick-input-list .monaco-list .monaco-list-row.focused .monaco-highlighted-label .highlight{color:var(--vscode-list-focusHighlightForeground)!important}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .quick-input-list-entry.focus-inside .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.passive-focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.quick-input-list>.monaco-list:focus .monaco-list-row.focused .quick-input-list-entry.quick-input-list-separator-border{border-color:transparent}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{padding:4px 6px;font-size:12px}.quick-input-list .quick-input-list-separator-as-item .label-name{font-weight:600}.quick-input-list .quick-input-list-separator-as-item .label-description{opacity:1!important}.quick-input-list .monaco-tree-sticky-row .quick-input-list-entry.quick-input-list-separator-as-item.quick-input-list-separator-border{border-top-style:none}.quick-input-list .monaco-tree-sticky-row{padding:0 5px}.quick-input-list .monaco-tl-twistie{display:none!important}.quick-input-tree .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-tree .quick-input-tree-entry{box-sizing:border-box;overflow:hidden;display:flex;padding:0 6px}.quick-input-tree .quick-input-tree-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-tree .quick-input-tree-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-tree .quick-input-tree-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row{display:flex;align-items:center}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label,.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-tree .quick-input-tree-rows>.quick-input-tree-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-tree .quick-input-tree-rows .monaco-highlighted-label>span{opacity:1}.quick-input-tree .quick-input-tree-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-tree .quick-input-tree-entry-action-bar .action-label{display:none}.quick-input-tree .quick-input-tree-entry-action-bar .action-label.codicon{margin-right:4px;padding:2px}.quick-input-tree .quick-input-tree-entry-action-bar{margin-top:1px;margin-right:4px}.quick-input-tree .quick-input-tree-entry .quick-input-tree-entry-action-bar .action-label.always-visible,.quick-input-tree .quick-input-tree-entry:hover .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .quick-input-tree-entry.focus-inside .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.focused .quick-input-tree-entry-action-bar .action-label,.quick-input-tree .monaco-list-row.passive-focused .quick-input-tree-entry-action-bar .action-label{display:flex}.quick-input-tree>.monaco-list:focus .monaco-list-row.focused{outline:1px solid var(--vscode-list-focusOutline)!important;outline-offset:-1px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0;display:flex;align-items:center}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 5px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:2px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:2px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-iconpath{width:16px;height:22px;margin-right:6px;display:flex}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-suffix-container>.label-suffix{opacity:.7;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.bold>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-weight:700}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent;opacity:0}.monaco-enable-motion .monaco-tl-indent>.indent-guide{transition:opacity .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;right:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 10px 0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-enable-motion .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container{position:absolute;top:0;left:0;width:100%;height:0;z-index:13;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row.monaco-list-row{position:absolute;width:100%;opacity:1!important;overflow:hidden;background-color:var(--vscode-sideBar-background)}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row:hover{background-color:var(--vscode-list-hoverBackground)!important;cursor:pointer}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty,.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container.empty .monaco-tree-sticky-container-shadow{display:none}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{position:absolute;bottom:-3px;left:0;height:0px;width:100%}.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{outline:none}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-enable-motion .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-enable-motion .monaco-table>.monaco-split-view2,.monaco-enable-motion .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-diff-editor .diff-review{position:absolute}.monaco-component.diff-review{-moz-user-select:none;user-select:none;-webkit-user-select:none;z-index:99}.monaco-component.diff-review .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-component.diff-review .diff-review-summary{padding-left:10px}.monaco-component.diff-review .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-component.diff-review .diff-review-row{white-space:pre}.monaco-component.diff-review .diff-review-table{display:table;min-width:100%}.monaco-component.diff-review .diff-review-row{display:table-row;width:100%}.monaco-component.diff-review .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-component.diff-review .diff-review-spacer>.codicon{font-size:9px!important}.monaco-component.diff-review .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-component.diff-review .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-component.diff-review .revertButton{cursor:pointer}.monaco-component.diff-review .action-label{background:var(--vscode-editorActionList-background)}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-toolbar.responsive .monaco-action-bar>.actions-container>.action-item{flex-shrink:1;min-width:20px}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent}.monaco-editor.draggingUnchangedRegion.canMoveTop:not(.canMoveBottom) *,.monaco-editor .diff-hidden-lines .top.canMoveTop:not(.canMoveBottom),.monaco-editor .diff-hidden-lines .bottom.canMoveTop:not(.canMoveBottom){cursor:n-resize!important}.monaco-editor.draggingUnchangedRegion:not(.canMoveTop).canMoveBottom *,.monaco-editor .diff-hidden-lines .top:not(.canMoveTop).canMoveBottom,.monaco-editor .diff-hidden-lines .bottom:not(.canMoveTop).canMoveBottom{cursor:s-resize!important}.monaco-editor.draggingUnchangedRegion.canMoveTop.canMoveBottom *,.monaco-editor .diff-hidden-lines .top.canMoveTop.canMoveBottom,.monaco-editor .diff-hidden-lines .bottom.canMoveTop.canMoveBottom{cursor:ns-resize!important}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px;box-shadow:inset 0 -5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow),inset 0 5px 5px -7px var(--vscode-diffEditor-unchangedRegionShadow)}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete,.monaco-editor .inline-deleted-text{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .inline-deleted-text{text-decoration:line-through}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor.side-by-side .editor.original{box-shadow:6px 0 5px -5px var(--vscode-scrollbar-shadow);border-right:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .gutter{position:relative;overflow:hidden;flex-shrink:0;flex-grow:0}.monaco-diff-editor .gutter>div{position:absolute}.monaco-diff-editor .gutter .gutterItem{opacity:0;transition:opacity .7s}.monaco-diff-editor .gutter .gutterItem.showAlways{opacity:1;transition:none}.monaco-diff-editor .gutter .gutterItem.noTransition{transition:none}.monaco-diff-editor .gutter:hover .gutterItem{opacity:1;transition:opacity .1s ease-in-out}.monaco-diff-editor .gutter .gutterItem .background{position:absolute;height:100%;left:50%;width:1px;border-left:2px var(--vscode-menu-separatorBackground) solid}.monaco-diff-editor .gutter .gutterItem .buttons{position:absolute;width:100%;display:flex;justify-content:center;align-items:center}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar{height:-moz-fit-content;height:fit-content}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar{line-height:1}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container{width:-moz-fit-content;width:fit-content;border-radius:4px;background:var(--vscode-editorGutter-itemBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item:hover{background:var(--vscode-toolbar-hoverBackground)}.monaco-diff-editor .gutter .gutterItem .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item .action-label{color:var(--vscode-editorGutter-itemGlyphForeground);padding:1px 2px}.monaco-diff-editor .diff-hidden-lines-compact{display:flex;height:11px}.monaco-diff-editor .diff-hidden-lines-compact .line-left,.monaco-diff-editor .diff-hidden-lines-compact .line-right{height:1px;border-top:1px solid;border-color:var(--vscode-editorCodeLens-foreground);opacity:.5;margin:auto;width:100%}.monaco-diff-editor .diff-hidden-lines-compact .line-left{width:20px}.monaco-diff-editor .diff-hidden-lines-compact .text{color:var(--vscode-editorCodeLens-foreground);text-wrap:nowrap;font-size:11px;line-height:11px;margin:0 4px}.monaco-editor .line-delete-selectable{-moz-user-select:text!important;user-select:text!important;-webkit-user-select:text!important;z-index:1!important}.line-delete-selectable .view-line{-moz-user-select:text!important;user-select:text!important;-webkit-user-select:text!important}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.rendered-markdown li:has(input[type=checkbox]){list-style-type:none}.monaco-component.multiDiffEditor{background:var(--vscode-multiDiffEditor-background);position:relative;height:100%;width:100%;overflow-y:hidden}.monaco-component.multiDiffEditor>div{position:absolute;top:0;left:0;height:100%;width:100%}.monaco-component.multiDiffEditor>div.placeholder{visibility:hidden;display:grid;place-items:center;place-content:center}.monaco-component.multiDiffEditor>div.placeholder.visible{visibility:visible}.monaco-component.multiDiffEditor .active{--vscode-multiDiffEditor-border: var(--vscode-focusBorder)}.monaco-component.multiDiffEditor .multiDiffEntry{display:flex;flex-direction:column;flex:1;overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button{margin:0 5px;cursor:pointer}.monaco-component.multiDiffEditor .multiDiffEntry .collapse-button a{display:block}.monaco-component.multiDiffEditor .multiDiffEntry .header{z-index:1000;background:var(--vscode-editor-background)}.monaco-component.multiDiffEditor .multiDiffEntry .header:not(.collapsed) .header-content{border-bottom:1px solid var(--vscode-sideBarSectionHeader-border)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content{margin:8px 0 0;padding:4px 5px;border-top:1px solid var(--vscode-multiDiffEditor-border);display:flex;align-items:center;color:var(--vscode-foreground);background:var(--vscode-multiDiffEditor-headerBackground)}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content.shadow{box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path{display:flex;flex:1;min-width:0}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title{font-size:14px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .title.original{flex:1;min-width:0;text-overflow:ellipsis}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .file-path .status{font-weight:600;opacity:.75;margin:0 10px;line-height:22px}.monaco-component.multiDiffEditor .multiDiffEntry .header .header-content .actions{padding:0 8px}.monaco-component.multiDiffEditor .multiDiffEntry .editorParent{flex:1;display:flex;flex-direction:column;border-bottom:1px solid var(--vscode-multiDiffEditor-border);overflow:hidden}.monaco-component.multiDiffEditor .multiDiffEntry .editorContainer{flex:1}.monaco-editor .selection-anchor{background-color:#007acc;width:2px!important}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.inline-editor-progress-decoration{display:inline-block;width:1em;height:1em}.inline-progress-widget{display:flex!important;justify-content:center;align-items:center}.inline-progress-widget .icon{font-size:80%!important}.inline-progress-widget:hover .icon{font-size:90%!important;animation:none}.inline-progress-widget:hover .icon:before{content:var(--vscode-icon-x-content);font-family:var(--vscode-icon-x-font-family)}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.action-widget{font-size:13px;min-width:100px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-menu-border)!important;border-radius:5px;background-color:var(--vscode-menu-background);color:var(--vscode-menu-foreground);padding:4px;box-shadow:0 2px 8px var(--vscode-widget-shadow)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{-moz-user-select:none;user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 4px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%;border-radius:3px}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-list-activeSelectionBackground)!important;color:var(--vscode-list-activeSelectionForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600;font-size:13px}.action-widget .monaco-list-row.group-header:not(:first-of-type){margin-top:2px}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator{border-top:1px solid var(--vscode-editorHoverWidget-border);color:var(--vscode-descriptionForeground);font-size:12px;padding:0;margin:4px 0 0;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;border-radius:0}.action-widget .monaco-scrollable-element .monaco-list-rows .monaco-list-row.separator.focused{outline:0 solid;background-color:transparent;border-radius:0}.action-widget .monaco-list-row.separator:first-of-type{border-top:none;margin-top:0}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:4px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .monaco-list-row.action .monaco-keybinding>.monaco-keybinding-key{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow)}.action-widget .action-widget-action-bar{background-color:var(--vscode-menu-background);border-top:1px solid var(--vscode-menu-border);margin-top:2px}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:4px 8px 2px 24px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:13px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.action-widget .monaco-list .monaco-list-row .description{opacity:.7;margin-left:.5em}.post-edit-widget{box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:1px solid var(--vscode-widget-border, transparent);border-radius:4px;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);overflow:hidden}.post-edit-widget .monaco-button{padding:2px;border:none;border-radius:0}.post-edit-widget .monaco-button:hover{background-color:var(--vscode-button-hoverBackground)!important}.post-edit-widget .monaco-button .codicon{margin:0}@font-face{font-family:codicon;font-display:block;src:url(/codicon.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-user-select:none;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix,.monaco-editor .lightBulbWidget.codicon-lightbulb-sparkle-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget.codicon-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;z-index:1}.monaco-editor .glyph-margin-widgets .cgmr[class*=codicon-gutter-lightbulb]{display:block;cursor:pointer}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-auto-fix,.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-aifix-auto-fix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .glyph-margin-widgets .cgmr.codicon-gutter-lightbulb-sparkle-filled{color:var(--vscode-editorLightBulbAi-foreground, var(--vscode-icon-foreground))}.monaco-editor .codelens-decoration{overflow:hidden;display:inline-flex!important;align-items:center;text-overflow:ellipsis;white-space:nowrap;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize);padding-right:calc(var(--vscode-editorCodeLens-fontSize)*.5);font-feature-settings:var(--vscode-editorCodeLens-fontFeatureSettings);font-family:var(--vscode-editorCodeLens-fontFamily),var(--vscode-editorCodeLens-fontFamilyDefault)}.monaco-editor .codelens-decoration>span,.monaco-editor .codelens-decoration>a{-moz-user-select:none;user-select:none;-webkit-user-select:none;white-space:nowrap;vertical-align:sub;display:inline-flex;align-items:center}.monaco-editor .codelens-decoration>a{text-decoration:none}.monaco-editor .codelens-decoration>a:hover{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration>a:hover .codicon{color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .codelens-decoration .codicon[class*=codicon-]{vertical-align:middle;color:currentColor!important;color:var(--vscode-editorCodeLens-foreground);line-height:var(--vscode-editorCodeLens-lineHeight);font-size:var(--vscode-editorCodeLens-fontSize)}.monaco-editor .codelens-decoration>a:hover .codicon:before{cursor:pointer}@keyframes fadein{0%{opacity:0}to{opacity:1}}.monaco-editor .codelens-decoration.fadein{animation:fadein .1s linear}.monaco-editor .inlineSuggestionsHints{padding:4px}.monaco-editor .inlineSuggestionsHints .warningMessage p{margin:0}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)!important}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));box-shadow:0 0 8px 2px var(--vscode-widget-shadow);color:var(--vscode-editorWidget-foreground);border-left:1px solid var(--vscode-widget-border);border-right:1px solid var(--vscode-widget-border);border-bottom:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px;background-color:var(--vscode-editorWidget-background)}.monaco-reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px;outline-color:var(--vscode-focusBorder)}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .find-widget.no-results .matchesCount{color:var(--vscode-errorForeground)}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important;background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor .currentFindMatch{background-color:var(--vscode-editor-findMatchBackground);border:2px solid var(--vscode-editor-findMatchBorder);padding:1px;box-sizing:border-box}.monaco-editor .findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor .find-widget .monaco-sash{left:0!important;background-color:var(--vscode-editorWidget-resizeBorder, var(--vscode-editorWidget-border))}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget .button:not(.disabled):hover,.monaco-editor .find-widget .codicon-find-selection:hover{background-color:var(--vscode-toolbar-hoverBackground)!important}.monaco-editor.findMatch{background-color:var(--vscode-editor-findMatchHighlightBackground)}.monaco-editor.currentFindMatch{background-color:var(--vscode-editor-findMatchBackground)}.monaco-editor.findScope{background-color:var(--vscode-editor-findRangeHighlightBackground)}.monaco-editor.findMatch{background-color:var(--vscode-editorWidget-background)}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.colorpicker-widget{height:190px;-moz-user-select:none;user-select:none;-webkit-user-select:none}.colorpicker-color-decoration,.hc-light .colorpicker-color-decoration{border:solid .1em #000;box-sizing:border-box;margin:.1em .2em 0;width:.8em;height:.8em;line-height:.8em;display:inline-block;cursor:pointer}.hc-black .colorpicker-color-decoration,.vs-dark .colorpicker-color-decoration{border:solid .1em #eee}.colorpicker-header{display:flex;height:24px;position:relative;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-header .picked-color{width:240px;display:flex;align-items:center;justify-content:center;line-height:24px;cursor:pointer;color:#fff;flex:1;white-space:nowrap;overflow:hidden}.colorpicker-header .picked-color .picked-color-presentation{white-space:nowrap;margin-left:5px;margin-right:5px}.colorpicker-header .picked-color .codicon{color:inherit;font-size:14px}.colorpicker-header .picked-color.light{color:#000}.colorpicker-header .original-color{width:74px;z-index:inherit;cursor:pointer}.standalone-colorpicker{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header.standalone-colorpicker{border-bottom:none}.colorpicker-header .close-button{cursor:pointer;background-color:var(--vscode-editorHoverWidget-background);border-left:1px solid var(--vscode-editorHoverWidget-border)}.colorpicker-header .close-button-inner-div{width:100%;height:100%;text-align:center}.colorpicker-header .close-button-inner-div:hover{background-color:var(--vscode-toolbar-hoverBackground)}.colorpicker-header .close-icon{padding:3px}.colorpicker-body{display:flex;padding:8px;position:relative}.colorpicker-body .saturation-wrap{overflow:hidden;height:150px;position:relative;min-width:220px;flex:1}.colorpicker-body .saturation-box{height:150px;position:absolute}.colorpicker-body .saturation-selection{width:9px;height:9px;margin:-5px 0 0 -5px;border:1px solid rgb(255,255,255);border-radius:100%;box-shadow:0 0 2px #000c;position:absolute}.colorpicker-body .strip{width:25px;height:150px}.colorpicker-body .standalone-strip{width:25px;height:122px}.colorpicker-body .hue-strip{position:relative;margin-left:8px;cursor:grab;background:linear-gradient(to bottom,red,#ff0 17%,#0f0 33%,#0ff,#00f 67%,#f0f 83%,red)}.colorpicker-body .opacity-strip{position:relative;margin-left:8px;cursor:grab;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII=);background-size:9px 9px;image-rendering:pixelated}.colorpicker-body .strip.grabbing{cursor:grabbing}.colorpicker-body .slider{position:absolute;top:0;left:-2px;width:calc(100% + 4px);height:4px;box-sizing:border-box;border:1px solid rgba(255,255,255,.71);box-shadow:0 0 1px #000000d9}.colorpicker-body .strip .overlay{height:150px;pointer-events:none}.colorpicker-body .standalone-strip .standalone-overlay{height:122px;pointer-events:none}.standalone-colorpicker-body{display:block;border:1px solid transparent;border-bottom:1px solid var(--vscode-editorHoverWidget-border);overflow:hidden}.colorpicker-body .insert-button{position:absolute;height:20px;width:58px;padding:0;right:8px;bottom:8px;background:var(--vscode-button-background);color:var(--vscode-button-foreground);border-radius:2px;border:none;cursor:pointer}.colorpicker-body .insert-button:hover{background:var(--vscode-button-hoverBackground)}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{color:var(--vscode-peekViewResult-fileForeground)!important;background-color:var(--vscode-peekViewResult-matchHighlightBackground)!important}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;-moz-user-select:text;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer;color:var(--vscode-textLink-activeForeground)}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.chat-attached-context-attachment .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-resizable-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;box-sizing:content-box}.monaco-editor .monaco-resizable-hover>.monaco-hover{border:none;border-radius:none}.monaco-editor .monaco-hover{border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background)}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row{display:flex}.monaco-editor .monaco-hover .hover-row.hover-row-with-copy{position:relative;padding-right:20px}.monaco-editor .monaco-hover .hover-row .hover-row-contents{min-width:0;display:flex;flex-direction:column}.monaco-editor .monaco-hover .hover-row .verbosity-actions{border-right:1px solid var(--vscode-editorHoverWidget-border);width:22px;overflow-y:clip}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner{display:flex;flex-direction:column;padding-left:5px;padding-right:5px;justify-content:flex-end;position:relative}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon{cursor:pointer;font-size:11px}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.enabled{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover .hover-row .verbosity-actions-inner .codicon.disabled{opacity:.6}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .monaco-hover .hover-copy-button{position:absolute;top:4px;right:4px;padding:2px 4px;border-radius:3px;display:flex;align-items:center;justify-content:center;opacity:0}.monaco-editor .monaco-hover .hover-row-with-copy:hover .hover-copy-button,.monaco-editor .monaco-hover .hover-row-with-copy:focus-within .hover-copy-button{opacity:1}.monaco-editor .monaco-hover .hover-copy-button:hover{background-color:var(--vscode-toolbar-hoverBackground);cursor:pointer}.monaco-editor .monaco-hover .hover-copy-button:focus{outline:1px solid var(--vscode-focusBorder);outline-offset:-1px}.monaco-editor .monaco-hover .hover-copy-button .codicon{font-size:16px;color:var(--vscode-foreground)}.monaco-editor.vs .dnd-target,.monaco-editor.hc-light .dnd-target{border-right:2px dotted black;color:#fff}.monaco-editor.vs-dark .dnd-target{border-right:2px dotted #AEAFAD;color:#51504f}.monaco-editor.hc-black .dnd-target{border-right:2px dotted #fff;color:#000}.monaco-editor.mouse-default .view-lines,.monaco-editor.vs-dark.mac.mouse-default .view-lines,.monaco-editor.hc-black.mac.mouse-default .view-lines,.monaco-editor.hc-light.mac.mouse-default .view-lines{cursor:default}.monaco-editor.mouse-copy .view-lines,.monaco-editor.vs-dark.mac.mouse-copy .view-lines,.monaco-editor.hc-black.mac.mouse-copy .view-lines,.monaco-editor.hc-light.mac.mouse-copy .view-lines{cursor:copy}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:var(--vscode-editor-foldPlaceholderForeground);margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .snippet-placeholder{min-width:2px;outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetTabstopHighlightBorder, transparent)}.monaco-editor .finish-snippet-placeholder{outline-style:solid;outline-width:1px;background-color:var(--vscode-editor-snippetFinalTabstopHighlightBackground, transparent);outline-color:var(--vscode-editor-snippetFinalTabstopHighlightBorder, transparent)}.monaco-editor .suggest-widget{width:430px;z-index:40;display:flex;flex-direction:column;border-radius:3px}.monaco-editor .suggest-widget.message{flex-direction:row;align-items:center}.monaco-editor .suggest-widget,.monaco-editor .suggest-details{flex:0 1 auto;width:100%;border-style:solid;border-width:1px;border-color:var(--vscode-editorSuggestWidget-border);background-color:var(--vscode-editorSuggestWidget-background)}.monaco-editor.hc-black .suggest-widget,.monaco-editor.hc-black .suggest-details,.monaco-editor.hc-light .suggest-widget,.monaco-editor.hc-light .suggest-details{border-width:2px}.monaco-editor .suggest-widget .suggest-status-bar{box-sizing:border-box;display:none;flex-flow:row nowrap;justify-content:space-between;width:100%;font-size:80%;padding:0 4px;border-top:1px solid var(--vscode-editorSuggestWidget-border);overflow:hidden}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar{display:flex}.monaco-editor .suggest-widget .suggest-status-bar .left{padding-right:8px}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-label{color:var(--vscode-editorSuggestWidgetStatus-foreground)}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label{margin-right:0}.monaco-editor .suggest-widget.with-status-bar .suggest-status-bar .action-item:not(:last-of-type) .action-label:after{content:", ";margin-right:.3em}.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row>.contents>.main>.right>.readMore,.monaco-editor .suggest-widget.with-status-bar .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget.with-status-bar:not(.docs-side) .monaco-list .monaco-list-row:hover>.contents>.main>.right.can-expand-details>.details-label{width:100%}.monaco-editor .suggest-widget>.message{padding-left:22px}.monaco-editor .suggest-widget>.tree{height:100%;width:100%}.monaco-editor .suggest-widget .monaco-list{-moz-user-select:none;user-select:none;-webkit-user-select:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row{display:flex;-mox-box-sizing:border-box;box-sizing:border-box;padding-right:10px;background-repeat:no-repeat;background-position:2px 2px;white-space:nowrap;cursor:pointer;touch-action:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused{color:var(--vscode-editorSuggestWidget-selectedForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused .codicon{color:var(--vscode-editorSuggestWidget-selectedIconForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents{flex:1;height:100%;overflow:hidden;padding-left:2px}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main{display:flex;overflow:hidden;text-overflow:ellipsis;white-space:pre;justify-content:space-between}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{display:flex}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.focused)>.contents>.main .monaco-icon-label{color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-widget:not(.frozen) .monaco-highlighted-label .highlight{font-weight:700}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-highlightForeground)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused>.contents>.main .monaco-highlighted-label .highlight{color:var(--vscode-editorSuggestWidget-focusHighlightForeground)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:before{color:inherit;opacity:1;font-size:14px;cursor:pointer}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close{position:absolute;top:6px;right:2px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.codicon-close:hover,.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore:hover{opacity:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{opacity:.7}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.signature-label{overflow:hidden;text-overflow:ellipsis;opacity:.6}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.qualifier-label{margin-left:12px;opacity:.4;font-size:85%;line-height:initial;text-overflow:ellipsis;overflow:hidden;align-self:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{font-size:85%;margin-left:1.1em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label>.monaco-tokenized-source{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.details-label{display:none}.monaco-editor .suggest-widget:not(.shows-details) .monaco-list .monaco-list-row.focused>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.right>.details-label,.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row.focused:not(.string-label)>.contents>.main>.right>.details-label{display:inline}.monaco-editor .suggest-widget:not(.docs-side) .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right.can-expand-details>.details-label{width:calc(100% - 26px)}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left{flex-shrink:1;flex-grow:1;overflow:hidden}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.left>.monaco-icon-label{flex-shrink:0}.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label)>.contents>.main>.left>.monaco-icon-label{max-width:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.left>.monaco-icon-label{flex-shrink:1}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right{overflow:hidden;flex-shrink:4;max-width:70%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:inline-block;position:absolute;right:10px;width:18px;height:18px;visibility:hidden}.monaco-editor .suggest-widget.docs-side .monaco-list .monaco-list-row>.contents>.main>.right>.readMore{display:none!important}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label>.contents>.main>.right>.readMore{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused.string-label>.contents>.main>.right>.readMore{display:inline-block}.monaco-editor .suggest-widget .monaco-list .monaco-list-row.focused:hover>.contents>.main>.right>.readMore{visibility:visible}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated{opacity:.66;text-decoration:unset}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label.deprecated>.monaco-icon-label-container>.monaco-icon-name-container{text-decoration:line-through}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .monaco-icon-label:before{height:100%}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon{display:block;height:16px;width:16px;margin-left:2px;background-repeat:no-repeat;background-size:80%;background-position:center}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.hide{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .suggest-icon{display:flex;align-items:center;margin-right:4px}.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .icon,.monaco-editor .suggest-widget.no-icons .monaco-list .monaco-list-row .suggest-icon:before{display:none}.monaco-editor .suggest-widget .monaco-list .monaco-list-row .icon.customcolor .colorspan{margin:0 0 0 .3em;border:.1em solid #000;width:.7em;height:.7em;display:inline-block}.monaco-editor .suggest-details-container{z-index:41}.monaco-editor .suggest-details{display:flex;flex-direction:column;cursor:default;color:var(--vscode-editorSuggestWidget-foreground)}.monaco-editor .suggest-details:focus{border-color:var(--vscode-focusBorder)}.monaco-editor .suggest-details a{color:var(--vscode-textLink-foreground)}.monaco-editor .suggest-details a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .suggest-details code{background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .suggest-details.no-docs{display:none}.monaco-editor .suggest-details>.monaco-scrollable-element{flex:1}.monaco-editor .suggest-details>.monaco-scrollable-element>.body{box-sizing:border-box;height:100%;width:100%}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type{flex:2;overflow:hidden;text-overflow:ellipsis;opacity:.7;white-space:pre;margin:0 24px 0 0;padding:4px 0 4px 5px}.monaco-editor .suggest-details.detail-and-doc>.monaco-scrollable-element>.body>.header>.type{padding-bottom:12px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.header>.type.auto-wrap{white-space:normal;word-break:break-all}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs{margin:0;padding:4px 5px;white-space:pre-wrap}.monaco-editor .suggest-details.no-type>.monaco-scrollable-element>.body>.docs{margin-right:24px;overflow:hidden}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs{padding:0;white-space:initial;min-height:calc(1rem + 8px)}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div,.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>span:not(:empty){padding:4px 5px}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:first-child{margin-top:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs>div>p:last-child{margin-bottom:0}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .monaco-tokenized-source{white-space:pre}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs .code{white-space:pre-wrap;word-wrap:break-word}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>.docs.markdown-docs .codicon{vertical-align:sub}.monaco-editor .suggest-details>.monaco-scrollable-element>.body>p:empty{display:none}.monaco-editor .suggest-details code{border-radius:3px;padding:0 .4em}.monaco-editor .suggest-details ul,.monaco-editor .suggest-details ol{padding-left:20px}.monaco-editor .suggest-details p code{font-family:var(--monaco-monospace-font)}.monaco-editor .suggest-preview-additional-widget{white-space:nowrap}.monaco-editor .suggest-preview-additional-widget .content-spacer{color:transparent;white-space:pre}.monaco-editor .suggest-preview-additional-widget .button{display:inline-block;cursor:pointer;text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-hidden{opacity:0;font-size:0}.monaco-editor .ghost-text-decoration,.monaco-editor .suggest-preview-text .ghost-text{font-style:italic}.monaco-editor .suggest-preview-text.clickable .view-line{z-index:1}.monaco-editor .ghost-text-decoration.clickable,.monaco-editor .ghost-text-decoration-preview.clickable,.monaco-editor .suggest-preview-text.clickable .ghost-text{cursor:pointer}.monaco-editor .inline-completion-text-to-replace{text-decoration:underline;text-underline-position:under}.monaco-editor .ghost-text-decoration,.monaco-editor .ghost-text-decoration-preview,.monaco-editor .suggest-preview-text .ghost-text{background-color:var(--vscode-editorGhostText-background);border:1px solid var(--vscode-editorGhostText-border)}.monaco-editor .ghost-text-decoration.syntax-highlighted,.monaco-editor .ghost-text-decoration-preview.syntax-highlighted,.monaco-editor .suggest-preview-text .ghost-text.syntax-highlighted{opacity:.7}.monaco-editor .ghost-text-decoration:not(.syntax-highlighted),.monaco-editor .ghost-text-decoration-preview:not(.syntax-highlighted),.monaco-editor .suggest-preview-text .ghost-text:not(.syntax-highlighted){color:var(--vscode-editorGhostText-foreground)}.monaco-editor .ghost-text-decoration.warning,.monaco-editor .ghost-text-decoration-preview.warning,.monaco-editor .suggest-preview-text .ghost-text.warning{background:var(--monaco-editor-warning-decoration) repeat-x bottom left;border-bottom:4px double var(--vscode-editorWarning-border)}.ghost-text-view-warning-widget-icon .codicon{color:var(--vscode-editorWarning-foreground)!important}.monaco-editor .edits-fadeout-decoration{opacity:var(--animation-opacity, 1);background-color:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .sticky-widget{overflow:hidden;border-bottom:1px solid var(--vscode-editorStickyScroll-border);width:100%;box-shadow:var(--vscode-editorStickyScroll-shadow) 0 4px 2px -2px;z-index:4;right:initial!important;margin-left:"0px"}.monaco-editor .sticky-widget .sticky-widget-line-numbers{float:left;background-color:var(--vscode-editorStickyScrollGutter-background)}.monaco-editor .sticky-widget.peek .sticky-widget-line-numbers{background-color:var(--vscode-peekViewEditorStickyScrollGutter-background)}.monaco-editor .sticky-widget .sticky-widget-lines-scrollable{display:inline-block;position:absolute;overflow:hidden;width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:var(--vscode-editorStickyScroll-background)}.monaco-editor .sticky-widget.peek .sticky-widget-lines-scrollable{background-color:var(--vscode-peekViewEditorStickyScroll-background)}.monaco-editor .sticky-widget .sticky-widget-lines{position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number,.monaco-editor .sticky-widget .sticky-line-content{color:var(--vscode-editorLineNumber-foreground);white-space:nowrap;display:inline-block;position:absolute;background-color:inherit}.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-expanded,.monaco-editor .sticky-widget .sticky-line-number .codicon-folding-collapsed{float:right;transition:var(--vscode-editorStickyScroll-foldingOpacityTransition);position:absolute;margin-left:2px}.monaco-editor .sticky-widget .sticky-line-content{width:var(--vscode-editorStickyScroll-scrollableWidth);background-color:inherit;white-space:nowrap}.monaco-editor .sticky-widget .sticky-line-number-inner{display:inline-block;text-align:right}.monaco-editor .sticky-widget .sticky-line-content:hover{background-color:var(--vscode-editorStickyScrollHover-background);cursor:pointer}.monaco-editor .inline-edits-view-indicator{display:flex;z-index:34;height:20px;color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground);background-color:var(--vscode-inlineEdit-gutterIndicator-background);border:1px solid var(--vscode-inlineEdit-gutterIndicator-primaryBorder);border-radius:3px;align-items:center;padding:2px 10px 2px 2px;margin:0 4px;opacity:0}.monaco-editor .inline-edits-view-indicator.contained{transition:opacity .2s ease-in-out;transition-delay:.4s}.monaco-editor .inline-edits-view-indicator.visible,.monaco-editor .inline-edits-view-indicator.top{opacity:1}.monaco-editor .inline-edits-view-indicator.top .icon{transform:rotate(90deg)}.monaco-editor .inline-edits-view-indicator.bottom{opacity:1}.monaco-editor .inline-edits-view-indicator.bottom .icon{transform:rotate(-90deg)}.monaco-editor .inline-edits-view-indicator .icon{display:flex;align-items:center;margin:0 2px;transform:none;transition:transform .2s ease-in-out}.monaco-editor .inline-edits-view-indicator .icon .codicon{color:var(--vscode-inlineEdit-gutterIndicator-primaryForeground)}.monaco-editor .inline-edits-view-indicator .label{margin:0 2px;display:flex;justify-content:center;width:100%}.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .view-overlays .current-line-exact,.monaco-editor .inline-edits-view .editorContainer .preview .monaco-editor .current-line-margin{border:none}.monaco-editor .inline-edits-view .editorContainer .inline-edits-view-zone.diagonal-fill{opacity:.5}.monaco-editor .strike-through{text-decoration:line-through}.monaco-editor .inlineCompletions-line-insert{background:var(--vscode-inlineEdit-modifiedChangedLineBackground)}.monaco-editor .inlineCompletions-line-delete{background:var(--vscode-inlineEdit-originalChangedLineBackground)}.monaco-editor .inlineCompletions-char-insert{background:var(--vscode-inlineEdit-modifiedChangedTextBackground);cursor:pointer}.monaco-editor .inlineCompletions-char-delete{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-inlineEdit-originalChangedTextBackground) 3px}.monaco-editor .inlineCompletions-char-insert.diff-range-empty{border-left:solid var(--vscode-inlineEdit-modifiedChangedTextBackground) 3px}.monaco-editor .inlineCompletions-char-delete.single-line-inline{border:1px solid var(--vscode-editorHoverWidget-border);margin:-2px 0 0 -2px}.monaco-editor .inlineCompletions-char-insert.single-line-inline{border-top:1px solid var(--vscode-inlineEdit-modifiedBorder);border-bottom:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-insert.single-line-inline.start{border-top-left-radius:4px;border-bottom-left-radius:4px;border-left:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-insert.single-line-inline.end{border-top-right-radius:4px;border-bottom-right-radius:4px;border-right:1px solid var(--vscode-inlineEdit-modifiedBorder)}.monaco-editor .inlineCompletions-char-delete.single-line-inline.empty,.monaco-editor .inlineCompletions-char-insert.single-line-inline.empty{display:none}.monaco-editor .inlineCompletions.strike-through{text-decoration-thickness:1px}.monaco-editor .inlineCompletions-modified-bubble{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)}.monaco-editor .inlineCompletions-original-bubble{background:var(--vscode-inlineEdit-originalChangedTextBackground)}.monaco-editor .inlineCompletions-modified-bubble,.monaco-editor .inlineCompletions-original-bubble{pointer-events:none;display:inline-block}.monaco-editor .inline-edit.ghost-text,.monaco-editor .inline-edit.ghost-text-decoration,.monaco-editor .inline-edit.ghost-text-decoration-preview,.monaco-editor .inline-edit.suggest-preview-text .ghost-text{font-style:normal!important}.monaco-editor .inline-edit.ghost-text.syntax-highlighted,.monaco-editor .inline-edit.ghost-text-decoration.syntax-highlighted,.monaco-editor .inline-edit.ghost-text-decoration-preview.syntax-highlighted,.monaco-editor .inline-edit.suggest-preview-text .ghost-text.syntax-highlighted{opacity:1!important}.monaco-editor .inline-edit.modified-background.ghost-text,.monaco-editor .inline-edit.modified-background.ghost-text-decoration,.monaco-editor .inline-edit.modified-background.ghost-text-decoration-preview,.monaco-editor .inline-edit.modified-background.suggest-preview-text .ghost-text{background:var(--vscode-inlineEdit-modifiedChangedTextBackground)!important;display:inline-block!important}.monaco-editor .inlineCompletions-original-lines{background:var(--vscode-editor-background)}.monaco-menu-option{color:var(--vscode-editorActionList-foreground);font-size:13px;padding:0 4px;line-height:28px;display:flex;gap:4px;align-items:center;border-radius:3px;cursor:pointer}.monaco-menu-option .monaco-keybinding-key{font-size:13px;opacity:.7}.monaco-menu-option.active{background:var(--vscode-editorActionList-focusBackground);color:var(--vscode-editorActionList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.monaco-menu-option.active .monaco-keybinding-key{color:var(--vscode-editorActionList-focusForeground)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor.vs .valueSetReplacement{outline:solid 2px var(--vscode-editorBracketMatch-border)}.monaco-editor .linked-editing-decoration{background-color:var(--vscode-editor-linkedEditingBackground);min-width:1px}.monaco-editor .detected-link,.monaco-editor .detected-link-active{text-decoration:underline;text-underline-position:under}.monaco-editor .detected-link-active{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .scroll-editor-on-middle-click-dot{cursor:all-scroll;position:absolute;z-index:1;background-color:var(--vscode-editor-foreground, white);border:1px solid var(--vscode-editor-background, black);opacity:.5;width:5px;height:5px;border-radius:50%;transform:translate(-50%,-50%)}.monaco-editor .scroll-editor-on-middle-click-dot.hidden{display:none}.monaco-editor.scroll-editor-on-middle-click-editor *{cursor:all-scroll}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .parameter-hints-widget{z-index:39;display:flex;flex-direction:column;line-height:1.5em;cursor:default;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.hc-black .monaco-editor .parameter-hints-widget,.hc-light .monaco-editor .parameter-hints-widget{border-width:2px}.monaco-editor .parameter-hints-widget>.phwrapper{max-width:440px;display:flex;flex-direction:row}.monaco-editor .parameter-hints-widget.multiple{min-height:3.3em;padding:0}.monaco-editor .parameter-hints-widget.multiple .body:before{content:"";display:block;height:100%;position:absolute;opacity:.5;border-left:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget p,.monaco-editor .parameter-hints-widget ul{margin:8px 0}.monaco-editor .parameter-hints-widget .monaco-scrollable-element,.monaco-editor .parameter-hints-widget .body{display:flex;flex:1;flex-direction:column;min-height:100%}.monaco-editor .parameter-hints-widget .signature{padding:4px 5px;position:relative}.monaco-editor .parameter-hints-widget .signature.has-docs:after{content:"";display:block;position:absolute;left:0;width:100%;padding-top:4px;opacity:.5;border-bottom:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .parameter-hints-widget .code{font-family:var(--vscode-parameterHintsWidget-editorFontFamily),var(--vscode-parameterHintsWidget-editorFontFamilyDefault)}.monaco-editor .parameter-hints-widget .docs{padding:0 10px 0 5px;white-space:pre-wrap}.monaco-editor .parameter-hints-widget .docs.empty{display:none}.monaco-editor .parameter-hints-widget .docs a{color:var(--vscode-textLink-foreground)}.monaco-editor .parameter-hints-widget .docs a:hover{color:var(--vscode-textLink-activeForeground);cursor:pointer}.monaco-editor .parameter-hints-widget .docs .markdown-docs{white-space:initial}.monaco-editor .parameter-hints-widget .docs code{font-family:var(--monaco-monospace-font);border-radius:3px;padding:0 .4em;background-color:var(--vscode-textCodeBlock-background)}.monaco-editor .parameter-hints-widget .docs .monaco-tokenized-source,.monaco-editor .parameter-hints-widget .docs .code{white-space:pre-wrap}.monaco-editor .parameter-hints-widget .controls{display:none;flex-direction:column;align-items:center;min-width:22px;justify-content:flex-end}.monaco-editor .parameter-hints-widget.multiple .controls{display:flex;padding:0 2px}.monaco-editor .parameter-hints-widget.multiple .button{width:16px;height:16px;background-repeat:no-repeat;cursor:pointer}.monaco-editor .parameter-hints-widget .button.previous{bottom:24px}.monaco-editor .parameter-hints-widget .overloads{text-align:center;height:12px;line-height:12px;font-family:var(--monaco-monospace-font)}.monaco-editor .parameter-hints-widget .signature .parameter.active{color:var(--vscode-editorHoverWidget-highlightForeground);font-weight:700}.monaco-editor .parameter-hints-widget .documentation-parameter>.parameter{font-weight:700;margin-right:.5em}.monaco-editor .editorPlaceholder{top:0;position:absolute;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap;pointer-events:none;color:var(--vscode-editor-placeholder-foreground)}.monaco-editor .rename-box{z-index:100;color:inherit;border-radius:4px}.monaco-editor .rename-box.preview{padding:4px 4px 0}.monaco-editor .rename-box .rename-input-with-button{padding:3px;border-radius:2px;width:calc(100% - 8px)}.monaco-editor .rename-box .rename-input{width:calc(100% - 8px);padding:0}.monaco-editor .rename-box .rename-input:focus{outline:none}.monaco-editor .rename-box .rename-suggestions-button{display:flex;align-items:center;padding:3px;background-color:transparent;border:none;border-radius:5px;cursor:pointer}.monaco-editor .rename-box .rename-suggestions-button:hover{background-color:var(--vscode-toolbar-hoverBackground)}.monaco-editor .rename-box .rename-candidate-list-container .monaco-list-row{border-radius:2px}.monaco-editor .rename-box .rename-label{display:none;opacity:.8}.monaco-editor .rename-box.preview .rename-label{display:inherit}.monaco-editor .unicode-highlight{border:1px solid var(--vscode-editorUnicodeHighlight-border);background-color:var(--vscode-editorUnicodeHighlight-background);box-sizing:border-box}.editor-banner{box-sizing:border-box;cursor:default;width:100%;font-size:12px;display:flex;overflow:visible;height:26px;background:var(--vscode-banner-background)}.editor-banner .icon-container{display:flex;flex-shrink:0;align-items:center;padding:0 6px 0 10px}.editor-banner .icon-container.custom-icon{background-repeat:no-repeat;background-position:center center;background-size:16px;width:16px;padding:0;margin:0 6px 0 10px}.editor-banner .message-container{display:flex;align-items:center;line-height:26px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.editor-banner .message-container p{margin-block-start:0;margin-block-end:0}.editor-banner .message-actions-container{flex-grow:1;flex-shrink:0;line-height:26px;margin:0 4px}.editor-banner .message-actions-container a.monaco-button{width:inherit;margin:2px 8px;padding:0 12px}.editor-banner .message-actions-container a{padding:3px;margin-left:12px;text-decoration:underline}.editor-banner .action-container{padding:0 10px 0 6px}.editor-banner{background-color:var(--vscode-banner-background)}.editor-banner,.editor-banner .action-container .codicon,.editor-banner .message-actions-container .monaco-link{color:var(--vscode-banner-foreground)}.editor-banner .icon-container .codicon{color:var(--vscode-banner-iconForeground)}.monaco-link{color:var(--vscode-textLink-foreground)}.monaco-link:hover{color:var(--vscode-textLink-activeForeground)}.floating-menu-overlay-widget{padding:0;color:var(--vscode-button-foreground);background-color:var(--vscode-button-background);border-radius:2px;border:1px solid var(--vscode-contrastBorder);display:flex;align-items:center;z-index:10;box-shadow:0 2px 8px var(--vscode-widget-shadow);overflow:hidden}.floating-menu-overlay-widget .action-item>.action-label{padding:5px;font-size:12px;border-radius:2px}.floating-menu-overlay-widget .action-item>.action-label.codicon{color:var(--vscode-button-foreground)}.floating-menu-overlay-widget .action-item>.action-label.codicon:not(.separator){padding-top:6px;padding-bottom:6px}.floating-menu-overlay-widget .action-item:first-child>.action-label{padding-left:7px}.floating-menu-overlay-widget .action-item:last-child>.action-label{padding-right:7px}.floating-menu-overlay-widget .action-item .action-label.separator{background-color:var(--vscode-menu-separatorBackground)}.monaco-editor .iPadShowKeyboard{width:58px;min-width:0;height:36px;min-height:0;margin:0;padding:0;position:absolute;resize:none;overflow:hidden;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #F6F6F6;border-radius:4px}.monaco-editor.vs-dark .iPadShowKeyboard{background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==) center center no-repeat;border:4px solid #252526}.monaco-editor .tokens-inspect-widget{z-index:50;-moz-user-select:text;user-select:text;-webkit-user-select:text;padding:10px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor.hc-black .tokens-inspect-widget,.monaco-editor.hc-light .tokens-inspect-widget{border-width:2px}.monaco-editor .tokens-inspect-widget .tokens-inspect-separator{height:1px;border:0;background-color:var(--vscode-editorHoverWidget-border)}.monaco-editor .tokens-inspect-widget .tm-token{font-family:var(--monaco-monospace-font)}.monaco-editor .tokens-inspect-widget .tm-token-length{font-weight:400;font-size:60%;float:right}.monaco-editor .tokens-inspect-widget .tm-metadata-table{width:100%}.monaco-editor .tokens-inspect-widget .tm-metadata-value{font-family:var(--monaco-monospace-font);text-align:right}.monaco-editor .tokens-inspect-widget .tm-token-type{font-family:var(--monaco-monospace-font)}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;background:#f7f6f3;color:#1f2328;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}*{box-sizing:border-box}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-5{bottom:1.25rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-1\/2{left:50%}.right-0{right:0}.right-5{right:1.25rem}.top-20{top:5rem}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.\!mt-0{margin-top:0!important}.mb-2{margin-bottom:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-8{height:2rem}.h-\[88px\]{height:88px}.h-full{height:100%}.h-screen{height:100vh}.max-h-\[140px\]{max-height:140px}.max-h-\[220px\]{max-height:220px}.max-h-\[320px\]{max-height:320px}.max-h-\[420px\]{max-height:420px}.max-h-\[560px\]{max-height:560px}.max-h-\[620px\]{max-height:620px}.max-h-\[calc\(100\%-180px\)\]{max-height:calc(100% - 180px)}.\!min-h-\[280px\]{min-height:280px!important}.\!min-h-\[34px\]{min-height:34px!important}.\!min-h-\[40px\]{min-height:40px!important}.min-h-0{min-height:0px}.min-h-\[180px\]{min-height:180px}.min-h-\[420px\]{min-height:420px}.min-h-\[520px\]{min-height:520px}.min-h-\[560px\]{min-height:560px}.min-h-\[620px\]{min-height:620px}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-8{width:2rem}.w-\[268px\]{width:268px}.w-\[360px\]{width:360px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[240px\]{min-width:240px}.min-w-\[260px\]{min-width:260px}.max-w-\[1040px\]{max-width:1040px}.max-w-\[1080px\]{max-width:1080px}.max-w-\[320px\]{max-width:320px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[460px\]{max-width:460px}.max-w-\[520px\]{max-width:520px}.max-w-\[920px\]{max-width:920px}.max-w-\[960px\]{max-width:960px}.max-w-\[980px\]{max-width:980px}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[260px_minmax\(0\,1fr\)\]{grid-template-columns:260px minmax(0,1fr)}.grid-cols-\[320px_minmax\(0\,1fr\)\]{grid-template-columns:320px minmax(0,1fr)}.grid-cols-\[360px_minmax\(0\,1fr\)\]{grid-template-columns:360px minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-3{-moz-column-gap:.75rem;column-gap:.75rem}.gap-y-1{row-gap:.25rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.\!rounded-\[18px\]{border-radius:18px!important}.rounded{border-radius:.25rem}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[14px\]{border-radius:14px}.rounded-\[16px\]{border-radius:16px}.rounded-\[18px\]{border-radius:18px}.rounded-\[20px\]{border-radius:20px}.rounded-\[22px\]{border-radius:22px}.rounded-\[24px\]{border-radius:24px}.rounded-\[28px\]{border-radius:28px}.rounded-\[32px\]{border-radius:32px}.rounded-\[36px\]{border-radius:36px}.rounded-\[38px\]{border-radius:38px}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\!border-\[\#E8E1D8\]{--tw-border-opacity: 1 !important;border-color:rgb(232 225 216 / var(--tw-border-opacity, 1))!important}.border-\[\#D9E5CB\]{--tw-border-opacity: 1;border-color:rgb(217 229 203 / var(--tw-border-opacity, 1))}.border-\[\#DCE8C8\]{--tw-border-opacity: 1;border-color:rgb(220 232 200 / var(--tw-border-opacity, 1))}.border-\[\#E5DED3\]{--tw-border-opacity: 1;border-color:rgb(229 222 211 / var(--tw-border-opacity, 1))}.border-\[\#E5E1DA\]{--tw-border-opacity: 1;border-color:rgb(229 225 218 / var(--tw-border-opacity, 1))}.border-\[\#E6E0D6\]{--tw-border-opacity: 1;border-color:rgb(230 224 214 / var(--tw-border-opacity, 1))}.border-\[\#E6E0D7\]{--tw-border-opacity: 1;border-color:rgb(230 224 215 / var(--tw-border-opacity, 1))}.border-\[\#E6E3DE\]{--tw-border-opacity: 1;border-color:rgb(230 227 222 / var(--tw-border-opacity, 1))}.border-\[\#E8E2D9\]{--tw-border-opacity: 1;border-color:rgb(232 226 217 / var(--tw-border-opacity, 1))}.border-\[\#E8E4DD\]{--tw-border-opacity: 1;border-color:rgb(232 228 221 / var(--tw-border-opacity, 1))}.border-\[\#E9D6AE\]{--tw-border-opacity: 1;border-color:rgb(233 214 174 / var(--tw-border-opacity, 1))}.border-\[\#EADBB8\]{--tw-border-opacity: 1;border-color:rgb(234 219 184 / var(--tw-border-opacity, 1))}.border-\[\#EAE4DB\]{--tw-border-opacity: 1;border-color:rgb(234 228 219 / var(--tw-border-opacity, 1))}.border-\[\#ECE7DF\]{--tw-border-opacity: 1;border-color:rgb(236 231 223 / var(--tw-border-opacity, 1))}.border-\[\#EEEAE4\]{--tw-border-opacity: 1;border-color:rgb(238 234 228 / var(--tw-border-opacity, 1))}.border-\[\#F0D7D0\]{--tw-border-opacity: 1;border-color:rgb(240 215 208 / var(--tw-border-opacity, 1))}.border-\[\#F1ECE5\]{--tw-border-opacity: 1;border-color:rgb(241 236 229 / var(--tw-border-opacity, 1))}.border-\[\#F2CCC4\]{--tw-border-opacity: 1;border-color:rgb(242 204 196 / var(--tw-border-opacity, 1))}.border-\[\#F3D3CD\]{--tw-border-opacity: 1;border-color:rgb(243 211 205 / var(--tw-border-opacity, 1))}.border-\[color\:var\(--accent-border\)\]{border-color:var(--accent-border)}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-black\/10{border-color:#0000001a}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.\!bg-\[\#FAF8F4\]{--tw-bg-opacity: 1 !important;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))!important}.\!bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))!important}.bg-\[\#18181B\]{--tw-bg-opacity: 1;background-color:rgb(24 24 27 / var(--tw-bg-opacity, 1))}.bg-\[\#1A1A1A\]{--tw-bg-opacity: 1;background-color:rgb(26 26 26 / var(--tw-bg-opacity, 1))}.bg-\[\#ECEAE6\]{--tw-bg-opacity: 1;background-color:rgb(236 234 230 / var(--tw-bg-opacity, 1))}.bg-\[\#EEF3FF\]{--tw-bg-opacity: 1;background-color:rgb(238 243 255 / var(--tw-bg-opacity, 1))}.bg-\[\#F2F1EE\]{--tw-bg-opacity: 1;background-color:rgb(242 241 238 / var(--tw-bg-opacity, 1))}.bg-\[\#F3F0EA\]{--tw-bg-opacity: 1;background-color:rgb(243 240 234 / var(--tw-bg-opacity, 1))}.bg-\[\#F5FBEE\]{--tw-bg-opacity: 1;background-color:rgb(245 251 238 / var(--tw-bg-opacity, 1))}.bg-\[\#F7EDE4\]{--tw-bg-opacity: 1;background-color:rgb(247 237 228 / var(--tw-bg-opacity, 1))}.bg-\[\#F7F2E8\]{--tw-bg-opacity: 1;background-color:rgb(247 242 232 / var(--tw-bg-opacity, 1))}.bg-\[\#FAF8F4\]{--tw-bg-opacity: 1;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))}.bg-\[\#FCFBF8\]{--tw-bg-opacity: 1;background-color:rgb(252 251 248 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF4F1\]{--tw-bg-opacity: 1;background-color:rgb(255 244 241 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF5F2\]{--tw-bg-opacity: 1;background-color:rgb(255 245 242 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF7E6\]{--tw-bg-opacity: 1;background-color:rgb(255 247 230 / var(--tw-bg-opacity, 1))}.bg-\[\#FFF8EB\]{--tw-bg-opacity: 1;background-color:rgb(255 248 235 / var(--tw-bg-opacity, 1))}.bg-\[\#FFFCF8\]{--tw-bg-opacity: 1;background-color:rgb(255 252 248 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-gray-900{--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.\!px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pr-1{padding-right:.25rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[18px\]{font-size:18px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[28px\]{font-size:28px}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-tight{line-height:1.25}.tracking-\[0\.12em\]{letter-spacing:.12em}.tracking-\[0\.14em\]{letter-spacing:.14em}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-wide{letter-spacing:.025em}.text-\[\#315A84\]{--tw-text-opacity: 1;color:rgb(49 90 132 / var(--tw-text-opacity, 1))}.text-\[\#5C7A2D\]{--tw-text-opacity: 1;color:rgb(92 122 45 / var(--tw-text-opacity, 1))}.text-\[\#8E6A3D\]{--tw-text-opacity: 1;color:rgb(142 106 61 / var(--tw-text-opacity, 1))}.text-\[\#9B4D19\]{--tw-text-opacity: 1;color:rgb(155 77 25 / var(--tw-text-opacity, 1))}.text-\[\#9B6A1C\]{--tw-text-opacity: 1;color:rgb(155 106 28 / var(--tw-text-opacity, 1))}.text-\[\#B15647\]{--tw-text-opacity: 1;color:rgb(177 86 71 / var(--tw-text-opacity, 1))}.text-\[color\:var\(--accent-text\)\]{color:var(--accent-text)}.text-\[var\(--accent\,\#2563eb\)\]{color:var(--accent,#2563eb)}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.\!no-underline{text-decoration-line:none!important}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.shadow-\[0_10px_20px_rgba\(17\,24\,39\,0\.05\)\]{--tw-shadow: 0 10px 20px rgba(17,24,39,.05);--tw-shadow-colored: 0 10px 20px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_10px_24px_rgba\(31\,28\,24\,0\.04\)\]{--tw-shadow: 0 10px 24px rgba(31,28,24,.04);--tw-shadow-colored: 0 10px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_12px_30px_rgba\(37\,99\,235\,0\.08\)\]{--tw-shadow: 0 12px 30px rgba(37,99,235,.08);--tw-shadow-colored: 0 12px 30px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_18px_36px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 18px 36px rgba(17,24,39,.16);--tw-shadow-colored: 0 18px 36px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_22px_46px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 22px 46px rgba(17,24,39,.16);--tw-shadow-colored: 0 22px 46px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_22px_54px_rgba\(17\,24\,39\,0\.06\)\]{--tw-shadow: 0 22px 54px rgba(17,24,39,.06);--tw-shadow-colored: 0 22px 54px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_24px_56px_rgba\(17\,24\,39\,0\.18\)\]{--tw-shadow: 0 24px 56px rgba(17,24,39,.18);--tw-shadow-colored: 0 24px 56px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_26px_64px_rgba\(17\,24\,39\,0\.08\)\]{--tw-shadow: 0 26px 64px rgba(17,24,39,.08);--tw-shadow-colored: 0 26px 64px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_26px_64px_rgba\(17\,24\,39\,0\.16\)\]{--tw-shadow: 0 26px 64px rgba(17,24,39,.16);--tw-shadow-colored: 0 26px 64px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_28px_70px_rgba\(15\,23\,42\,0\.08\)\]{--tw-shadow: 0 28px 70px rgba(15,23,42,.08);--tw-shadow-colored: 0 28px 70px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_30px_72px_rgba\(15\,23\,42\,0\.08\)\]{--tw-shadow: 0 30px 72px rgba(15,23,42,.08);--tw-shadow-colored: 0 30px 72px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#827a6e38;border-radius:999px}::-webkit-scrollbar-thumb:hover{background:#827a6e5c}.studio-rail{width:68px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:10px;padding:16px 10px;border-right:1px solid #e8e4dd;background:#fbfaf8}.studio-shell[data-color-mode=dark] .studio-rail{border-right-color:#223047;background:#0d1422}.studio-shell{--accent: #2563eb;--accent-rgb: 37, 99, 235;--accent-strong: #1d4ed8;--accent-text: #2555c7;--accent-gradient-start: #2563eb;--accent-gradient-end: #2563eb;--accent-soft-start: #f2f6ff;--accent-soft-end: #ebf2ff;--accent-icon-surface: #e8f0ff;--accent-border: rgba(var(--accent-rgb), .22);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .09)}.studio-shell[data-appearance=coral]{--accent: #f0483e;--accent-rgb: 240, 72, 62;--accent-strong: #df3f35;--accent-text: #f0483e;--accent-gradient-start: #f0483e;--accent-gradient-end: #f0483e;--accent-soft-start: #fff8f5;--accent-soft-end: #fff1ec;--accent-icon-surface: #ffebe4;--accent-border: rgba(var(--accent-rgb), .24);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .08)}.studio-shell[data-appearance=forest]{--accent: #2f8f6a;--accent-rgb: 47, 143, 106;--accent-strong: #227554;--accent-text: #227554;--accent-gradient-start: #2f8f6a;--accent-gradient-end: #2f8f6a;--accent-soft-start: #f4fbf7;--accent-soft-end: #eaf7f0;--accent-icon-surface: #e4f4ea;--accent-border: rgba(var(--accent-rgb), .24);--accent-shadow: rgba(var(--accent-rgb), .08);--accent-shadow-strong: rgba(var(--accent-rgb), .14);--accent-focus: rgba(var(--accent-rgb), .1)}.studio-shell[data-color-mode=dark]{color-scheme:dark;background:#0b1220;--accent-soft-start: rgba(var(--accent-rgb), .16);--accent-soft-end: rgba(var(--accent-rgb), .24);--accent-icon-surface: rgba(var(--accent-rgb), .22);--accent-border: rgba(var(--accent-rgb), .42);--accent-shadow: rgba(var(--accent-rgb), .18);--accent-shadow-strong: rgba(var(--accent-rgb), .3);--accent-focus: rgba(var(--accent-rgb), .18)}.studio-shell[data-color-mode=dark] .bg-\[\#F2F1EE\],.studio-shell[data-color-mode=dark] .bg-\[\#ECEAE6\]{background-color:#0b1220}.studio-shell[data-color-mode=dark] .bg-white,.studio-shell[data-color-mode=dark] .bg-white\/70,.studio-shell[data-color-mode=dark] .bg-white\/80,.studio-shell[data-color-mode=dark] .bg-white\/90,.studio-shell[data-color-mode=dark] .bg-white\/92,.studio-shell[data-color-mode=dark] .bg-white\/94,.studio-shell[data-color-mode=dark] .bg-white\/96{background-color:#0f172af0}.studio-shell[data-color-mode=dark] .bg-\[\#FAF8F4\],.studio-shell[data-color-mode=dark] .bg-\[\#F6F2EC\],.studio-shell[data-color-mode=dark] .bg-\[\#F3F0EA\],.studio-shell[data-color-mode=dark] .bg-\[\#ECE8E2\]{background-color:#111b2d}.studio-shell[data-color-mode=dark] .border-\[\#E6E3DE\],.studio-shell[data-color-mode=dark] .border-\[\#EEEAE4\],.studio-shell[data-color-mode=dark] .border-\[\#E5E1DA\],.studio-shell[data-color-mode=dark] .border-\[\#EAE4DB\],.studio-shell[data-color-mode=dark] .border-\[\#F1ECE5\],.studio-shell[data-color-mode=dark] .border-gray-100{border-color:#223047}.studio-shell[data-color-mode=dark] .text-gray-900,.studio-shell[data-color-mode=dark] .text-gray-800{color:#e5e7eb}.studio-shell[data-color-mode=dark] .text-gray-700,.studio-shell[data-color-mode=dark] .text-gray-600{color:#cbd5e1}.studio-shell[data-color-mode=dark] .text-gray-500,.studio-shell[data-color-mode=dark] .text-gray-400{color:#94a3b8}.studio-shell[data-color-mode=dark] .text-gray-300{color:#64748b}.studio-shell[data-color-mode=dark] .hover\:bg-\[\#FAF8F4\]:hover,.studio-shell[data-color-mode=dark] .hover\:bg-\[\#F6F2EC\]:hover,.studio-shell[data-color-mode=dark] .hover\:bg-white:hover{background-color:#162236}.studio-brand-mark{background:var(--accent);box-shadow:none}.rail-button,.drawer-icon-button,.panel-icon-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid #e7e3dc;background:#fffffff5;color:#5b6470;transition:border-color .18s ease,background .18s ease,color .18s ease}.studio-shell[data-color-mode=dark] .rail-button,.studio-shell[data-color-mode=dark] .drawer-icon-button,.studio-shell[data-color-mode=dark] .panel-icon-button{border-color:#2a3a52;background:#0f172af0;color:#cbd5e1}.rail-button{width:40px;height:40px;border-radius:14px;box-shadow:none}.rail-button:hover,.drawer-icon-button:hover,.panel-icon-button:hover{border-color:#d9d4cc;background:#f7f6f3;color:#1f2328}.studio-shell[data-color-mode=dark] .rail-button:hover,.studio-shell[data-color-mode=dark] .drawer-icon-button:hover,.studio-shell[data-color-mode=dark] .panel-icon-button:hover{border-color:#3a4c68;background:#162236;color:#f8fafc}.rail-button.active,.drawer-icon-button.active{border-color:var(--accent-border);background:linear-gradient(180deg,var(--accent-soft-start) 0%,var(--accent-soft-end) 100%);color:var(--accent);box-shadow:none}.drawer-icon-button{width:38px;height:38px;border-radius:12px;box-shadow:none}.panel-icon-button{width:30px;height:30px;border-radius:10px}.ask-ai-surface{background:#fff;border-color:#e8e4dd;border-radius:20px;box-shadow:0 18px 40px #11182714}.ask-ai-trigger{background:#fff;border-radius:16px;box-shadow:0 12px 28px #11182714!important}.studio-shell[data-color-mode=dark] .ask-ai-surface,.studio-shell[data-color-mode=dark] .ask-ai-trigger{background:#0f172a}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 16px}.panel-eyebrow{font-size:11px;line-height:1;text-transform:uppercase;letter-spacing:.16em;color:#a39a8f}.studio-shell[data-color-mode=dark] .panel-eyebrow,.studio-shell[data-color-mode=dark] .section-heading,.studio-shell[data-color-mode=dark] .field-label,.studio-shell[data-color-mode=dark] .toolbar-input-label{color:#7f90a8}.panel-title{margin-top:6px;font-size:20px;line-height:1.1;font-weight:700;color:#201f1d}.studio-shell[data-color-mode=dark] .panel-title{color:#f8fafc}.panel-block{padding:16px 18px}.section-heading,.field-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.14em;color:#a39a8f}.search-field{display:flex;align-items:center;gap:10px;min-height:40px;padding:0 12px;border:1px solid #e7e3dc;border-radius:12px;background:#fff}.studio-shell[data-color-mode=dark] .search-field{border-color:#2a3a52;background:#111b2d}.search-input{width:100%;background:transparent;border:0;outline:none;font-size:13px;color:#3c3834}.search-input::-moz-placeholder{color:#aea59a}.search-input::placeholder{color:#aea59a}.studio-shell[data-color-mode=dark] .search-input,.studio-shell[data-color-mode=dark] .studio-title-input{color:#e5e7eb}.studio-shell[data-color-mode=dark] .search-input::-moz-placeholder,.studio-shell[data-color-mode=dark] .studio-title-input::-moz-placeholder{color:#64748b}.studio-shell[data-color-mode=dark] .search-input::placeholder,.studio-shell[data-color-mode=dark] .studio-title-input::placeholder{color:#64748b}.panel-input,.panel-textarea{width:100%;border:1px solid #e7e3dc;border-radius:12px;background:#fff;color:#24211f;outline:none;transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.studio-shell[data-color-mode=dark] .panel-input,.studio-shell[data-color-mode=dark] .panel-textarea{border-color:#2a3a52;background:#0f172a;color:#e5e7eb}.panel-input{min-height:40px;padding:0 12px;font-size:13px}.panel-textarea{min-height:120px;padding:12px;font-size:12px;line-height:1.55;resize:vertical;font-family:JetBrains Mono,ui-monospace,SFMono-Regular,Menlo,monospace}.panel-input:focus,.panel-textarea:focus{border-color:rgba(var(--accent-rgb),.32);box-shadow:0 0 0 3px var(--accent-focus);background:#fffdfc}.studio-shell[data-color-mode=dark] .panel-input:focus,.studio-shell[data-color-mode=dark] .panel-textarea:focus{background:#111b2d}.solid-action,.ghost-action{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 14px;border-radius:12px;font-size:12px;font-weight:700;transition:border-color .18s ease,background .18s ease,color .18s ease}.solid-action{border:1px solid rgba(var(--accent-rgb),.16);background:var(--accent);color:#fff;box-shadow:none}.solid-action:hover{background:var(--accent-strong)}.ghost-action{border:1px solid #e7e3dc;background:#fff;color:#4f5562}.studio-shell[data-color-mode=dark] .ghost-action{border-color:#2a3a52;background:#0f172a;color:#dbe4f0}.ghost-action:hover{background:#f7f6f3;border-color:#d9d4cc}.studio-shell[data-color-mode=dark] .ghost-action:hover{background:#162236;border-color:#3a4c68}.studio-editor-header{position:relative;z-index:120;overflow:visible;min-height:0;flex-shrink:0;display:flex;align-items:stretch;flex-wrap:wrap;gap:10px;padding:16px 20px 14px;border-bottom:1px solid #e8e4dd;background:#fbfaf8f5;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.studio-shell[data-color-mode=dark] .studio-editor-header{border-bottom-color:#223047;background:#0d1422f5}.app-auth-anchor{position:fixed;top:12px;right:16px;z-index:320;display:flex;justify-content:flex-end;max-width:min(320px,calc(100vw - 20px));pointer-events:none}.app-auth-anchor>*{pointer-events:auto}.workspace-page-header,.studio-editor-header{padding-right:clamp(220px,25vw,360px)}.studio-editor-toolbar{width:100%;min-width:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}@media (max-width: 1180px){.workspace-page-header,.studio-editor-header{padding-right:clamp(170px,22vw,250px)}.studio-title-bar{order:3;flex-basis:100%}}.studio-title-bar{min-width:0;flex:1 1 420px;max-width:100%;display:flex;align-items:center;gap:8px;min-height:40px;padding:0 6px 0 12px;border:1px solid #e8e4dd;border-radius:12px;background:#fff;box-shadow:none}.studio-shell[data-color-mode=dark] .studio-title-bar{border-color:#2a3a52;background:#0f172a;box-shadow:none}.studio-title-group{min-width:0;flex:1 1 auto;display:flex;align-items:center;gap:10px}.studio-title-input{min-width:0;width:100%;background:transparent;border:0;outline:none;font-size:15px;font-weight:700;letter-spacing:-.02em;line-height:1.2;color:#1f2937}.studio-title-input::-moz-placeholder{color:#9e958a}.studio-title-input::placeholder{color:#9e958a}.studio-header-actions{display:flex;align-items:center;gap:6px;padding-left:10px;margin-left:6px;border-left:1px solid #ece8e2}.studio-shell[data-color-mode=dark] .studio-header-actions{border-left-color:#223047}.header-toolbar-action{width:30px;height:30px;border-radius:10px;padding:0;flex-shrink:0}.header-save-action,.header-export-action{border-color:transparent;background:transparent;color:#6b7280}.header-save-action{border-color:var(--accent-border);background:rgba(var(--accent-rgb),.06);color:var(--accent-text)}.header-save-action:hover,.header-export-action:hover{background:rgba(var(--accent-rgb),.1);border-color:rgba(var(--accent-rgb),.28)}.header-run-action{border-color:transparent;background:var(--accent);color:#fff}.header-run-action:hover{filter:brightness(.98)}.studio-view-switch{display:inline-flex;align-items:center;padding:4px;border:1px solid #e8e4dd;border-radius:12px;background:#fff}.studio-shell[data-color-mode=dark] .studio-view-switch{border-color:#2a3a52;background:#0f172a}.studio-view-switch-button{min-height:30px;padding:0 12px;border-radius:10px;border:0;background:transparent;font-size:12px;font-weight:700;color:#6b7280;transition:background .18s ease,color .18s ease}.studio-view-switch-button.active{background:#f3f4f6;color:#111827}.studio-shell[data-color-mode=dark] .studio-view-switch-button{color:#94a3b8}.studio-shell[data-color-mode=dark] .studio-view-switch-button.active{background:#162236;color:#f8fafc}.workflow-toolbar-actions{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px}.catalog-sidebar-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.catalog-save-action{flex-shrink:0;min-width:88px;justify-content:center}.header-help-button{width:20px;height:20px;border-radius:999px;border:0;background:transparent;color:#9ca3af}.header-help-button:hover{background:#94a3b81a;color:#6b7280}.studio-shell[data-color-mode=dark] .header-help-button,.studio-shell[data-color-mode=dark] .info-popover-button{border-color:transparent;background:transparent;color:#cbd5e1}.header-help-card{width:300px}.run-prompt-textarea{min-height:168px;background:#fbfaf8}.studio-shell[data-color-mode=dark] .run-prompt-textarea{background:#111b2d}.header-auth-chip,.header-auth-guest{display:inline-flex;align-items:center;gap:10px;min-height:48px;max-width:320px;padding:6px 8px 6px 10px;border:1px solid #e8e4dd;border-radius:16px;background:#fffffff5;box-shadow:none}.studio-shell[data-color-mode=dark] .header-auth-chip,.studio-shell[data-color-mode=dark] .header-auth-guest{border-color:#2a3a52;background:#0f172af5;box-shadow:none}.header-auth-avatar,.header-auth-avatar-image{width:32px;height:32px;flex-shrink:0;border-radius:999px}.header-auth-avatar{display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f172a,#334155);color:#f8fafc;font-size:12px;font-weight:700;letter-spacing:.08em}.header-auth-avatar-image{-o-object-fit:cover;object-fit:cover;border:1px solid rgba(148,163,184,.35)}.header-auth-copy,.header-auth-guest-copy{min-width:0;display:flex;flex-direction:column;gap:2px}.header-auth-label{font-size:13px;font-weight:700;color:#1f2937;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-auth-meta{font-size:11px;line-height:1.3;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-shell[data-color-mode=dark] .header-auth-label{color:#e2e8f0}.studio-shell[data-color-mode=dark] .header-auth-meta{color:#94a3b8}.header-auth-link,.header-auth-logout{flex-shrink:0}.chip-button{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:0 12px;border-radius:999px;border:1px solid #e3dfd8;background:#fff;color:#6d655d;font-size:11px;font-weight:700;transition:all .16s ease}.studio-shell[data-color-mode=dark] .chip-button{border-color:#2a3a52;background:#0f172a;color:#cbd5e1}.chip-button:hover{background:#fff8f2;color:#3e3a35}.studio-shell[data-color-mode=dark] .chip-button:hover{background:#162236;color:#f8fafc}.chip-button-active{border-color:var(--accent-border);background:var(--accent-soft-end);color:var(--accent-text)}.accent-inline-link{color:var(--accent-text)}.accent-inline-link:hover{color:var(--accent-strong)}.toolbar-input{transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.toolbar-input:focus{border-color:rgba(var(--accent-rgb),.35);box-shadow:0 0 0 4px var(--accent-focus);background:#fffdfc}.toolbar-input-group{display:flex;flex-direction:column;gap:6px}.toolbar-input-label{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#a39a8f}.info-popover{position:relative;display:inline-flex;z-index:140}.info-popover-button{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;border:1px solid #e7e3dc;background:#fffffff5;color:#8f98a4;transition:all .18s ease}.info-popover-button:hover,.info-popover-button.active{border-color:var(--accent-border);background:var(--accent-soft-end);color:var(--accent-text)}.info-popover-button.header-help-button{width:20px;height:20px;border:0;background:transparent;color:#9ca3af}.info-popover-button.header-help-button:hover,.info-popover-button.header-help-button.active{background:#94a3b81a;color:#6b7280}.info-popover-card{position:absolute;top:calc(100% + 10px);z-index:160;width:320px;border:1px solid #e8e4dd;border-radius:16px;background:#fffffffa;box-shadow:0 18px 40px #11182714;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);padding:14px;font-size:13px;line-height:1.55;letter-spacing:normal;text-transform:none;color:#3c3834}.studio-shell[data-color-mode=dark] .info-popover-card,.studio-shell[data-color-mode=dark] .modal-shell,.studio-shell[data-color-mode=dark] .right-drawer,.studio-shell[data-color-mode=dark] .palette-drawer{border-color:#2a3a52;background:#0a111ef5;box-shadow:0 18px 40px #0206173d;color:#dbe4f0}.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button{color:#94a3b8}.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button:hover,.studio-shell[data-color-mode=dark] .info-popover-button.header-help-button.active{background:#94a3b81f;color:#e5e7eb}.info-popover-title{font-size:13px;font-weight:700;color:#1f2937}.studio-shell[data-color-mode=dark] .info-popover-title{color:#f8fafc}.modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:80;display:flex;align-items:center;justify-content:center;padding:24px;background:#18161352;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.modal-shell{width:min(680px,100%);max-height:min(86vh,880px);display:flex;flex-direction:column;border:1px solid #e6e1d9;border-radius:28px;background:#fffffffa;box-shadow:0 32px 80px #1118272e}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:20px 22px 16px;border-bottom:1px solid #f1ece5}.studio-shell[data-color-mode=dark] .modal-header,.studio-shell[data-color-mode=dark] .modal-footer,.studio-shell[data-color-mode=dark] .palette-drawer-header,.studio-shell[data-color-mode=dark] .palette-drawer-search,.studio-shell[data-color-mode=dark] .panel-header{border-color:#223047}.modal-body{flex:1;min-height:0;overflow-y:auto;padding:20px 22px}.modal-footer{display:flex;justify-content:flex-end;gap:10px;padding:16px 22px 20px;border-top:1px solid #f1ece5}.settings-sidebar{display:flex;flex-direction:column;min-height:0;padding:28px 20px;border-right:1px solid #ece8e2;background:linear-gradient(180deg,#faf8f4f0,#f5f2edf0)}.studio-shell[data-color-mode=dark] .settings-sidebar{border-right-color:#223047;background:linear-gradient(180deg,#0a111efa,#0c1424fa)}.settings-nav-button{width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:20px;border:1px solid transparent;transition:all .18s ease;text-align:left}.settings-nav-button:hover{background:#ffffffb8;border-color:#e6e0d7}.studio-shell[data-color-mode=dark] .settings-nav-button:hover{background:#162236e6;border-color:#2a3a52}.settings-nav-button.active{border-color:var(--accent-border);background:linear-gradient(180deg,var(--accent-soft-start) 0%,var(--accent-soft-end) 100%);box-shadow:0 16px 34px var(--accent-shadow)}.settings-nav-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;background:#fff;color:var(--accent-text);box-shadow:0 10px 24px #1118270f;flex-shrink:0}.settings-mode-icon{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;border:1px solid #e5e1da;background:#fff;color:var(--accent-text)}.studio-shell[data-color-mode=dark] .settings-nav-icon,.studio-shell[data-color-mode=dark] .settings-mode-icon{border-color:#33465f;background:#111b2d;color:#dbeafe}.description-editor{min-height:168px;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;font-size:15px;line-height:1.65}.settings-section-card{border:1px solid #ede8df;border-radius:28px;background:linear-gradient(180deg,#fffffff5,#faf8f4eb);box-shadow:0 20px 44px #1118270f;padding:24px}.studio-shell[data-color-mode=dark] .settings-section-card,.studio-shell[data-color-mode=dark] .appearance-card,.studio-shell[data-color-mode=dark] .empty-card{border-color:#2a3a52;background:linear-gradient(180deg,#0f172af5,#111b2df5);box-shadow:0 18px 38px #0206173d}.settings-status-card{border:1px solid #e6e1d8;border-radius:22px;background:#fff;padding:16px 18px}.studio-shell[data-color-mode=dark] .settings-status-card{border-color:#2a3a52;background:#0f172aeb}.settings-status-card.success{border-color:#22c55e2e;background:#f0fdf4eb}.settings-status-card.error{border-color:#ef44442e;background:#fef2f2eb}.settings-status-card.testing{border-color:rgba(var(--accent-rgb),.18);background:#eff6ffeb}.settings-status-pill{display:inline-flex;align-items:center;justify-content:center;min-height:26px;padding:0 10px;border-radius:999px;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.settings-status-pill.success{background:#22c55e1f;color:#15803d}.settings-status-pill.error{background:#ef44441f;color:#dc2626}.settings-status-pill.testing{background:rgba(var(--accent-rgb),.12);color:var(--accent-text)}.appearance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.appearance-card{text-align:left;border:1px solid #e5e1da;border-radius:18px;background:#fff;padding:12px;transition:all .18s ease}.appearance-card:hover{background:#fffaf6}.studio-shell[data-color-mode=dark] .appearance-card:hover{background:#162236}.appearance-card.active{border-color:var(--accent-border);background:var(--accent-soft-end);box-shadow:0 12px 24px var(--accent-focus)}.appearance-swatches{display:flex;align-items:center;gap:6px;margin-bottom:10px}.appearance-swatch{width:18px;height:18px;border-radius:999px;border:1px solid rgba(17,24,39,.06);box-shadow:inset 0 1px #ffffffb3}.empty-card{border-radius:18px;border:1px dashed #e0dbd2;background:#faf8f4;padding:14px 16px;text-align:center;font-size:12px;color:#aaa196}.studio-shell[data-color-mode=dark] .empty-card{color:#7f90a8}.studio-canvas{background:#f7f6f3}.studio-shell[data-color-mode=dark] .studio-canvas{background:#0b1220}.canvas-overlay-stack{position:absolute;top:16px;left:16px;z-index:20;display:flex;flex-direction:column;gap:8px}.canvas-meta-card{min-width:180px;padding:10px 12px;border:1px solid #e8e4dd;border-radius:14px;background:#ffffffeb;box-shadow:0 10px 26px #1118270a;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}.canvas-meta-card-wide{min-width:240px}.canvas-meta-label{font-size:11px;color:#8a8479}.canvas-meta-value{margin-top:2px;font-size:12px;font-weight:700;color:#1f2937}.canvas-meta-select{width:100%;margin-top:4px;border:0;background:transparent;outline:none;font-size:12px;font-weight:700;color:#1f2937}.canvas-overlay-tools{position:absolute;top:16px;right:16px;z-index:20;display:flex;align-items:center;gap:8px}.studio-shell[data-color-mode=dark] .canvas-meta-card{border-color:#2a3a52;background:#0f172ae6;box-shadow:none}.studio-shell[data-color-mode=dark] .canvas-meta-label{color:#94a3b8}.studio-shell[data-color-mode=dark] .canvas-meta-value,.studio-shell[data-color-mode=dark] .canvas-meta-select{color:#e5e7eb}.right-drawer{position:absolute;top:16px;right:16px;bottom:16px;width:380px;display:flex;flex-direction:column;border:1px solid #e8e4dd;border-radius:20px;background:#fffffffa;box-shadow:0 18px 40px #11182714;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);transform:translate(calc(100% + 16px));opacity:0;pointer-events:none;transition:transform .22s ease,opacity .22s ease;z-index:28}.right-drawer.open{transform:translate(0);opacity:1;pointer-events:auto}.palette-drawer{background:#fff;border-color:#e8e4dd;border-radius:20px;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:0 18px 40px #11182714}.studio-shell[data-color-mode=dark] .palette-drawer-header,.studio-shell[data-color-mode=dark] .palette-drawer-search,.studio-shell[data-color-mode=dark] .palette-drawer-body{background:#0f172a}.palette-drawer-header{background:#fff}.palette-drawer-search{background:#fbfaf8}.palette-drawer-body{background:#fff}.execution-logs{height:264px;flex-shrink:0;border-top:1px solid #e8e4dd;background:#fffffffa;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);transition:height .2s ease}.studio-shell[data-color-mode=dark] .execution-logs{border-top-color:#223047;background:#0a111ef5}.execution-logs-popout-shell{background:#f2f1ee;width:100vw;min-width:100vw;max-width:100vw;height:100vh;min-height:100vh}.execution-logs.execution-logs-fullscreen{width:100%;min-width:0;max-width:100%;flex:1 1 auto;height:100vh;min-height:100vh;border-top:0;overflow:hidden}.execution-logs.execution-logs-fullscreen .execution-logs-header{height:64px;padding:0 20px}.execution-logs.execution-logs-fullscreen .execution-logs-header:before{display:none}.execution-logs.execution-logs-fullscreen .execution-logs-body{width:100%;min-width:0;max-width:100%;height:calc(100vh - 64px)}.execution-logs.collapsed{height:56px}.execution-logs-header{position:relative;height:56px;width:100%;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 16px;border-bottom:1px solid #efe9e1;background:transparent}.execution-logs-header:before{content:"";position:absolute;top:8px;left:50%;transform:translate(-50%);width:64px;height:5px;border-radius:999px;background:#94a3b859}.execution-logs-header-actions{display:flex;align-items:center;gap:10px}.execution-logs-collapse-action{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:1px solid #e8e4dd;border-radius:999px;background:#fff;color:#4b5563;display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 12px;transition:border-color .16s ease,background .16s ease,color .16s ease}.execution-logs-collapse-action:hover,.execution-logs-copy-action:hover{border-color:rgba(var(--accent-rgb),.28);background:#fff7f3;color:#1f2937}.studio-shell[data-color-mode=dark] .execution-logs-collapse-action{border-color:#2a3a52;background:#0f172a;color:#cbd5e1}.studio-shell[data-color-mode=dark] .execution-logs-collapse-action:hover,.studio-shell[data-color-mode=dark] .execution-logs-copy-action:hover{border-color:rgba(var(--accent-rgb),.4);background:#162236;color:#f8fafc}.execution-logs-collapse-action:focus-visible,.execution-logs-copy-action:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(var(--accent-rgb),.14)}.execution-logs-collapse-icon{transition:transform .16s ease}.execution-logs-collapse-icon.collapsed{transform:rotate(180deg)}.execution-logs-copy-action.active,.execution-logs-window-action.active{border-color:rgba(var(--accent-rgb),.28);background:#fff4f1;color:var(--accent-text)}.studio-shell[data-color-mode=dark] .execution-logs-copy-action.active,.studio-shell[data-color-mode=dark] .execution-logs-window-action.active{border-color:rgba(var(--accent-rgb),.4);background:#172235}.execution-logs-body{display:grid;grid-template-columns:280px minmax(0,1fr);gap:0;width:100%;min-width:0;height:calc(100% - 56px);min-height:0}.execution-runs-list{min-width:0;min-height:0;overflow-y:auto;border-right:1px solid #f1ece5;background:#fbfaf8;padding:14px;display:flex;flex-direction:column;gap:10px}.studio-shell[data-color-mode=dark] .execution-runs-list{border-right-color:#223047;background:#0f172a}.execution-log-stream{width:100%;min-width:0;max-width:100%;min-height:0;padding:14px;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:10px;background:#fff;overflow:hidden}.studio-shell[data-color-mode=dark] .execution-log-stream{background:#111b2d}.execution-log-list{width:100%;min-width:0;min-height:0;overflow-y:auto;overflow-x:auto;display:flex;flex-direction:column;gap:10px}.execution-run-card,.execution-log-card{width:100%;max-width:100%;text-align:left;border:1px solid #e8e4dd;border-radius:14px;background:#fff;padding:12px 14px;transition:all .16s ease}.execution-log-card{cursor:copy}.studio-shell[data-color-mode=dark] .execution-run-card,.studio-shell[data-color-mode=dark] .execution-log-card,.studio-shell[data-color-mode=dark] .workflow-node{border-color:#2a3a52;background:#0f172a;box-shadow:none}.execution-run-card:hover,.execution-log-card:hover{background:#fffaf6}.execution-run-card.active,.execution-log-card.active{border-color:#f0483e3d;background:#fff4f1}.execution-log-card.tone-pending{border-color:#2f6fec38;background:linear-gradient(180deg,#f4f8fff5,#eaf2ffeb)}.studio-shell[data-color-mode=dark] .execution-log-card.tone-pending{border-color:rgba(var(--accent-rgb),.3);background:linear-gradient(180deg,#121f36fa,#101c31fa)}.execution-log-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.execution-log-card-meta{display:flex;align-items:center;gap:8px;flex-shrink:0}.execution-log-card-copied{display:inline-flex;align-items:center;gap:4px;min-height:22px;padding:0 8px;border-radius:999px;background:rgba(var(--accent-rgb),.12);color:var(--accent-text);font-size:10px;font-weight:700;letter-spacing:.02em}.execution-log-card-preview{margin-top:8px;color:#4b5563;font-size:11px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}.studio-shell[data-color-mode=dark] .execution-log-card-preview{color:#cbd5e1}.execution-action-panel{border:1px solid #e8e4dd;border-radius:16px;background:#fff;box-shadow:none;padding:16px;display:flex;flex-direction:column;gap:14px}.studio-shell[data-color-mode=dark] .execution-action-panel{border-color:#2a3a52;background:#0f172a;box-shadow:none}.execution-action-badge{display:inline-flex;align-items:center;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid rgba(var(--accent-rgb),.18);background:var(--accent-soft-start);color:var(--accent-text);font-size:11px;font-weight:700}.execution-action-intro{display:flex;flex-direction:column;gap:12px}.execution-action-subtitle{margin-top:6px;color:#6b7280;font-size:12px;line-height:1.5}.studio-shell[data-color-mode=dark] .execution-action-subtitle{color:#94a3b8}.execution-action-meta{display:flex;flex-wrap:wrap;gap:8px}.execution-action-chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid #ece5db;background:#faf7f2;color:#5f5750;font-size:11px;font-weight:600}.studio-shell[data-color-mode=dark] .execution-action-chip{border-color:#2a3a52;background:#111b2d;color:#dbe4f0}.execution-action-block{display:flex;flex-direction:column;gap:8px}.execution-action-block-label{color:#9ca3af;font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.execution-action-field-head{display:flex;align-items:center;justify-content:space-between;gap:10px}.execution-action-requirement{display:inline-flex;align-items:center;min-height:24px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase}.execution-action-requirement.required{background:#f0483e1a;color:#b42318}.execution-action-requirement.optional{background:#3b82f61a;color:#1d4ed8}.studio-shell[data-color-mode=dark] .execution-action-requirement.required{background:#f871712e;color:#fecaca}.studio-shell[data-color-mode=dark] .execution-action-requirement.optional{background:#60a5fa2e;color:#bfdbfe}.execution-action-helper{color:#6b7280;font-size:12px;line-height:1.5}.studio-shell[data-color-mode=dark] .execution-action-helper{color:#94a3b8}.execution-action-prompt{border:1px solid #ece5db;border-radius:18px;background:#ffffffc7;color:#4b5563;font-size:13px;line-height:1.6;padding:12px 14px;white-space:pre-wrap}.studio-shell[data-color-mode=dark] .execution-action-prompt{border-color:#2a3a52;background:#0f172ac2;color:#cbd5e1}.execution-action-textarea{min-height:110px}.execution-action-footer{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}.execution-danger-action{color:#b42318;border-color:#b4231824;background:#fff7f6}.execution-danger-action:hover{background:#ffefed;border-color:#b423183d}.studio-shell[data-color-mode=dark] .execution-danger-action{color:#fca5a5;border-color:#f871712e;background:#450a0a3d}.studio-shell[data-color-mode=dark] .execution-danger-action:hover{background:#450a0a5c;border-color:#f8717147}.react-flow__node{border-radius:10px!important}.react-flow__handle{width:10px;height:10px;border:2px solid #fff;border-radius:999px}.react-flow__handle-left{left:-5px}.react-flow__handle-right{right:-5px}.react-flow__edge-path{stroke-width:2.5px;stroke-linecap:round;stroke-linejoin:round}.react-flow__edge{z-index:4!important}.react-flow__attribution{display:none}.react-flow__controls{background:transparent!important;border:0!important;box-shadow:none!important;display:flex!important;flex-direction:row!important;gap:8px!important;margin:16px!important}.react-flow__controls-button{width:40px!important;height:40px!important;border:1px solid #e7e3dc!important;border-radius:12px!important;background:#fffffff5!important;color:#5b6470!important;fill:currentColor!important;box-shadow:none!important;border-bottom:1px solid #e7e3dc!important}.studio-shell[data-color-mode=dark] .react-flow__controls-button{border-color:#2a3a52!important;border-bottom-color:#2a3a52!important;background:#0f172af5!important;color:#dbe4f0!important;box-shadow:none!important}.react-flow__controls-button:hover{background:#f7f6f3!important;color:#1f2328!important}.studio-shell[data-color-mode=dark] .react-flow__controls-button:hover{background:#162236!important;color:#f8fafc!important}.react-flow__minimap{border:1px solid #e7e3dc!important;border-radius:16px!important;overflow:hidden!important;box-shadow:none!important;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px)}.react-flow__minimap svg{background:transparent!important}.react-flow__minimap-mask{fill:#ffffffb3!important}.studio-shell[data-color-mode=dark] .react-flow__minimap{border-color:#2a3a52!important;box-shadow:none!important}.studio-shell[data-color-mode=dark] .react-flow__minimap-mask{fill:#0b1220b8!important}.workflow-node{background:#fff;border:1px solid #e3dfd8;border-radius:14px;box-shadow:0 8px 22px #1118270a;transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease;overflow:hidden;min-width:200px}.studio-shell[data-color-mode=dark] .workflow-node{background:#0f172a}.workflow-node-icon{width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.workflow-node-title{min-width:0;font-size:13px;font-weight:700;line-height:1.2;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.studio-shell[data-color-mode=dark] .workflow-node-title{color:#e5e7eb}.workflow-node-subtitle{min-width:0;margin-top:2px;font-size:11px;line-height:1.3;color:#9ca3af;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.workflow-node-status-dot{width:9px;height:9px;border-radius:999px;flex-shrink:0;background:#94a3b8;box-shadow:0 0 0 2px #94a3b81f}.workflow-node-status-dot.active{background:#2563eb;box-shadow:0 0 0 2px #3b82f624}.workflow-node-status-dot.waiting{background:#d97706;box-shadow:0 0 0 2px #f59e0b29}.workflow-node-status-dot.completed{background:#16a34a;box-shadow:0 0 0 2px #22c55e24}.workflow-node-status-dot.failed{background:#dc2626;box-shadow:0 0 0 2px #ef444424}.workflow-node.compact{border-radius:14px;box-shadow:0 6px 16px #1118270a}.workflow-node.compact:hover{transform:none;box-shadow:0 8px 18px #1118270f}.workflow-node-compact,.workflow-node-micro{display:flex;align-items:center;gap:10px;min-height:54px;padding:10px 12px}.workflow-node-compact-meta,.workflow-node-micro-meta{min-width:0;flex:1}.workflow-node.micro{border-radius:14px;box-shadow:0 4px 12px #1118270a}.workflow-node.micro:hover{transform:none;box-shadow:0 6px 14px #1118270d}.workflow-node-micro{min-height:42px;padding:8px 10px;gap:8px}.workflow-node-icon-micro{width:24px;height:24px;border-radius:8px}.workflow-node.micro .workflow-node-title{font-size:11px}.workflow-node.micro .react-flow__handle{width:8px;height:8px}.workflow-node.compact .react-flow__handle{width:9px;height:9px}.workflow-node:hover{border-color:#d2cdc4;box-shadow:0 10px 24px #1118270f;transform:none}.workflow-node.selected{border-color:rgba(var(--accent-rgb),.3);box-shadow:0 0 0 3px var(--accent-focus),0 10px 24px #1118270f}.workflow-node.execution-focus{border-color:#4f6ef75c;box-shadow:0 0 0 3px #4f6ef714,0 10px 24px #4f6ef714}.workflow-node.node-status-active{border-color:#3b82f657}.workflow-node.node-status-waiting{border-color:#f59e0b57}.workflow-node.node-status-completed{border-color:#22c55e57}.workflow-node.node-status-failed{border-color:#ef444457}.node-run-pill{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase}.node-run-pill.active{background:#3b82f61a;color:#2563eb}.node-run-pill.waiting{background:#f59e0b1f;color:#b45309}.node-run-pill.completed{background:#22c55e1f;color:#15803d}.node-run-pill.failed{background:#ef44441f;color:#dc2626}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:-translate-y-0\.5:hover{--tw-translate-y: -.125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-\[\#F9F6F0\]:hover{--tw-bg-opacity: 1;background-color:rgb(249 246 240 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FAF8F4\]:hover{--tw-bg-opacity: 1;background-color:rgb(250 248 244 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FBFAF7\]:hover{--tw-bg-opacity: 1;background-color:rgb(251 250 247 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF0EB\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 240 235 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF4DE\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 244 222 / var(--tw-bg-opacity, 1))}.hover\:bg-\[\#FFF9F4\]:hover{--tw-bg-opacity: 1;background-color:rgb(255 249 244 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:block{display:block}.sm\:p-5{padding:1.25rem}}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[minmax\(0\,1\.1fr\)_320px\]{grid-template-columns:minmax(0,1.1fr) 320px}.md\:p-7{padding:1.75rem}.md\:p-8{padding:2rem}}@media (min-width: 1024px){.lg\:grid-cols-\[minmax\(0\,1fr\)_auto_auto\]{grid-template-columns:minmax(0,1fr) auto auto}.lg\:items-end{align-items:flex-end}}@media (min-width: 1280px){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-\[240px_minmax\(0\,1fr\)\]{grid-template-columns:240px minmax(0,1fr)}.xl\:grid-cols-\[320px_minmax\(0\,1fr\)\]{grid-template-columns:320px minmax(0,1fr)}} diff --git a/tools/Aevatar.Tools.Cli/wwwroot/playground/app.js b/tools/Aevatar.Tools.Cli/wwwroot/playground/app.js index 7a4f9d434..d6cf5a829 100644 --- a/tools/Aevatar.Tools.Cli/wwwroot/playground/app.js +++ b/tools/Aevatar.Tools.Cli/wwwroot/playground/app.js @@ -1,4 +1,4 @@ -var Jye=Object.defineProperty;var eSe=(n,e,t)=>e in n?Jye(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Vn=(n,e,t)=>eSe(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();function Fce(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bce={exports:{}},JF={},Wce={exports:{}},yi={};/** +var Yye=Object.defineProperty;var Zye=(n,e,t)=>e in n?Yye(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Wn=(n,e,t)=>Zye(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();function Ace(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pce={exports:{}},JF={},Oce={exports:{}},Ci={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var Jye=Object.defineProperty;var eSe=(n,e,t)=>e in n?Jye(n,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $N=Symbol.for("react.element"),tSe=Symbol.for("react.portal"),iSe=Symbol.for("react.fragment"),nSe=Symbol.for("react.strict_mode"),sSe=Symbol.for("react.profiler"),oSe=Symbol.for("react.provider"),rSe=Symbol.for("react.context"),aSe=Symbol.for("react.forward_ref"),lSe=Symbol.for("react.suspense"),cSe=Symbol.for("react.memo"),dSe=Symbol.for("react.lazy"),cJ=Symbol.iterator;function hSe(n){return n===null||typeof n!="object"?null:(n=cJ&&n[cJ]||n["@@iterator"],typeof n=="function"?n:null)}var Hce={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vce=Object.assign,zce={};function jS(n,e,t){this.props=n,this.context=e,this.refs=zce,this.updater=t||Hce}jS.prototype.isReactComponent={};jS.prototype.setState=function(n,e){if(typeof n!="object"&&typeof n!="function"&&n!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,n,e,"setState")};jS.prototype.forceUpdate=function(n){this.updater.enqueueForceUpdate(this,n,"forceUpdate")};function jce(){}jce.prototype=jS.prototype;function aK(n,e,t){this.props=n,this.context=e,this.refs=zce,this.updater=t||Hce}var lK=aK.prototype=new jce;lK.constructor=aK;Vce(lK,jS.prototype);lK.isPureReactComponent=!0;var dJ=Array.isArray,$ce=Object.prototype.hasOwnProperty,cK={current:null},Uce={key:!0,ref:!0,__self:!0,__source:!0};function qce(n,e,t){var i,s={},o=null,r=null;if(e!=null)for(i in e.ref!==void 0&&(r=e.ref),e.key!==void 0&&(o=""+e.key),e)$ce.call(e,i)&&!Uce.hasOwnProperty(i)&&(s[i]=e[i]);var a=arguments.length-2;if(a===1)s.children=t;else if(1e in n?Jye(n,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var mSe=$,_Se=Symbol.for("react.element"),bSe=Symbol.for("react.fragment"),vSe=Object.prototype.hasOwnProperty,wSe=mSe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,CSe={key:!0,ref:!0,__self:!0,__source:!0};function Gce(n,e,t){var i,s={},o=null,r=null;t!==void 0&&(o=""+t),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(r=e.ref);for(i in e)vSe.call(e,i)&&!CSe.hasOwnProperty(i)&&(s[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:_Se,type:n,key:o,ref:r,props:s,_owner:wSe.current}}JF.Fragment=bSe;JF.jsx=Gce;JF.jsxs=Gce;Bce.exports=JF;var y=Bce.exports,H6={},Yce={exports:{}},dc={},Zce={exports:{}},Xce={};/** + */var uSe=$,fSe=Symbol.for("react.element"),gSe=Symbol.for("react.fragment"),pSe=Object.prototype.hasOwnProperty,mSe=uSe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_Se={key:!0,ref:!0,__self:!0,__source:!0};function Uce(n,e,t){var i,s={},o=null,r=null;t!==void 0&&(o=""+t),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(r=e.ref);for(i in e)pSe.call(e,i)&&!_Se.hasOwnProperty(i)&&(s[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:fSe,type:n,key:o,ref:r,props:s,_owner:mSe.current}}JF.Fragment=gSe;JF.jsx=Uce;JF.jsxs=Uce;Pce.exports=JF;var y=Pce.exports,W6={},qce={exports:{}},rc={},Kce={exports:{}},Gce={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var Jye=Object.defineProperty;var eSe=(n,e,t)=>e in n?Jye(n,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(n){function e(z,j){var Q=z.length;z.push(j);e:for(;0>>1,te=z[Y];if(0>>1;Ys(xe,Q))jes(ke,xe)?(z[Y]=ke,z[je]=Q,Y=je):(z[Y]=xe,z[Ce]=Q,Y=Ce);else if(jes(ke,Q))z[Y]=ke,z[je]=Q,Y=je;else break e}}return j}function s(z,j){var Q=z.sortIndex-j.sortIndex;return Q!==0?Q:z.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var r=Date,a=r.now();n.unstable_now=function(){return r.now()-a}}var l=[],c=[],d=1,h=null,u=3,f=!1,g=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var j=t(c);j!==null;){if(j.callback===null)i(c);else if(j.startTime<=z)i(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(c)}}function C(z){if(p=!1,w(z),!g)if(t(l)!==null)g=!0,V(S);else{var j=t(c);j!==null&&K(C,j.startTime-z)}}function S(z,j){g=!1,p&&(p=!1,b(E),E=-1),f=!0;var Q=u;try{for(w(j),h=t(l);h!==null&&(!(h.expirationTime>j)||z&&!M());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,u=h.priorityLevel;var te=Y(h.expirationTime<=j);j=n.unstable_now(),typeof te=="function"?h.callback=te:h===t(l)&&i(l),w(j)}else i(l);h=t(l)}if(h!==null)var ce=!0;else{var Ce=t(c);Ce!==null&&K(C,Ce.startTime-j),ce=!1}return ce}finally{h=null,u=Q,f=!1}}var L=!1,x=null,E=-1,I=5,R=-1;function M(){return!(n.unstable_now()-Rz||125Y?(z.sortIndex=Q,e(c,z),t(l)===null&&z===t(c)&&(p?(b(E),E=-1):p=!0,K(C,Q-Y))):(z.sortIndex=te,e(l,z),g||f||(g=!0,V(S))),z},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(z){var j=u;return function(){var Q=u;u=j;try{return z.apply(this,arguments)}finally{u=Q}}}})(Xce);Zce.exports=Xce;var ySe=Zce.exports;/** + */(function(n){function e(z,j){var X=z.length;z.push(j);e:for(;0>>1,te=z[Y];if(0>>1;Ys(xe,X))Bes(Ee,xe)?(z[Y]=Ee,z[Be]=X,Y=Be):(z[Y]=xe,z[Ce]=X,Y=Ce);else if(Bes(Ee,X))z[Y]=Ee,z[Be]=X,Y=Be;else break e}}return j}function s(z,j){var X=z.sortIndex-j.sortIndex;return X!==0?X:z.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var r=Date,a=r.now();n.unstable_now=function(){return r.now()-a}}var l=[],c=[],d=1,h=null,u=3,f=!1,g=!1,p=!1,m=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(z){for(var j=t(c);j!==null;){if(j.callback===null)i(c);else if(j.startTime<=z)i(c),j.sortIndex=j.expirationTime,e(l,j);else break;j=t(c)}}function C(z){if(p=!1,w(z),!g)if(t(l)!==null)g=!0,V(S);else{var j=t(c);j!==null&&K(C,j.startTime-z)}}function S(z,j){g=!1,p&&(p=!1,b(I),I=-1),f=!0;var X=u;try{for(w(j),h=t(l);h!==null&&(!(h.expirationTime>j)||z&&!M());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,u=h.priorityLevel;var te=Y(h.expirationTime<=j);j=n.unstable_now(),typeof te=="function"?h.callback=te:h===t(l)&&i(l),w(j)}else i(l);h=t(l)}if(h!==null)var ce=!0;else{var Ce=t(c);Ce!==null&&K(C,Ce.startTime-j),ce=!1}return ce}finally{h=null,u=X,f=!1}}var L=!1,x=null,I=-1,E=5,R=-1;function M(){return!(n.unstable_now()-Rz||125Y?(z.sortIndex=X,e(c,z),t(l)===null&&z===t(c)&&(p?(b(I),I=-1):p=!0,K(C,X-Y))):(z.sortIndex=te,e(l,z),g||f||(g=!0,V(S))),z},n.unstable_shouldYield=M,n.unstable_wrapCallback=function(z){var j=u;return function(){var X=u;u=j;try{return z.apply(this,arguments)}finally{u=X}}}})(Gce);Kce.exports=Gce;var bSe=Kce.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var Jye=Object.defineProperty;var eSe=(n,e,t)=>e in n?Jye(n,e,{enumerable:!0,con * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var SSe=$,ec=ySe;function $e(n){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+n,t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V6=Object.prototype.hasOwnProperty,xSe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,uJ={},fJ={};function LSe(n){return V6.call(fJ,n)?!0:V6.call(uJ,n)?!1:xSe.test(n)?fJ[n]=!0:(uJ[n]=!0,!1)}function kSe(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function ESe(n,e,t,i){if(e===null||typeof e>"u"||kSe(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Ia(n,e,t,i,s,o,r){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=r}var pr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){pr[n]=new Ia(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];pr[e]=new Ia(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){pr[n]=new Ia(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){pr[n]=new Ia(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){pr[n]=new Ia(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){pr[n]=new Ia(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){pr[n]=new Ia(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){pr[n]=new Ia(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){pr[n]=new Ia(n,5,!1,n.toLowerCase(),null,!1,!1)});var hK=/[\-:]([a-z])/g;function uK(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(hK,uK);pr[e]=new Ia(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){pr[n]=new Ia(n,1,!1,n.toLowerCase(),null,!1,!1)});pr.xlinkHref=new Ia("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){pr[n]=new Ia(n,1,!1,n.toLowerCase(),null,!0,!0)});function fK(n,e,t,i){var s=pr.hasOwnProperty(e)?pr[e]:null;(s!==null?s.type!==0:i||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H6=Object.prototype.hasOwnProperty,wSe=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hJ={},uJ={};function CSe(n){return H6.call(uJ,n)?!0:H6.call(hJ,n)?!1:wSe.test(n)?uJ[n]=!0:(hJ[n]=!0,!1)}function ySe(n,e,t,i){if(t!==null&&t.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return i?!1:t!==null?!t.acceptsBooleans:(n=n.toLowerCase().slice(0,5),n!=="data-"&&n!=="aria-");default:return!1}}function SSe(n,e,t,i){if(e===null||typeof e>"u"||ySe(n,e,t,i))return!0;if(i)return!1;if(t!==null)switch(t.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Na(n,e,t,i,s,o,r){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=t,this.propertyName=n,this.type=e,this.sanitizeURL=o,this.removeEmptyString=r}var _r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(n){_r[n]=new Na(n,0,!1,n,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(n){var e=n[0];_r[e]=new Na(e,1,!1,n[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(n){_r[n]=new Na(n,2,!1,n.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(n){_r[n]=new Na(n,2,!1,n,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(n){_r[n]=new Na(n,3,!1,n.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(n){_r[n]=new Na(n,3,!0,n,null,!1,!1)});["capture","download"].forEach(function(n){_r[n]=new Na(n,4,!1,n,null,!1,!1)});["cols","rows","size","span"].forEach(function(n){_r[n]=new Na(n,6,!1,n,null,!1,!1)});["rowSpan","start"].forEach(function(n){_r[n]=new Na(n,5,!1,n.toLowerCase(),null,!1,!1)});var dK=/[\-:]([a-z])/g;function hK(n){return n[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(n){var e=n.replace(dK,hK);_r[e]=new Na(e,1,!1,n,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(n){_r[n]=new Na(n,1,!1,n.toLowerCase(),null,!1,!1)});_r.xlinkHref=new Na("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(n){_r[n]=new Na(n,1,!1,n.toLowerCase(),null,!0,!0)});function uK(n,e,t,i){var s=_r.hasOwnProperty(e)?_r[e]:null;(s!==null?s.type!==0:i||!(2a||s[r]!==o[a]){var l=` -`+s[r].replace(" at new "," at ");return n.displayName&&l.includes("")&&(l=l.replace("",n.displayName)),l}while(1<=r&&0<=a);break}}}finally{L8=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?vL(n):""}function ISe(n){switch(n.tag){case 5:return vL(n.type);case 16:return vL("Lazy");case 13:return vL("Suspense");case 19:return vL("SuspenseList");case 0:case 2:case 15:return n=k8(n.type,!1),n;case 11:return n=k8(n.type.render,!1),n;case 1:return n=k8(n.type,!0),n;default:return""}}function U6(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case UC:return"Fragment";case $C:return"Portal";case z6:return"Profiler";case gK:return"StrictMode";case j6:return"Suspense";case $6:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case ede:return(n.displayName||"Context")+".Consumer";case Jce:return(n._context.displayName||"Context")+".Provider";case pK:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case mK:return e=n.displayName||null,e!==null?e:U6(n.type)||"Memo";case Cp:e=n._payload,n=n._init;try{return U6(n(e))}catch{}}return null}function NSe(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U6(e);case 8:return e===gK?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Zm(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ide(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function DSe(n){var e=ide(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(r){i=""+r,o.call(this,r)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(r){i=""+r},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function iT(n){n._valueTracker||(n._valueTracker=DSe(n))}function nde(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=ide(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function hM(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function q6(n,e){var t=e.checked;return Ss({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function pJ(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Zm(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function sde(n,e){e=e.checked,e!=null&&fK(n,"checked",e,!1)}function K6(n,e){sde(n,e);var t=Zm(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?G6(n,e.type,t):e.hasOwnProperty("defaultValue")&&G6(n,e.type,Zm(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function mJ(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function G6(n,e,t){(e!=="number"||hM(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var wL=Array.isArray;function U0(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=nT.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xE(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var YL={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},TSe=["Webkit","ms","Moz","O"];Object.keys(YL).forEach(function(n){TSe.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),YL[e]=YL[n]})});function lde(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||YL.hasOwnProperty(n)&&YL[n]?(""+e).trim():e+"px"}function cde(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=lde(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var RSe=Ss({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function X6(n,e){if(e){if(RSe[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error($e(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error($e(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error($e(61))}if(e.style!=null&&typeof e.style!="object")throw Error($e(62))}}function Q6(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var J6=null;function _K(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var eB=null,q0=null,K0=null;function vJ(n){if(n=KN(n)){if(typeof eB!="function")throw Error($e(280));var e=n.stateNode;e&&(e=s5(e),eB(n.stateNode,n.type,e))}}function dde(n){q0?K0?K0.push(n):K0=[n]:q0=n}function hde(){if(q0){var n=q0,e=K0;if(K0=q0=null,vJ(n),e)for(n=0;n>>=0,n===0?32:31-(jSe(n)/$Se|0)|0}var sT=64,oT=4194304;function CL(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function pM(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,o=n.pingedLanes,r=t&268435455;if(r!==0){var a=r&~s;a!==0?i=CL(a):(o&=r,o!==0&&(i=CL(o)))}else r=t&~s,r!==0?i=CL(r):o!==0&&(i=CL(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function UN(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-Vd(e),n[e]=t}function GSe(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=XL),IJ=" ",NJ=!1;function Tde(n,e){switch(n){case"keyup":return yxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rde(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var qC=!1;function xxe(n,e){switch(n){case"compositionend":return Rde(e);case"keypress":return e.which!==32?null:(NJ=!0,IJ);case"textInput":return n=e.data,n===IJ&&NJ?null:n;default:return null}}function Lxe(n,e){if(qC)return n==="compositionend"||!LK&&Tde(n,e)?(n=Nde(),rR=yK=Up=null,qC=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=MJ(t)}}function Ode(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Ode(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Fde(){for(var n=window,e=hM();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=hM(n.document)}return e}function kK(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Axe(n){var e=Fde(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Ode(t.ownerDocument.documentElement,t)){if(i!==null&&kK(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(i.start,s);i=i.end===void 0?o:Math.min(i.end,s),!n.extend&&o>i&&(s=i,i=o,o=s),s=AJ(t,o);var r=AJ(t,i);s&&r&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==r.node||n.focusOffset!==r.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(r.node,r.offset)):(e.setEnd(r.node,r.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,KC=null,rB=null,JL=null,aB=!1;function PJ(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;aB||KC==null||KC!==hM(i)||(i=KC,"selectionStart"in i&&kK(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),JL&&DE(JL,i)||(JL=i,i=bM(rB,"onSelect"),0ZC||(n.current=fB[ZC],fB[ZC]=null,ZC--)}function $n(n,e){ZC++,fB[ZC]=n.current,n.current=e}var Xm={},zr=m_(Xm),il=m_(!1),B1=Xm;function jy(n,e){var t=n.type.contextTypes;if(!t)return Xm;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function nl(n){return n=n.childContextTypes,n!=null}function wM(){Zn(il),Zn(zr)}function zJ(n,e,t){if(zr.current!==Xm)throw Error($e(168));$n(zr,e),$n(il,t)}function qde(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error($e(108,NSe(n)||"Unknown",s));return Ss({},t,i)}function CM(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Xm,B1=zr.current,$n(zr,n),$n(il,il.current),!0}function jJ(n,e,t){var i=n.stateNode;if(!i)throw Error($e(169));t?(n=qde(n,e,B1),i.__reactInternalMemoizedMergedChildContext=n,Zn(il),Zn(zr),$n(zr,n)):Zn(il),$n(il,t)}var Sf=null,o5=!1,H8=!1;function Kde(n){Sf===null?Sf=[n]:Sf.push(n)}function qxe(n){o5=!0,Kde(n)}function __(){if(!H8&&Sf!==null){H8=!0;var n=0,e=bn;try{var t=Sf;for(bn=1;n>=r,s-=r,Of=1<<32-Vd(e)+s|t<E?(I=x,x=null):I=x.sibling;var R=u(b,x,w[E],C);if(R===null){x===null&&(x=I);break}n&&x&&R.alternate===null&&e(b,x),v=o(R,v,E),L===null?S=R:L.sibling=R,L=R,x=I}if(E===w.length)return t(b,x),es&&rb(b,E),S;if(x===null){for(;EE?(I=x,x=null):I=x.sibling;var M=u(b,x,R.value,C);if(M===null){x===null&&(x=I);break}n&&x&&M.alternate===null&&e(b,x),v=o(M,v,E),L===null?S=M:L.sibling=M,L=M,x=I}if(R.done)return t(b,x),es&&rb(b,E),S;if(x===null){for(;!R.done;E++,R=w.next())R=h(b,R.value,C),R!==null&&(v=o(R,v,E),L===null?S=R:L.sibling=R,L=R);return es&&rb(b,E),S}for(x=i(b,x);!R.done;E++,R=w.next())R=f(x,b,E,R.value,C),R!==null&&(n&&R.alternate!==null&&x.delete(R.key===null?E:R.key),v=o(R,v,E),L===null?S=R:L.sibling=R,L=R);return n&&x.forEach(function(A){return e(b,A)}),es&&rb(b,E),S}function m(b,v,w,C){if(typeof w=="object"&&w!==null&&w.type===UC&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case tT:e:{for(var S=w.key,L=v;L!==null;){if(L.key===S){if(S=w.type,S===UC){if(L.tag===7){t(b,L.sibling),v=s(L,w.props.children),v.return=b,b=v;break e}}else if(L.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Cp&&qJ(S)===L.type){t(b,L.sibling),v=s(L,w.props),v.ref=Mx(b,L,w),v.return=b,b=v;break e}t(b,L);break}else e(b,L);L=L.sibling}w.type===UC?(v=yv(w.props.children,b.mode,C,w.key),v.return=b,b=v):(C=gR(w.type,w.key,w.props,null,b.mode,C),C.ref=Mx(b,v,w),C.return=b,b=C)}return r(b);case $C:e:{for(L=w.key;v!==null;){if(v.key===L)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){t(b,v.sibling),v=s(v,w.children||[]),v.return=b,b=v;break e}else{t(b,v);break}else e(b,v);v=v.sibling}v=G8(w,b.mode,C),v.return=b,b=v}return r(b);case Cp:return L=w._init,m(b,v,L(w._payload),C)}if(wL(w))return g(b,v,w,C);if(Ix(w))return p(b,v,w,C);uT(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(t(b,v.sibling),v=s(v,w),v.return=b,b=v):(t(b,v),v=K8(w,b.mode,C),v.return=b,b=v),r(b)):t(b,v)}return m}var Uy=Xde(!0),Qde=Xde(!1),xM=m_(null),LM=null,JC=null,DK=null;function TK(){DK=JC=LM=null}function RK(n){var e=xM.current;Zn(xM),n._currentValue=e}function mB(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function Y0(n,e){LM=n,DK=JC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Xa=!0),n.firstContext=null)}function Uc(n){var e=n._currentValue;if(DK!==n)if(n={context:n,memoizedValue:e,next:null},JC===null){if(LM===null)throw Error($e(308));JC=n,LM.dependencies={lanes:0,firstContext:n}}else JC=JC.next=n;return e}var Jb=null;function MK(n){Jb===null?Jb=[n]:Jb.push(n)}function Jde(n,e,t,i){var s=e.interleaved;return s===null?(t.next=t,MK(e)):(t.next=s.next,s.next=t),e.interleaved=t,pg(n,i)}function pg(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var yp=!1;function AK(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ehe(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function tg(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function mm(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,ji&2){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,pg(n,t)}return s=i.interleaved,s===null?(e.next=e,MK(i)):(e.next=s.next,s.next=e),i.interleaved=e,pg(n,t)}function lR(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vK(n,t)}}function KJ(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var s=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var r={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?s=o=r:o=o.next=r,t=t.next}while(t!==null);o===null?s=o=e:o=o.next=e}else s=o=e;t={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function kM(n,e,t,i){var s=n.updateQueue;yp=!1;var o=s.firstBaseUpdate,r=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,r===null?o=c:r.next=c,r=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==r&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var h=s.baseState;r=0,d=c=l=null,a=o;do{var u=a.lane,f=a.eventTime;if((i&u)===u){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(u=e,f=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(f,h,u);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,u=typeof g=="function"?g.call(f,h,u):g,u==null)break e;h=Ss({},h,u);break e;case 2:yp=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else f={eventTime:f,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=f,l=h):d=d.next=f,r|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do r|=s.lane,s=s.next;while(s!==e)}else o===null&&(s.shared.lanes=0);V1|=r,n.lanes=r,n.memoizedState=h}}function GJ(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=z8.transition;z8.transition={};try{n(!1),e()}finally{bn=t,z8.transition=i}}function _he(){return qc().memoizedState}function Zxe(n,e,t){var i=bm(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},bhe(n))vhe(e,t);else if(t=Jde(n,e,t,i),t!==null){var s=ga();zd(t,n,i,s),whe(t,e,i)}}function Xxe(n,e,t){var i=bm(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(bhe(n))vhe(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var r=e.lastRenderedState,a=o(r,t);if(s.hasEagerState=!0,s.eagerState=a,Gd(a,r)){var l=e.interleaved;l===null?(s.next=s,MK(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=Jde(n,e,s,i),t!==null&&(s=ga(),zd(t,n,i,s),whe(t,e,i))}}function bhe(n){var e=n.alternate;return n===vs||e!==null&&e===vs}function vhe(n,e){ek=IM=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function whe(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,vK(n,t)}}var NM={readContext:Uc,useCallback:Nr,useContext:Nr,useEffect:Nr,useImperativeHandle:Nr,useInsertionEffect:Nr,useLayoutEffect:Nr,useMemo:Nr,useReducer:Nr,useRef:Nr,useState:Nr,useDebugValue:Nr,useDeferredValue:Nr,useTransition:Nr,useMutableSource:Nr,useSyncExternalStore:Nr,useId:Nr,unstable_isNewReconciler:!1},Qxe={readContext:Uc,useCallback:function(n,e){return Th().memoizedState=[n,e===void 0?null:e],n},useContext:Uc,useEffect:ZJ,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,dR(4194308,4,uhe.bind(null,e,n),t)},useLayoutEffect:function(n,e){return dR(4194308,4,n,e)},useInsertionEffect:function(n,e){return dR(4,2,n,e)},useMemo:function(n,e){var t=Th();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Th();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=Zxe.bind(null,vs,n),[i.memoizedState,n]},useRef:function(n){var e=Th();return n={current:n},e.memoizedState=n},useState:YJ,useDebugValue:zK,useDeferredValue:function(n){return Th().memoizedState=n},useTransition:function(){var n=YJ(!1),e=n[0];return n=Yxe.bind(null,n[1]),Th().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=vs,s=Th();if(es){if(t===void 0)throw Error($e(407));t=t()}else{if(t=e(),Ko===null)throw Error($e(349));H1&30||she(i,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,ZJ(rhe.bind(null,i,o,n),[n]),i.flags|=2048,BE(9,ohe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Th(),e=Ko.identifierPrefix;if(es){var t=Ff,i=Of;t=(i&~(1<<32-Vd(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=OE++,0")&&(l=l.replace("",n.displayName)),l}while(1<=r&&0<=a);break}}}finally{L8=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?vL(n):""}function xSe(n){switch(n.tag){case 5:return vL(n.type);case 16:return vL("Lazy");case 13:return vL("Suspense");case 19:return vL("SuspenseList");case 0:case 2:case 15:return n=k8(n.type,!1),n;case 11:return n=k8(n.type.render,!1),n;case 1:return n=k8(n.type,!0),n;default:return""}}function $6(n){if(n==null)return null;if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case HC:return"Fragment";case WC:return"Portal";case V6:return"Profiler";case fK:return"StrictMode";case z6:return"Suspense";case j6:return"SuspenseList"}if(typeof n=="object")switch(n.$$typeof){case Xce:return(n.displayName||"Context")+".Consumer";case Zce:return(n._context.displayName||"Context")+".Provider";case gK:var e=n.render;return n=n.displayName,n||(n=e.displayName||e.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case pK:return e=n.displayName||null,e!==null?e:$6(n.type)||"Memo";case Cp:e=n._payload,n=n._init;try{return $6(n(e))}catch{}}return null}function LSe(n){var e=n.type;switch(n.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return n=e.render,n=n.displayName||n.name||"",e.displayName||(n!==""?"ForwardRef("+n+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return $6(e);case 8:return e===fK?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Ym(n){switch(typeof n){case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Jce(n){var e=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function kSe(n){var e=Jce(n)?"checked":"value",t=Object.getOwnPropertyDescriptor(n.constructor.prototype,e),i=""+n[e];if(!n.hasOwnProperty(e)&&typeof t<"u"&&typeof t.get=="function"&&typeof t.set=="function"){var s=t.get,o=t.set;return Object.defineProperty(n,e,{configurable:!0,get:function(){return s.call(this)},set:function(r){i=""+r,o.call(this,r)}}),Object.defineProperty(n,e,{enumerable:t.enumerable}),{getValue:function(){return i},setValue:function(r){i=""+r},stopTracking:function(){n._valueTracker=null,delete n[e]}}}}function nT(n){n._valueTracker||(n._valueTracker=kSe(n))}function ede(n){if(!n)return!1;var e=n._valueTracker;if(!e)return!0;var t=e.getValue(),i="";return n&&(i=Jce(n)?n.checked?"true":"false":n.value),n=i,n!==t?(e.setValue(n),!0):!1}function uM(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}function U6(n,e){var t=e.checked;return xs({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:t??n._wrapperState.initialChecked})}function gJ(n,e){var t=e.defaultValue==null?"":e.defaultValue,i=e.checked!=null?e.checked:e.defaultChecked;t=Ym(e.value!=null?e.value:t),n._wrapperState={initialChecked:i,initialValue:t,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function tde(n,e){e=e.checked,e!=null&&uK(n,"checked",e,!1)}function q6(n,e){tde(n,e);var t=Ym(e.value),i=e.type;if(t!=null)i==="number"?(t===0&&n.value===""||n.value!=t)&&(n.value=""+t):n.value!==""+t&&(n.value=""+t);else if(i==="submit"||i==="reset"){n.removeAttribute("value");return}e.hasOwnProperty("value")?K6(n,e.type,t):e.hasOwnProperty("defaultValue")&&K6(n,e.type,Ym(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(n.defaultChecked=!!e.defaultChecked)}function pJ(n,e,t){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var i=e.type;if(!(i!=="submit"&&i!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+n._wrapperState.initialValue,t||e===n.value||(n.value=e),n.defaultValue=e}t=n.name,t!==""&&(n.name=""),n.defaultChecked=!!n._wrapperState.initialChecked,t!==""&&(n.name=t)}function K6(n,e,t){(e!=="number"||uM(n.ownerDocument)!==n)&&(t==null?n.defaultValue=""+n._wrapperState.initialValue:n.defaultValue!==""+t&&(n.defaultValue=""+t))}var wL=Array.isArray;function j0(n,e,t,i){if(n=n.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=sT.firstChild;n.firstChild;)n.removeChild(n.firstChild);for(;e.firstChild;)n.appendChild(e.firstChild)}});function xI(n,e){if(e){var t=n.firstChild;if(t&&t===n.lastChild&&t.nodeType===3){t.nodeValue=e;return}}n.textContent=e}var YL={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ISe=["Webkit","ms","Moz","O"];Object.keys(YL).forEach(function(n){ISe.forEach(function(e){e=e+n.charAt(0).toUpperCase()+n.substring(1),YL[e]=YL[n]})});function ode(n,e,t){return e==null||typeof e=="boolean"||e===""?"":t||typeof e!="number"||e===0||YL.hasOwnProperty(n)&&YL[n]?(""+e).trim():e+"px"}function rde(n,e){n=n.style;for(var t in e)if(e.hasOwnProperty(t)){var i=t.indexOf("--")===0,s=ode(t,e[t],i);t==="float"&&(t="cssFloat"),i?n.setProperty(t,s):n[t]=s}}var ESe=xs({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Z6(n,e){if(e){if(ESe[n]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(je(137,n));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(je(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(je(61))}if(e.style!=null&&typeof e.style!="object")throw Error(je(62))}}function X6(n,e){if(n.indexOf("-")===-1)return typeof e.is=="string";switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Q6=null;function mK(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var J6=null,$0=null,U0=null;function bJ(n){if(n=KN(n)){if(typeof J6!="function")throw Error(je(280));var e=n.stateNode;e&&(e=s5(e),J6(n.stateNode,n.type,e))}}function ade(n){$0?U0?U0.push(n):U0=[n]:$0=n}function lde(){if($0){var n=$0,e=U0;if(U0=$0=null,bJ(n),e)for(n=0;n>>=0,n===0?32:31-(WSe(n)/HSe|0)|0}var oT=64,rT=4194304;function CL(n){switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return n&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return n}}function mM(n,e){var t=n.pendingLanes;if(t===0)return 0;var i=0,s=n.suspendedLanes,o=n.pingedLanes,r=t&268435455;if(r!==0){var a=r&~s;a!==0?i=CL(a):(o&=r,o!==0&&(i=CL(o)))}else r=t&~s,r!==0?i=CL(r):o!==0&&(i=CL(o));if(i===0)return 0;if(e!==0&&e!==i&&!(e&s)&&(s=i&-i,o=e&-e,s>=o||s===16&&(o&4194240)!==0))return e;if(i&4&&(i|=t&16),e=n.entangledLanes,e!==0)for(n=n.entanglements,e&=i;0t;t++)e.push(n);return e}function UN(n,e,t){n.pendingLanes|=e,e!==536870912&&(n.suspendedLanes=0,n.pingedLanes=0),n=n.eventTimes,e=31-jd(e),n[e]=t}function $Se(n,e){var t=n.pendingLanes&~e;n.pendingLanes=e,n.suspendedLanes=0,n.pingedLanes=0,n.expiredLanes&=e,n.mutableReadLanes&=e,n.entangledLanes&=e,e=n.entanglements;var i=n.eventTimes;for(n=n.expirationTimes;0=XL),IJ=" ",EJ=!1;function Ede(n,e){switch(n){case"keyup":return bxe.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nde(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var VC=!1;function wxe(n,e){switch(n){case"compositionend":return Nde(e);case"keypress":return e.which!==32?null:(EJ=!0,IJ);case"textInput":return n=e.data,n===IJ&&EJ?null:n;default:return null}}function Cxe(n,e){if(VC)return n==="compositionend"||!xK&&Ede(n,e)?(n=kde(),aR=CK=$p=null,VC=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:t,offset:e-n};n=i}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=RJ(t)}}function Mde(n,e){return n&&e?n===e?!0:n&&n.nodeType===3?!1:e&&e.nodeType===3?Mde(n,e.parentNode):"contains"in n?n.contains(e):n.compareDocumentPosition?!!(n.compareDocumentPosition(e)&16):!1:!1}function Ade(){for(var n=window,e=uM();e instanceof n.HTMLIFrameElement;){try{var t=typeof e.contentWindow.location.href=="string"}catch{t=!1}if(t)n=e.contentWindow;else break;e=uM(n.document)}return e}function LK(n){var e=n&&n.nodeName&&n.nodeName.toLowerCase();return e&&(e==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||e==="textarea"||n.contentEditable==="true")}function Dxe(n){var e=Ade(),t=n.focusedElem,i=n.selectionRange;if(e!==t&&t&&t.ownerDocument&&Mde(t.ownerDocument.documentElement,t)){if(i!==null&&LK(t)){if(e=i.start,n=i.end,n===void 0&&(n=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(n,t.value.length);else if(n=(e=t.ownerDocument||document)&&e.defaultView||window,n.getSelection){n=n.getSelection();var s=t.textContent.length,o=Math.min(i.start,s);i=i.end===void 0?o:Math.min(i.end,s),!n.extend&&o>i&&(s=i,i=o,o=s),s=MJ(t,o);var r=MJ(t,i);s&&r&&(n.rangeCount!==1||n.anchorNode!==s.node||n.anchorOffset!==s.offset||n.focusNode!==r.node||n.focusOffset!==r.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(e),n.extend(r.node,r.offset)):(e.setEnd(r.node,r.offset),n.addRange(e)))}}for(e=[],n=t;n=n.parentNode;)n.nodeType===1&&e.push({element:n,left:n.scrollLeft,top:n.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t=document.documentMode,zC=null,oB=null,JL=null,rB=!1;function AJ(n,e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;rB||zC==null||zC!==uM(i)||(i=zC,"selectionStart"in i&&LK(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),JL&&DI(JL,i)||(JL=i,i=vM(oB,"onSelect"),0UC||(n.current=uB[UC],uB[UC]=null,UC--)}function zn(n,e){UC++,uB[UC]=n.current,n.current=e}var Zm={},$r=p_(Zm),il=p_(!1),P1=Zm;function Vy(n,e){var t=n.type.contextTypes;if(!t)return Zm;var i=n.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===e)return i.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in t)s[o]=e[o];return i&&(n=n.stateNode,n.__reactInternalMemoizedUnmaskedChildContext=e,n.__reactInternalMemoizedMaskedChildContext=s),s}function nl(n){return n=n.childContextTypes,n!=null}function CM(){Yn(il),Yn($r)}function VJ(n,e,t){if($r.current!==Zm)throw Error(je(168));zn($r,e),zn(il,t)}function jde(n,e,t){var i=n.stateNode;if(e=e.childContextTypes,typeof i.getChildContext!="function")return t;i=i.getChildContext();for(var s in i)if(!(s in e))throw Error(je(108,LSe(n)||"Unknown",s));return xs({},t,i)}function yM(n){return n=(n=n.stateNode)&&n.__reactInternalMemoizedMergedChildContext||Zm,P1=$r.current,zn($r,n),zn(il,il.current),!0}function zJ(n,e,t){var i=n.stateNode;if(!i)throw Error(je(169));t?(n=jde(n,e,P1),i.__reactInternalMemoizedMergedChildContext=n,Yn(il),Yn($r),zn($r,n)):Yn(il),zn(il,t)}var Sf=null,o5=!1,H8=!1;function $de(n){Sf===null?Sf=[n]:Sf.push(n)}function zxe(n){o5=!0,$de(n)}function m_(){if(!H8&&Sf!==null){H8=!0;var n=0,e=bn;try{var t=Sf;for(bn=1;n>=r,s-=r,Ff=1<<32-jd(e)+s|t<I?(E=x,x=null):E=x.sibling;var R=u(b,x,w[I],C);if(R===null){x===null&&(x=E);break}n&&x&&R.alternate===null&&e(b,x),v=o(R,v,I),L===null?S=R:L.sibling=R,L=R,x=E}if(I===w.length)return t(b,x),is&&ob(b,I),S;if(x===null){for(;II?(E=x,x=null):E=x.sibling;var M=u(b,x,R.value,C);if(M===null){x===null&&(x=E);break}n&&x&&M.alternate===null&&e(b,x),v=o(M,v,I),L===null?S=M:L.sibling=M,L=M,x=E}if(R.done)return t(b,x),is&&ob(b,I),S;if(x===null){for(;!R.done;I++,R=w.next())R=h(b,R.value,C),R!==null&&(v=o(R,v,I),L===null?S=R:L.sibling=R,L=R);return is&&ob(b,I),S}for(x=i(b,x);!R.done;I++,R=w.next())R=f(x,b,I,R.value,C),R!==null&&(n&&R.alternate!==null&&x.delete(R.key===null?I:R.key),v=o(R,v,I),L===null?S=R:L.sibling=R,L=R);return n&&x.forEach(function(A){return e(b,A)}),is&&ob(b,I),S}function m(b,v,w,C){if(typeof w=="object"&&w!==null&&w.type===HC&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case iT:e:{for(var S=w.key,L=v;L!==null;){if(L.key===S){if(S=w.type,S===HC){if(L.tag===7){t(b,L.sibling),v=s(L,w.props.children),v.return=b,b=v;break e}}else if(L.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Cp&&UJ(S)===L.type){t(b,L.sibling),v=s(L,w.props),v.ref=Mx(b,L,w),v.return=b,b=v;break e}t(b,L);break}else e(b,L);L=L.sibling}w.type===HC?(v=vv(w.props.children,b.mode,C,w.key),v.return=b,b=v):(C=pR(w.type,w.key,w.props,null,b.mode,C),C.ref=Mx(b,v,w),C.return=b,b=C)}return r(b);case WC:e:{for(L=w.key;v!==null;){if(v.key===L)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){t(b,v.sibling),v=s(v,w.children||[]),v.return=b,b=v;break e}else{t(b,v);break}else e(b,v);v=v.sibling}v=G8(w,b.mode,C),v.return=b,b=v}return r(b);case Cp:return L=w._init,m(b,v,L(w._payload),C)}if(wL(w))return g(b,v,w,C);if(Ex(w))return p(b,v,w,C);fT(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(t(b,v.sibling),v=s(v,w),v.return=b,b=v):(t(b,v),v=K8(w,b.mode,C),v.return=b,b=v),r(b)):t(b,v)}return m}var jy=Gde(!0),Yde=Gde(!1),LM=p_(null),kM=null,GC=null,NK=null;function DK(){NK=GC=kM=null}function TK(n){var e=LM.current;Yn(LM),n._currentValue=e}function pB(n,e,t){for(;n!==null;){var i=n.alternate;if((n.childLanes&e)!==e?(n.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),n===t)break;n=n.return}}function K0(n,e){kM=n,NK=GC=null,n=n.dependencies,n!==null&&n.firstContext!==null&&(n.lanes&e&&(Xa=!0),n.firstContext=null)}function qc(n){var e=n._currentValue;if(NK!==n)if(n={context:n,memoizedValue:e,next:null},GC===null){if(kM===null)throw Error(je(308));GC=n,kM.dependencies={lanes:0,firstContext:n}}else GC=GC.next=n;return e}var Qb=null;function RK(n){Qb===null?Qb=[n]:Qb.push(n)}function Zde(n,e,t,i){var s=e.interleaved;return s===null?(t.next=t,RK(e)):(t.next=s.next,s.next=t),e.interleaved=t,pg(n,i)}function pg(n,e){n.lanes|=e;var t=n.alternate;for(t!==null&&(t.lanes|=e),t=n,n=n.return;n!==null;)n.childLanes|=e,t=n.alternate,t!==null&&(t.childLanes|=e),t=n,n=n.return;return t.tag===3?t.stateNode:null}var yp=!1;function MK(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xde(n,e){n=n.updateQueue,e.updateQueue===n&&(e.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,effects:n.effects})}function tg(n,e){return{eventTime:n,lane:e,tag:0,payload:null,callback:null,next:null}}function pm(n,e,t){var i=n.updateQueue;if(i===null)return null;if(i=i.shared,zi&2){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,pg(n,t)}return s=i.interleaved,s===null?(e.next=e,RK(i)):(e.next=s.next,s.next=e),i.interleaved=e,pg(n,t)}function cR(n,e,t){if(e=e.updateQueue,e!==null&&(e=e.shared,(t&4194240)!==0)){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bK(n,t)}}function qJ(n,e){var t=n.updateQueue,i=n.alternate;if(i!==null&&(i=i.updateQueue,t===i)){var s=null,o=null;if(t=t.firstBaseUpdate,t!==null){do{var r={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};o===null?s=o=r:o=o.next=r,t=t.next}while(t!==null);o===null?s=o=e:o=o.next=e}else s=o=e;t={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:i.shared,effects:i.effects},n.updateQueue=t;return}n=t.lastBaseUpdate,n===null?t.firstBaseUpdate=e:n.next=e,t.lastBaseUpdate=e}function IM(n,e,t,i){var s=n.updateQueue;yp=!1;var o=s.firstBaseUpdate,r=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,r===null?o=c:r.next=c,r=l;var d=n.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==r&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var h=s.baseState;r=0,d=c=l=null,a=o;do{var u=a.lane,f=a.eventTime;if((i&u)===u){d!==null&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=n,p=a;switch(u=e,f=t,p.tag){case 1:if(g=p.payload,typeof g=="function"){h=g.call(f,h,u);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=p.payload,u=typeof g=="function"?g.call(f,h,u):g,u==null)break e;h=xs({},h,u);break e;case 2:yp=!0}}a.callback!==null&&a.lane!==0&&(n.flags|=64,u=s.effects,u===null?s.effects=[a]:u.push(a))}else f={eventTime:f,lane:u,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=f,l=h):d=d.next=f,r|=u;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;u=a,a=u.next,u.next=null,s.lastBaseUpdate=u,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do r|=s.lane,s=s.next;while(s!==e)}else o===null&&(s.shared.lanes=0);B1|=r,n.lanes=r,n.memoizedState=h}}function KJ(n,e,t){if(n=e.effects,e.effects=null,n!==null)for(e=0;et?t:4,n(!0);var i=z8.transition;z8.transition={};try{n(!1),e()}finally{bn=t,z8.transition=i}}function ghe(){return Kc().memoizedState}function qxe(n,e,t){var i=_m(n);if(t={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null},phe(n))mhe(e,t);else if(t=Zde(n,e,t,i),t!==null){var s=pa();$d(t,n,i,s),_he(t,e,i)}}function Kxe(n,e,t){var i=_m(n),s={lane:i,action:t,hasEagerState:!1,eagerState:null,next:null};if(phe(n))mhe(e,s);else{var o=n.alternate;if(n.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var r=e.lastRenderedState,a=o(r,t);if(s.hasEagerState=!0,s.eagerState=a,Zd(a,r)){var l=e.interleaved;l===null?(s.next=s,RK(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}t=Zde(n,e,s,i),t!==null&&(s=pa(),$d(t,n,i,s),_he(t,e,i))}}function phe(n){var e=n.alternate;return n===ws||e!==null&&e===ws}function mhe(n,e){ek=NM=!0;var t=n.pending;t===null?e.next=e:(e.next=t.next,t.next=e),n.pending=e}function _he(n,e,t){if(t&4194240){var i=e.lanes;i&=n.pendingLanes,t|=i,e.lanes=t,bK(n,t)}}var DM={readContext:qc,useCallback:Tr,useContext:Tr,useEffect:Tr,useImperativeHandle:Tr,useInsertionEffect:Tr,useLayoutEffect:Tr,useMemo:Tr,useReducer:Tr,useRef:Tr,useState:Tr,useDebugValue:Tr,useDeferredValue:Tr,useTransition:Tr,useMutableSource:Tr,useSyncExternalStore:Tr,useId:Tr,unstable_isNewReconciler:!1},Gxe={readContext:qc,useCallback:function(n,e){return Rh().memoizedState=[n,e===void 0?null:e],n},useContext:qc,useEffect:YJ,useImperativeHandle:function(n,e,t){return t=t!=null?t.concat([n]):null,hR(4194308,4,che.bind(null,e,n),t)},useLayoutEffect:function(n,e){return hR(4194308,4,n,e)},useInsertionEffect:function(n,e){return hR(4,2,n,e)},useMemo:function(n,e){var t=Rh();return e=e===void 0?null:e,n=n(),t.memoizedState=[n,e],n},useReducer:function(n,e,t){var i=Rh();return e=t!==void 0?t(e):e,i.memoizedState=i.baseState=e,n={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:e},i.queue=n,n=n.dispatch=qxe.bind(null,ws,n),[i.memoizedState,n]},useRef:function(n){var e=Rh();return n={current:n},e.memoizedState=n},useState:GJ,useDebugValue:VK,useDeferredValue:function(n){return Rh().memoizedState=n},useTransition:function(){var n=GJ(!1),e=n[0];return n=Uxe.bind(null,n[1]),Rh().memoizedState=n,[e,n]},useMutableSource:function(){},useSyncExternalStore:function(n,e,t){var i=ws,s=Rh();if(is){if(t===void 0)throw Error(je(407));t=t()}else{if(t=e(),Go===null)throw Error(je(349));F1&30||the(i,e,t)}s.memoizedState=t;var o={value:t,getSnapshot:e};return s.queue=o,YJ(nhe.bind(null,i,o,n),[n]),i.flags|=2048,BI(9,ihe.bind(null,i,o,t,e),void 0,null),t},useId:function(){var n=Rh(),e=Go.identifierPrefix;if(is){var t=Bf,i=Ff;t=(i&~(1<<32-jd(i)-1)).toString(32)+t,e=":"+e+"R"+t,t=OI++,0<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=r.createElement(t,{is:i.is}):(n=r.createElement(t),t==="select"&&(r=n,i.multiple?r.multiple=!0:i.size&&(r.size=i.size))):n=r.createElementNS(n,t),n[Yh]=e,n[ME]=i,Dhe(n,e,!1,!1),e.stateNode=n;e:{switch(r=Q6(t,i),t){case"dialog":Gn("cancel",n),Gn("close",n),s=i;break;case"iframe":case"object":case"embed":Gn("load",n),s=i;break;case"video":case"audio":for(s=0;sGy&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304)}else{if(!i)if(n=EM(r),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ax(o,!0),o.tail===null&&o.tailMode==="hidden"&&!r.alternate&&!es)return Dr(e),null}else 2*Hs()-o.renderingStartTime>Gy&&t!==1073741824&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304);o.isBackwards?(r.sibling=e.child,e.child=r):(t=o.last,t!==null?t.sibling=r:e.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Hs(),e.sibling=null,t=gs.current,$n(gs,i?t&1|2:t&1),e):(Dr(e),null);case 22:case 23:return GK(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?Rl&1073741824&&(Dr(e),e.subtreeFlags&6&&(e.flags|=8192)):Dr(e),null;case 24:return null;case 25:return null}throw Error($e(156,e.tag))}function rLe(n,e){switch(IK(e),e.tag){case 1:return nl(e.type)&&wM(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return qy(),Zn(il),Zn(zr),FK(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return OK(e),null;case 13:if(Zn(gs),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error($e(340));$y()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Zn(gs),null;case 4:return qy(),null;case 10:return RK(e.type._context),null;case 22:case 23:return GK(),null;case 24:return null;default:return null}}var gT=!1,Or=!1,aLe=typeof WeakSet=="function"?WeakSet:Set,ft=null;function e0(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Ds(n,e,i)}else t.current=null}function LB(n,e,t){try{t()}catch(i){Ds(n,e,i)}}var aee=!1;function lLe(n,e){if(lB=mM,n=Fde(),kK(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var r=0,a=-1,l=-1,c=0,d=0,h=n,u=null;t:for(;;){for(var f;h!==t||s!==0&&h.nodeType!==3||(a=r+s),h!==o||i!==0&&h.nodeType!==3||(l=r+i),h.nodeType===3&&(r+=h.nodeValue.length),(f=h.firstChild)!==null;)u=h,h=f;for(;;){if(h===n)break t;if(u===t&&++c===s&&(a=r),u===o&&++d===i&&(l=r),(f=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(cB={focusedElem:n,selectionRange:t},mM=!1,ft=e;ft!==null;)if(e=ft,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ft=n;else for(;ft!==null;){e=ft;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?p:bd(e.type,p),m);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error($e(163))}}catch(C){Ds(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,ft=n;break}ft=e.return}return g=aee,aee=!1,g}function tk(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&LB(e,t,o)}s=s.next}while(s!==i)}}function l5(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function kB(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Mhe(n){var e=n.alternate;e!==null&&(n.alternate=null,Mhe(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Yh],delete e[ME],delete e[uB],delete e[$xe],delete e[Uxe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function Ahe(n){return n.tag===5||n.tag===3||n.tag===4}function lee(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Ahe(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function EB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=vM));else if(i!==4&&(n=n.child,n!==null))for(EB(n,e,t),n=n.sibling;n!==null;)EB(n,e,t),n=n.sibling}function IB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(IB(n,e,t),n=n.sibling;n!==null;)IB(n,e,t),n=n.sibling}var sr=null,Cd=!1;function sp(n,e,t){for(t=t.child;t!==null;)Phe(n,e,t),t=t.sibling}function Phe(n,e,t){if(cu&&typeof cu.onCommitFiberUnmount=="function")try{cu.onCommitFiberUnmount(e5,t)}catch{}switch(t.tag){case 5:Or||e0(t,e);case 6:var i=sr,s=Cd;sr=null,sp(n,e,t),sr=i,Cd=s,sr!==null&&(Cd?(n=sr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):sr.removeChild(t.stateNode));break;case 18:sr!==null&&(Cd?(n=sr,t=t.stateNode,n.nodeType===8?W8(n.parentNode,t):n.nodeType===1&&W8(n,t),IE(n)):W8(sr,t.stateNode));break;case 4:i=sr,s=Cd,sr=t.stateNode.containerInfo,Cd=!0,sp(n,e,t),sr=i,Cd=s;break;case 0:case 11:case 14:case 15:if(!Or&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var o=s,r=o.destroy;o=o.tag,r!==void 0&&(o&2||o&4)&&LB(t,e,r),s=s.next}while(s!==i)}sp(n,e,t);break;case 1:if(!Or&&(e0(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Ds(t,e,a)}sp(n,e,t);break;case 21:sp(n,e,t);break;case 22:t.mode&1?(Or=(i=Or)||t.memoizedState!==null,sp(n,e,t),Or=i):sp(n,e,t);break;default:sp(n,e,t)}}function cee(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new aLe),e.forEach(function(i){var s=_Le.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function ld(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=r),i&=~o}if(i=s,i=Hs()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*dLe(i/1960))-i,10n?16:n,qp===null)var i=!1;else{if(n=qp,qp=null,RM=0,ji&6)throw Error($e(331));var s=ji;for(ji|=4,ft=n.current;ft!==null;){var o=ft,r=o.child;if(ft.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lHs()-qK?Cv(n,0):UK|=t),sl(n,e)}function jhe(n,e){e===0&&(n.mode&1?(e=oT,oT<<=1,!(oT&130023424)&&(oT=4194304)):e=1);var t=ga();n=pg(n,e),n!==null&&(UN(n,e,t),sl(n,t))}function mLe(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),jhe(n,t)}function _Le(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error($e(314))}i!==null&&i.delete(e),jhe(n,t)}var $he;$he=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||il.current)Xa=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Xa=!1,sLe(n,e,t);Xa=!!(n.flags&131072)}else Xa=!1,es&&e.flags&1048576&&Gde(e,SM,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;hR(n,e),n=e.pendingProps;var s=jy(e,zr.current);Y0(e,t),s=WK(null,e,i,n,s,t);var o=HK();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nl(i)?(o=!0,CM(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,AK(e),s.updater=a5,e.stateNode=s,s._reactInternals=e,bB(e,i,n,t),e=CB(null,e,i,!0,o,t)):(e.tag=0,es&&o&&EK(e),oa(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(hR(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=vLe(i),n=bd(i,n),s){case 0:e=wB(null,e,i,n,t);break e;case 1:e=see(null,e,i,n,t);break e;case 11:e=iee(null,e,i,n,t);break e;case 14:e=nee(null,e,i,bd(i.type,n),t);break e}throw Error($e(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),wB(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),see(n,e,i,s,t);case 3:e:{if(Ehe(e),n===null)throw Error($e(387));i=e.pendingProps,o=e.memoizedState,s=o.element,ehe(n,e),kM(e,i,null,t);var r=e.memoizedState;if(i=r.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:r.cache,pendingSuspenseBoundaries:r.pendingSuspenseBoundaries,transitions:r.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=Ky(Error($e(423)),e),e=oee(n,e,i,t,s);break e}else if(i!==s){s=Ky(Error($e(424)),e),e=oee(n,e,i,t,s);break e}else for(Kl=pm(e.stateNode.containerInfo.firstChild),Yl=e,es=!0,kd=null,t=Qde(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if($y(),i===s){e=mg(n,e,t);break e}oa(n,e,i,t)}e=e.child}return e;case 5:return the(e),n===null&&pB(e),i=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,r=s.children,dB(i,s)?r=null:o!==null&&dB(i,o)&&(e.flags|=32),khe(n,e),oa(n,e,r,t),e.child;case 6:return n===null&&pB(e),null;case 13:return Ihe(n,e,t);case 4:return PK(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=Uy(e,null,i,t):oa(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),iee(n,e,i,s,t);case 7:return oa(n,e,e.pendingProps,t),e.child;case 8:return oa(n,e,e.pendingProps.children,t),e.child;case 12:return oa(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,o=e.memoizedProps,r=s.value,$n(xM,i._currentValue),i._currentValue=r,o!==null)if(Gd(o.value,r)){if(o.children===s.children&&!il.current){e=mg(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){r=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=tg(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),mB(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)r=o.type===e.type?null:o.child;else if(o.tag===18){if(r=o.return,r===null)throw Error($e(341));r.lanes|=t,a=r.alternate,a!==null&&(a.lanes|=t),mB(r,t,e),r=o.sibling}else r=o.child;if(r!==null)r.return=o;else for(r=o;r!==null;){if(r===e){r=null;break}if(o=r.sibling,o!==null){o.return=r.return,r=o;break}r=r.return}o=r}oa(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,Y0(e,t),s=Uc(s),i=i(s),e.flags|=1,oa(n,e,i,t),e.child;case 14:return i=e.type,s=bd(i,e.pendingProps),s=bd(i.type,s),nee(n,e,i,s,t);case 15:return xhe(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:bd(i,s),hR(n,e),e.tag=1,nl(i)?(n=!0,CM(e)):n=!1,Y0(e,t),Che(e,i,s),bB(e,i,s,t),CB(null,e,i,!0,n,t);case 19:return Nhe(n,e,t);case 22:return Lhe(n,e,t)}throw Error($e(156,e.tag))};function Uhe(n,e){return bde(n,e)}function bLe(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bc(n,e,t,i){return new bLe(n,e,t,i)}function ZK(n){return n=n.prototype,!(!n||!n.isReactComponent)}function vLe(n){if(typeof n=="function")return ZK(n)?1:0;if(n!=null){if(n=n.$$typeof,n===pK)return 11;if(n===mK)return 14}return 2}function vm(n,e){var t=n.alternate;return t===null?(t=Bc(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function gR(n,e,t,i,s,o){var r=2;if(i=n,typeof n=="function")ZK(n)&&(r=1);else if(typeof n=="string")r=5;else e:switch(n){case UC:return yv(t.children,s,o,e);case gK:r=8,s|=8;break;case z6:return n=Bc(12,t,e,s|2),n.elementType=z6,n.lanes=o,n;case j6:return n=Bc(13,t,e,s),n.elementType=j6,n.lanes=o,n;case $6:return n=Bc(19,t,e,s),n.elementType=$6,n.lanes=o,n;case tde:return d5(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Jce:r=10;break e;case ede:r=9;break e;case pK:r=11;break e;case mK:r=14;break e;case Cp:r=16,i=null;break e}throw Error($e(130,n==null?n:typeof n,""))}return e=Bc(r,t,e,s),e.elementType=n,e.type=i,e.lanes=o,e}function yv(n,e,t,i){return n=Bc(7,n,i,e),n.lanes=t,n}function d5(n,e,t,i){return n=Bc(22,n,i,e),n.elementType=tde,n.lanes=t,n.stateNode={isHidden:!1},n}function K8(n,e,t){return n=Bc(6,n,null,e),n.lanes=t,n}function G8(n,e,t){return e=Bc(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function wLe(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=I8(0),this.expirationTimes=I8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I8(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function XK(n,e,t,i,s,o,r,a,l){return n=new wLe(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Bc(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},AK(o),n}function CLe(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Yhe)}catch(n){console.error(n)}}Yhe(),Yce.exports=dc;var kLe=Yce.exports,_ee=kLe;H6.createRoot=_ee.createRoot,H6.hydrateRoot=_ee.hydrateRoot;function uo(n){if(typeof n=="string"||typeof n=="number")return""+n;let e="";if(Array.isArray(n))for(let t=0,i;t{}};function p5(){for(var n=0,e=arguments.length,t={},i;n=0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}pR.prototype=p5.prototype={constructor:pR,on:function(n,e){var t=this._,i=ILe(n+"",t),s,o=-1,r=i.length;if(arguments.length<2){for(;++o0)for(var t=new Array(s),i=0,s,o;i=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),vee.hasOwnProperty(e)?{space:vee[e],local:n}:n}function DLe(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===MB&&e.documentElement.namespaceURI===MB?e.createElement(n):e.createElementNS(t,n)}}function TLe(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Zhe(n){var e=m5(n);return(e.local?TLe:DLe)(e)}function RLe(){}function tG(n){return n==null?RLe:function(){return this.querySelector(n)}}function MLe(n){typeof n!="function"&&(n=tG(n));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=w&&(w=v+1);!(S=m[w])&&++w=0;)(r=i[s])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function ske(n){n||(n=oke);function e(h,u){return h&&u?n(h.__data__,u.__data__):!h-!u}for(var t=this._groups,i=t.length,s=new Array(i),o=0;oe?1:n>=e?0:NaN}function rke(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function ake(){return Array.from(this)}function lke(){for(var n=this._groups,e=0,t=n.length;e1?this.each((e==null?vke:typeof e=="function"?Cke:wke)(n,e,t??"")):Yy(this.node(),n)}function Yy(n,e){return n.style.getPropertyValue(e)||tue(n).getComputedStyle(n,null).getPropertyValue(e)}function Ske(n){return function(){delete this[n]}}function xke(n,e){return function(){this[n]=e}}function Lke(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function kke(n,e){return arguments.length>1?this.each((e==null?Ske:typeof e=="function"?Lke:xke)(n,e)):this.node()[n]}function iue(n){return n.trim().split(/^|\s+/)}function iG(n){return n.classList||new nue(n)}function nue(n){this._node=n,this._names=iue(n.getAttribute("class")||"")}nue.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function sue(n,e){for(var t=iG(n),i=-1,s=e.length;++i=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function eEe(n){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,o;t()=>n;function AB(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:o,x:r,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}AB.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function dEe(n){return!n.ctrlKey&&!n.button}function hEe(){return this.parentNode}function uEe(n,e){return e??{x:n.x,y:n.y}}function fEe(){return navigator.maxTouchPoints||"ontouchstart"in this}function due(){var n=dEe,e=hEe,t=uEe,i=fEe,s={},o=p5("start","drag","end"),r=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",b,cEe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,S){if(!(d||!n.call(this,C,S))){var L=w(this,e.call(this,C,S),C,S,"mouse");L&&(Wl(C.view).on("mousemove.drag",g,HE).on("mouseup.drag",p,HE),lue(C.view),Y8(C),c=!1,a=C.clientX,l=C.clientY,L("start",C))}}function g(C){if(X0(C),!c){var S=C.clientX-a,L=C.clientY-l;c=S*S+L*L>h}s.mouse("drag",C)}function p(C){Wl(C.view).on("mousemove.drag mouseup.drag",null),cue(C.view,c),X0(C),s.mouse("end",C)}function m(C,S){if(n.call(this,C,S)){var L=C.changedTouches,x=e.call(this,C,S),E=L.length,I,R;for(I=0;I>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?bT(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?bT(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=pEe.exec(n))?new Qa(e[1],e[2],e[3],1):(e=mEe.exec(n))?new Qa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=_Ee.exec(n))?bT(e[1],e[2],e[3],e[4]):(e=bEe.exec(n))?bT(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=vEe.exec(n))?kee(e[1],e[2]/100,e[3]/100,1):(e=wEe.exec(n))?kee(e[1],e[2]/100,e[3]/100,e[4]):wee.hasOwnProperty(n)?See(wee[n]):n==="transparent"?new Qa(NaN,NaN,NaN,0):null}function See(n){return new Qa(n>>16&255,n>>8&255,n&255,1)}function bT(n,e,t,i){return i<=0&&(n=e=t=NaN),new Qa(n,e,t,i)}function SEe(n){return n instanceof ZN||(n=j1(n)),n?(n=n.rgb(),new Qa(n.r,n.g,n.b,n.opacity)):new Qa}function PB(n,e,t,i){return arguments.length===1?SEe(n):new Qa(n,e,t,i??1)}function Qa(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}nG(Qa,PB,hue(ZN,{brighter(n){return n=n==null?OM:Math.pow(OM,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?VE:Math.pow(VE,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Qa(Sv(this.r),Sv(this.g),Sv(this.b),FM(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xee,formatHex:xee,formatHex8:xEe,formatRgb:Lee,toString:Lee}));function xee(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}`}function xEe(){return`#${tv(this.r)}${tv(this.g)}${tv(this.b)}${tv((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lee(){const n=FM(this.opacity);return`${n===1?"rgb(":"rgba("}${Sv(this.r)}, ${Sv(this.g)}, ${Sv(this.b)}${n===1?")":`, ${n})`}`}function FM(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Sv(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function tv(n){return n=Sv(n),(n<16?"0":"")+n.toString(16)}function kee(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Ad(n,e,t,i)}function uue(n){if(n instanceof Ad)return new Ad(n.h,n.s,n.l,n.opacity);if(n instanceof ZN||(n=j1(n)),!n)return new Ad;if(n instanceof Ad)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Ad(r,a,l,n.opacity)}function LEe(n,e,t,i){return arguments.length===1?uue(n):new Ad(n,e,t,i??1)}function Ad(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}nG(Ad,LEe,hue(ZN,{brighter(n){return n=n==null?OM:Math.pow(OM,n),new Ad(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?VE:Math.pow(VE,n),new Ad(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Qa(Z8(n>=240?n-240:n+120,s,i),Z8(n,s,i),Z8(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Ad(Eee(this.h),vT(this.s),vT(this.l),FM(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=FM(this.opacity);return`${n===1?"hsl(":"hsla("}${Eee(this.h)}, ${vT(this.s)*100}%, ${vT(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Eee(n){return n=(n||0)%360,n<0?n+360:n}function vT(n){return Math.max(0,Math.min(1,n||0))}function Z8(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const sG=n=>()=>n;function kEe(n,e){return function(t){return n+t*e}}function EEe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function IEe(n){return(n=+n)==1?fue:function(e,t){return t-e?EEe(e,t,n):sG(isNaN(e)?t:e)}}function fue(n,e){var t=e-n;return t?kEe(n,t):sG(isNaN(n)?e:n)}const BM=function n(e){var t=IEe(e);function i(s,o){var r=t((s=PB(s)).r,(o=PB(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=fue(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function NEe(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,i=e.slice(),s;return function(o){for(s=0;st&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:zh(i,s)})),t=X8.lastIndex;return t180?d+=360:d-c>180&&(c+=360),u.push({i:h.push(s(h)+"rotate(",null,i)-2,x:zh(c,d)})):d&&h.push(s(h)+"rotate("+d+i)}function a(c,d,h,u){c!==d?u.push({i:h.push(s(h)+"skewX(",null,i)-2,x:zh(c,d)}):d&&h.push(s(h)+"skewX("+d+i)}function l(c,d,h,u,f,g){if(c!==h||d!==u){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:zh(c,h)},{i:p-2,x:zh(d,u)})}else(h!==1||u!==1)&&f.push(s(f)+"scale("+h+","+u+")")}return function(c,d){var h=[],u=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,h,u),r(c.rotate,d.rotate,h,u),a(c.skewX,d.skewX,h,u),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,h,u),c=d=null,function(f){for(var g=-1,p=u.length,m;++g=0&&n._call.call(void 0,e),n=n._next;--Zy}function Dee(){$1=(HM=jE.now())+_5,Zy=SL=0;try{$Ee()}finally{Zy=0,qEe(),$1=0}}function UEe(){var n=jE.now(),e=n-HM;e>_ue&&(_5-=e,HM=n)}function qEe(){for(var n,e=WM,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:WM=t);xL=n,BB(i)}function BB(n){if(!Zy){SL&&(SL=clearTimeout(SL));var e=n-$1;e>24?(n<1/0&&(SL=setTimeout(Dee,n-jE.now()-_5)),Ox&&(Ox=clearInterval(Ox))):(Ox||(HM=jE.now(),Ox=setInterval(UEe,_ue)),Zy=1,bue(Dee))}}function Tee(n,e,t){var i=new VM;return e=e==null?0:+e,i.restart(s=>{i.stop(),n(s+e)},e,t),i}var KEe=p5("start","end","cancel","interrupt"),GEe=[],wue=0,Ree=1,WB=2,_R=3,Mee=4,HB=5,bR=6;function b5(n,e,t,i,s,o){var r=n.__transition;if(!r)n.__transition={};else if(t in r)return;YEe(n,t,{name:e,index:i,group:s,on:KEe,tween:GEe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:wue})}function rG(n,e){var t=oh(n,e);if(t.state>wue)throw new Error("too late; already scheduled");return t}function Nu(n,e){var t=oh(n,e);if(t.state>_R)throw new Error("too late; already running");return t}function oh(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function YEe(n,e,t){var i=n.__transition,s;i[e]=t,t.timer=vue(o,0,t.time);function o(c){t.state=Ree,t.timer.restart(r,t.delay,t.time),t.delay<=c&&r(c-t.delay)}function r(c){var d,h,u,f;if(t.state!==Ree)return l();for(d in i)if(f=i[d],f.name===t.name){if(f.state===_R)return Tee(r);f.state===Mee?(f.state=bR,f.timer.stop(),f.on.call("interrupt",n,n.__data__,f.index,f.group),delete i[d]):+dWB&&i.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function LIe(n,e,t){var i,s,o=xIe(e)?rG:Nu;return function(){var r=o(this,n),a=r.on;a!==i&&(s=(i=a).copy()).on(e,t),r.on=s}}function kIe(n,e){var t=this._id;return arguments.length<2?oh(this.node(),t).on.on(n):this.each(LIe(t,n,e))}function EIe(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function IIe(){return this.on("end.remove",EIe(this._id))}function NIe(n){var e=this._name,t=this._id;typeof n!="function"&&(n=tG(n));for(var i=this._groups,s=i.length,o=new Array(s),r=0;r()=>n;function eNe(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function Bf(n,e,t){this.k=n,this.x=e,this.y=t}Bf.prototype={constructor:Bf,scale:function(n){return n===1?this:new Bf(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Bf(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v5=new Bf(1,0,0);xue.prototype=Bf.prototype;function xue(n){for(;!n.__zoom;)if(!(n=n.parentNode))return v5;return n.__zoom}function Q8(n){n.stopImmediatePropagation()}function Fx(n){n.preventDefault(),n.stopImmediatePropagation()}function tNe(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function iNe(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Aee(){return this.__zoom||v5}function nNe(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function sNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function oNe(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],o=n.invertY(e[0][1])-t[0][1],r=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r))}function Lue(){var n=tNe,e=iNe,t=oNe,i=nNe,s=sNe,o=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],a=250,l=mR,c=p5("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function b(P){P.property("__zoom",Aee).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",R).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(P,B,V,K){var z=P.selection?P.selection():P;z.property("__zoom",Aee),P!==z?S(P,B,V,K):z.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},b.scaleBy=function(P,B,V,K){b.scaleTo(P,function(){var z=this.__zoom.k,j=typeof B=="function"?B.apply(this,arguments):B;return z*j},V,K)},b.scaleTo=function(P,B,V,K){b.transform(P,function(){var z=e.apply(this,arguments),j=this.__zoom,Q=V==null?C(z):typeof V=="function"?V.apply(this,arguments):V,Y=j.invert(Q),te=typeof B=="function"?B.apply(this,arguments):B;return t(w(v(j,te),Q,Y),z,r)},V,K)},b.translateBy=function(P,B,V,K){b.transform(P,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof V=="function"?V.apply(this,arguments):V),e.apply(this,arguments),r)},null,K)},b.translateTo=function(P,B,V,K,z){b.transform(P,function(){var j=e.apply(this,arguments),Q=this.__zoom,Y=K==null?C(j):typeof K=="function"?K.apply(this,arguments):K;return t(v5.translate(Y[0],Y[1]).scale(Q.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof V=="function"?-V.apply(this,arguments):-V),j,r)},K,z)};function v(P,B){return B=Math.max(o[0],Math.min(o[1],B)),B===P.k?P:new Bf(B,P.x,P.y)}function w(P,B,V){var K=B[0]-V[0]*P.k,z=B[1]-V[1]*P.k;return K===P.x&&z===P.y?P:new Bf(P.k,K,z)}function C(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,B,V,K){P.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var z=this,j=arguments,Q=L(z,j).event(K),Y=e.apply(z,j),te=V==null?C(Y):typeof V=="function"?V.apply(z,j):V,ce=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),Ce=z.__zoom,xe=typeof B=="function"?B.apply(z,j):B,je=l(Ce.invert(te).concat(ce/Ce.k),xe.invert(te).concat(ce/xe.k));return function(ke){if(ke===1)ke=xe;else{var Le=je(ke),Ve=ce/Le[2];ke=new Bf(Ve,te[0]-Le[0]*Ve,te[1]-Le[1]*Ve)}Q.zoom(null,ke)}})}function L(P,B,V){return!V&&P.__zooming||new x(P,B)}function x(P,B){this.that=P,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,B),this.taps=0}x.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,B){return this.mouse&&P!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var B=Wl(this.that).datum();c.call(P,this.that,new eNe(P,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),B)}};function E(P,...B){if(!n.apply(this,arguments))return;var V=L(this,B).event(P),K=this.__zoom,z=Math.max(o[0],Math.min(o[1],K.k*Math.pow(2,i.apply(this,arguments)))),j=yd(P);if(V.wheel)(V.mouse[0][0]!==j[0]||V.mouse[0][1]!==j[1])&&(V.mouse[1]=K.invert(V.mouse[0]=j)),clearTimeout(V.wheel);else{if(K.k===z)return;V.mouse=[j,K.invert(j)],vR(this),V.start()}Fx(P),V.wheel=setTimeout(Q,g),V.zoom("mouse",t(w(v(K,z),V.mouse[0],V.mouse[1]),V.extent,r));function Q(){V.wheel=null,V.end()}}function I(P,...B){if(u||!n.apply(this,arguments))return;var V=P.currentTarget,K=L(this,B,!0).event(P),z=Wl(P.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",ce,!0),j=yd(P,V),Q=P.clientX,Y=P.clientY;lue(P.view),Q8(P),K.mouse=[j,this.__zoom.invert(j)],vR(this),K.start();function te(Ce){if(Fx(Ce),!K.moved){var xe=Ce.clientX-Q,je=Ce.clientY-Y;K.moved=xe*xe+je*je>p}K.event(Ce).zoom("mouse",t(w(K.that.__zoom,K.mouse[0]=yd(Ce,V),K.mouse[1]),K.extent,r))}function ce(Ce){z.on("mousemove.zoom mouseup.zoom",null),cue(Ce.view,K.moved),Fx(Ce),K.event(Ce).end()}}function R(P,...B){if(n.apply(this,arguments)){var V=this.__zoom,K=yd(P.changedTouches?P.changedTouches[0]:P,this),z=V.invert(K),j=V.k*(P.shiftKey?.5:2),Q=t(w(v(V,j),K,z),e.apply(this,B),r);Fx(P),a>0?Wl(this).transition().duration(a).call(S,Q,K,P):Wl(this).call(b.transform,Q,K,P)}}function M(P,...B){if(n.apply(this,arguments)){var V=P.touches,K=V.length,z=L(this,B,P.changedTouches.length===K).event(P),j,Q,Y,te;for(Q8(P),Q=0;Q"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:e,sourceHandle:t,targetHandle:i})=>`Couldn't create edge for ${n} handle id: "${n==="source"?t:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},$E=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],kue=["Enter"," ","Escape"],Eue={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:n,x:e,y:t})=>`Moved selected node ${n}. New position, x: ${e}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Xy;(function(n){n.Strict="strict",n.Loose="loose"})(Xy||(Xy={}));var xv;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(xv||(xv={}));var UE;(function(n){n.Partial="partial",n.Full="full"})(UE||(UE={}));const Iue={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Nf;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Nf||(Nf={}));var U1;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(U1||(U1={}));var It;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(It||(It={}));const Pee={[It.Left]:It.Right,[It.Right]:It.Left,[It.Top]:It.Bottom,[It.Bottom]:It.Top};function Nue(n){return n===null?null:n?"valid":"invalid"}const Due=n=>"id"in n&&"source"in n&&"target"in n,rNe=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),lG=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),XN=(n,e=[0,0])=>{const{width:t,height:i}=Wg(n),s=n.origin??e,o=t*s[0],r=i*s[1];return{x:n.position.x-o,y:n.position.y-r}},aNe=(n,e={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const t=n.reduce((i,s)=>{const o=typeof s=="string";let r=!e.nodeLookup&&!o?s:void 0;e.nodeLookup&&(r=o?e.nodeLookup.get(s):lG(s)?s:e.nodeLookup.get(s.id));const a=r?zM(r,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return w5(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return C5(t)},QN=(n,e={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return n.forEach(s=>{(e.filter===void 0||e.filter(s))&&(t=w5(t,zM(s)),i=!0)}),i?C5(t):{x:0,y:0,width:0,height:0}},cG=(n,e,[t,i,s]=[0,0,1],o=!1,r=!1)=>{const a={...eD(e,[t,i,s]),width:e.width/s,height:e.height/s},l=[];for(const c of n.values()){const{measured:d,selectable:h=!0,hidden:u=!1}=c;if(r&&!h||u)continue;const f=d.width??c.width??c.initialWidth??null,g=d.height??c.height??c.initialHeight??null,p=qE(a,Jy(c)),m=(f??0)*(g??0),b=o&&p>0;(!c.internals.handleBounds||b||p>=m||c.dragging)&&l.push(c)}return l},lNe=(n,e)=>{const t=new Set;return n.forEach(i=>{t.add(i.id)}),e.filter(i=>t.has(i.source)||t.has(i.target))};function cNe(n,e){const t=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(s=>s.id)):null;return n.forEach(s=>{s.measured.width&&s.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!s.hidden)&&(!i||i.has(s.id))&&t.set(s.id,s)}),t}async function dNe({nodes:n,width:e,height:t,panZoom:i,minZoom:s,maxZoom:o},r){if(n.size===0)return Promise.resolve(!0);const a=cNe(n,r),l=QN(a),c=dG(l,e,t,(r==null?void 0:r.minZoom)??s,(r==null?void 0:r.maxZoom)??o,(r==null?void 0:r.padding)??.1);return await i.setViewport(c,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)}function Tue({nodeId:n,nextPosition:e,nodeLookup:t,nodeOrigin:i=[0,0],nodeExtent:s,onError:o}){const r=t.get(n),a=r.parentId?t.get(r.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=r.origin??i;let h=r.extent||s;if(r.extent==="parent"&&!r.expandParent)if(!a)o==null||o("005",_u.error005());else{const f=a.measured.width,g=a.measured.height;f&&g&&(h=[[l,c],[l+f,c+g]])}else a&&eS(r.extent)&&(h=[[r.extent[0][0]+l,r.extent[0][1]+c],[r.extent[1][0]+l,r.extent[1][1]+c]]);const u=eS(h)?q1(e,h,r.measured):e;return(r.measured.width===void 0||r.measured.height===void 0)&&(o==null||o("015",_u.error015())),{position:{x:u.x-l+(r.measured.width??0)*d[0],y:u.y-c+(r.measured.height??0)*d[1]},positionAbsolute:u}}async function hNe({nodesToRemove:n=[],edgesToRemove:e=[],nodes:t,edges:i,onBeforeDelete:s}){const o=new Set(n.map(u=>u.id)),r=[];for(const u of t){if(u.deletable===!1)continue;const f=o.has(u.id),g=!f&&u.parentId&&r.find(p=>p.id===u.parentId);(f||g)&&r.push(u)}const a=new Set(e.map(u=>u.id)),l=i.filter(u=>u.deletable!==!1),d=lNe(r,l);for(const u of l)a.has(u.id)&&!d.find(g=>g.id===u.id)&&d.push(u);if(!s)return{edges:d,nodes:r};const h=await s({nodes:r,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:r}:{edges:[],nodes:[]}:h}const Qy=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),q1=(n={x:0,y:0},e,t)=>({x:Qy(n.x,e[0][0],e[1][0]-((t==null?void 0:t.width)??0)),y:Qy(n.y,e[0][1],e[1][1]-((t==null?void 0:t.height)??0))});function Rue(n,e,t){const{width:i,height:s}=Wg(t),{x:o,y:r}=t.internals.positionAbsolute;return q1(n,[[o,r],[o+i,r+s]],e)}const Oee=(n,e,t)=>nt?-Qy(Math.abs(n-t),1,e)/e:0,Mue=(n,e,t=15,i=40)=>{const s=Oee(n.x,i,e.width-i)*t,o=Oee(n.y,i,e.height-i)*t;return[s,o]},w5=(n,e)=>({x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}),VB=({x:n,y:e,width:t,height:i})=>({x:n,y:e,x2:n+t,y2:e+i}),C5=({x:n,y:e,x2:t,y2:i})=>({x:n,y:e,width:t-n,height:i-e}),Jy=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=lG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,width:((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0,height:((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0}},zM=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=lG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,x2:t+(((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0),y2:i+(((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0)}},Aue=(n,e)=>C5(w5(VB(n),VB(e))),qE=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),i=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*i)},Fee=n=>Od(n.width)&&Od(n.height)&&Od(n.x)&&Od(n.y),Od=n=>!isNaN(n)&&isFinite(n),uNe=(n,e)=>{},JN=(n,e=[1,1])=>({x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}),eD=({x:n,y:e},[t,i,s],o=!1,r=[1,1])=>{const a={x:(n-t)/s,y:(e-i)/s};return o?JN(a,r):a},jM=({x:n,y:e},[t,i,s])=>({x:n*s+t,y:e*s+i});function lC(n,e){if(typeof n=="number")return Math.floor((e-e/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(t)}if(typeof n=="string"&&n.endsWith("%")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(e*t*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function fNe(n,e,t){if(typeof n=="string"||typeof n=="number"){const i=lC(n,t),s=lC(n,e);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof n=="object"){const i=lC(n.top??n.y??0,t),s=lC(n.bottom??n.y??0,t),o=lC(n.left??n.x??0,e),r=lC(n.right??n.x??0,e);return{top:i,right:r,bottom:s,left:o,x:o+r,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function gNe(n,e,t,i,s,o){const{x:r,y:a}=jM(n,[e,t,i]),{x:l,y:c}=jM({x:n.x+n.width,y:n.y+n.height},[e,t,i]),d=s-l,h=o-c;return{left:Math.floor(r),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(h)}}const dG=(n,e,t,i,s,o)=>{const r=fNe(o,e,t),a=(e-r.x)/n.width,l=(t-r.y)/n.height,c=Math.min(a,l),d=Qy(c,i,s),h=n.x+n.width/2,u=n.y+n.height/2,f=e/2-h*d,g=t/2-u*d,p=gNe(n,f,g,d,e,t),m={left:Math.min(p.left-r.left,0),top:Math.min(p.top-r.top,0),right:Math.min(p.right-r.right,0),bottom:Math.min(p.bottom-r.bottom,0)};return{x:f-m.left+m.right,y:g-m.top+m.bottom,zoom:d}},KE=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function eS(n){return n!=null&&n!=="parent"}function Wg(n){var e,t;return{width:((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth??0,height:((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight??0}}function Pue(n){var e,t;return(((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth)!==void 0&&(((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight)!==void 0}function Oue(n,e={width:0,height:0},t,i,s){const o={...n},r=i.get(t);if(r){const a=r.origin||s;o.x+=r.internals.positionAbsolute.x-(e.width??0)*a[0],o.y+=r.internals.positionAbsolute.y-(e.height??0)*a[1]}return o}function Bee(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function pNe(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}function mNe(n){return{...Eue,...n||{}}}function ok(n,{snapGrid:e=[0,0],snapToGrid:t=!1,transform:i,containerBounds:s}){const{x:o,y:r}=Fd(n),a=eD({x:o-((s==null?void 0:s.left)??0),y:r-((s==null?void 0:s.top)??0)},i),{x:l,y:c}=t?JN(a,e):a;return{xSnapped:l,ySnapped:c,...a}}const hG=n=>({width:n.offsetWidth,height:n.offsetHeight}),Fue=n=>{var e;return((e=n==null?void 0:n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},_Ne=["INPUT","SELECT","TEXTAREA"];function Bue(n){var i,s;const e=((s=(i=n.composedPath)==null?void 0:i.call(n))==null?void 0:s[0])||n.target;return(e==null?void 0:e.nodeType)!==1?!1:_Ne.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Wue=n=>"clientX"in n,Fd=(n,e)=>{var o,r;const t=Wue(n),i=t?n.clientX:(o=n.touches)==null?void 0:o[0].clientX,s=t?n.clientY:(r=n.touches)==null?void 0:r[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:s-((e==null?void 0:e.top)??0)}},Wee=(n,e,t,i,s)=>{const o=e.querySelectorAll(`.${n}`);return!o||!o.length?null:Array.from(o).map(r=>{const a=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:n,nodeId:s,position:r.getAttribute("data-handlepos"),x:(a.left-t.left)/i,y:(a.top-t.top)/i,...hG(r)}})};function Hue({sourceX:n,sourceY:e,targetX:t,targetY:i,sourceControlX:s,sourceControlY:o,targetControlX:r,targetControlY:a}){const l=n*.125+s*.375+r*.375+t*.125,c=e*.125+o*.375+a*.375+i*.125,d=Math.abs(l-n),h=Math.abs(c-e);return[l,c,d,h]}function yT(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function Hee({pos:n,x1:e,y1:t,x2:i,y2:s,c:o}){switch(n){case It.Left:return[e-yT(e-i,o),t];case It.Right:return[e+yT(i-e,o),t];case It.Top:return[e,t-yT(t-s,o)];case It.Bottom:return[e,t+yT(s-t,o)]}}function Vue({sourceX:n,sourceY:e,sourcePosition:t=It.Bottom,targetX:i,targetY:s,targetPosition:o=It.Top,curvature:r=.25}){const[a,l]=Hee({pos:t,x1:n,y1:e,x2:i,y2:s,c:r}),[c,d]=Hee({pos:o,x1:i,y1:s,x2:n,y2:e,c:r}),[h,u,f,g]=Hue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${n},${e} C${a},${l} ${c},${d} ${i},${s}`,h,u,f,g]}function zue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const s=Math.abs(t-n)/2,o=t0}const wNe=({source:n,sourceHandle:e,target:t,targetHandle:i})=>`xy-edge__${n}${e||""}-${t}${i||""}`,CNe=(n,e)=>e.some(t=>t.source===n.source&&t.target===n.target&&(t.sourceHandle===n.sourceHandle||!t.sourceHandle&&!n.sourceHandle)&&(t.targetHandle===n.targetHandle||!t.targetHandle&&!n.targetHandle)),yNe=(n,e,t={})=>{if(!n.source||!n.target)return e;const i=t.getEdgeId||wNe;let s;return Due(n)?s={...n}:s={...n,id:i(n)},CNe(s,e)?e:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,e.concat(s))};function jue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const[s,o,r,a]=zue({sourceX:n,sourceY:e,targetX:t,targetY:i});return[`M ${n},${e}L ${t},${i}`,s,o,r,a]}const Vee={[It.Left]:{x:-1,y:0},[It.Right]:{x:1,y:0},[It.Top]:{x:0,y:-1},[It.Bottom]:{x:0,y:1}},SNe=({source:n,sourcePosition:e=It.Bottom,target:t})=>e===It.Left||e===It.Right?n.xMath.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function xNe({source:n,sourcePosition:e=It.Bottom,target:t,targetPosition:i=It.Top,center:s,offset:o,stepPosition:r}){const a=Vee[e],l=Vee[i],c={x:n.x+a.x*o,y:n.y+a.y*o},d={x:t.x+l.x*o,y:t.y+l.y*o},h=SNe({source:c,sourcePosition:e,target:d}),u=h.x!==0?"x":"y",f=h[u];let g=[],p,m;const b={x:0,y:0},v={x:0,y:0},[,,w,C]=zue({sourceX:n.x,sourceY:n.y,targetX:t.x,targetY:t.y});if(a[u]*l[u]===-1){u==="x"?(p=s.x??c.x+(d.x-c.x)*r,m=s.y??(c.y+d.y)/2):(p=s.x??(c.x+d.x)/2,m=s.y??c.y+(d.y-c.y)*r);const L=[{x:p,y:c.y},{x:p,y:d.y}],x=[{x:c.x,y:m},{x:d.x,y:m}];a[u]===f?g=u==="x"?L:x:g=u==="x"?x:L}else{const L=[{x:c.x,y:d.y}],x=[{x:d.x,y:c.y}];if(u==="x"?g=a.x===f?x:L:g=a.y===f?L:x,e===i){const A=Math.abs(n[u]-t[u]);if(A<=o){const W=Math.min(o-1,o-A);a[u]===f?b[u]=(c[u]>n[u]?-1:1)*W:v[u]=(d[u]>t[u]?-1:1)*W}}if(e!==i){const A=u==="x"?"y":"x",W=a[u]===l[A],P=c[A]>d[A],B=c[A]=M?(p=(E.x+I.x)/2,m=g[0].y):(p=g[0].x,m=(E.y+I.y)/2)}return[[n,{x:c.x+b.x,y:c.y+b.y},...g,{x:d.x+v.x,y:d.y+v.y},t],p,m,w,C]}function LNe(n,e,t,i){const s=Math.min(zee(n,e)/2,zee(e,t)/2,i),{x:o,y:r}=e;if(n.x===o&&o===t.x||n.y===r&&r===t.y)return`L${o} ${r}`;if(n.y===r){const c=n.x{let C="";return w>0&&wt.id===e):n[0])||null}function jB(n,e){return n?typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`:""}function ENe(n,{id:e,defaultColor:t,defaultMarkerStart:i,defaultMarkerEnd:s}){const o=new Set;return n.reduce((r,a)=>([a.markerStart||i,a.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const c=jB(l,e);o.has(c)||(r.push({id:c,color:l.color||t,...l}),o.add(c))}}),r),[]).sort((r,a)=>r.id.localeCompare(a.id))}const $ue=1e3,INe=10,uG={nodeOrigin:[0,0],nodeExtent:$E,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},NNe={...uG,checkEquality:!0};function fG(n,e){const t={...n};for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function DNe(n,e,t){const i=fG(uG,t);for(const s of n.values())if(s.parentId)pG(s,n,e,i);else{const o=XN(s,i.nodeOrigin),r=eS(s.extent)?s.extent:i.nodeExtent,a=q1(o,r,Wg(s));s.internals.positionAbsolute=a}}function TNe(n,e){if(!n.handles)return n.measured?e==null?void 0:e.internals.handleBounds:void 0;const t=[],i=[];for(const s of n.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:n.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(o):s.type==="target"&&i.push(o)}return{source:t,target:i}}function gG(n){return n==="manual"}function $B(n,e,t,i={}){var c,d;const s=fG(NNe,i),o={i:0},r=new Map(e),a=s!=null&&s.elevateNodesOnSelect&&!gG(s.zIndexMode)?$ue:0;let l=n.length>0;e.clear(),t.clear();for(const h of n){let u=r.get(h.id);if(s.checkEquality&&h===(u==null?void 0:u.internals.userNode))e.set(h.id,u);else{const f=XN(h,s.nodeOrigin),g=eS(h.extent)?h.extent:s.nodeExtent,p=q1(f,g,Wg(h));u={...s.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:p,handleBounds:TNe(h,u),z:Uue(h,a,s.zIndexMode),userNode:h}},e.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),h.parentId&&pG(u,e,t,i,o)}return l}function RNe(n,e){if(!n.parentId)return;const t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}function pG(n,e,t,i,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:a,zIndexMode:l}=fG(uG,i),c=n.parentId,d=e.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}RNe(n,t),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*INe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const h=o&&!gG(l)?$ue:0,{x:u,y:f,z:g}=MNe(n,d,r,a,h,l),{positionAbsolute:p}=n.internals,m=u!==p.x||f!==p.y;(m||g!==n.internals.z)&&e.set(n.id,{...n,internals:{...n.internals,positionAbsolute:m?{x:u,y:f}:p,z:g}})}function Uue(n,e,t){const i=Od(n.zIndex)?n.zIndex:0;return gG(t)?i:i+(n.selected?e:0)}function MNe(n,e,t,i,s,o){const{x:r,y:a}=e.internals.positionAbsolute,l=Wg(n),c=XN(n,t),d=eS(n.extent)?q1(c,n.extent,l):c;let h=q1({x:r+d.x,y:a+d.y},i,l);n.extent==="parent"&&(h=Rue(h,l,e));const u=Uue(n,s,o),f=e.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function mG(n,e,t,i=[0,0]){var r;const s=[],o=new Map;for(const a of n){const l=e.get(a.parentId);if(!l)continue;const c=((r=o.get(a.parentId))==null?void 0:r.expandedRect)??Jy(l),d=Aue(c,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},c)=>{var w;const d=l.internals.positionAbsolute,h=Wg(l),u=l.origin??i,f=a.x0||g>0||b||v)&&(s.push({id:c,type:"position",position:{x:l.position.x-f+b,y:l.position.y-g+v}}),(w=t.get(c))==null||w.forEach(C=>{n.some(S=>S.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(h.width0){const f=mG(u,e,t,s);c.push(...f)}return{changes:c,updatedInternals:l}}async function PNe({delta:n,panZoom:e,transform:t,translateExtent:i,width:s,height:o}){if(!e||!n.x&&!n.y)return Promise.resolve(!1);const r=await e.setViewportConstrained({x:t[0]+n.x,y:t[1]+n.y,zoom:t[2]},[[0,0],[s,o]],i),a=!!r&&(r.x!==t[0]||r.y!==t[1]||r.k!==t[2]);return Promise.resolve(a)}function qee(n,e,t,i,s,o){let r=s;const a=i.get(r)||new Map;i.set(r,a.set(t,e)),r=`${s}-${n}`;const l=i.get(r)||new Map;if(i.set(r,l.set(t,e)),o){r=`${s}-${n}-${o}`;const c=i.get(r)||new Map;i.set(r,c.set(t,e))}}function que(n,e,t){n.clear(),e.clear();for(const i of t){const{source:s,target:o,sourceHandle:r=null,targetHandle:a=null}=i,l={edgeId:i.id,source:s,target:o,sourceHandle:r,targetHandle:a},c=`${s}-${r}--${o}-${a}`,d=`${o}-${a}--${s}-${r}`;qee("source",l,d,n,s,r),qee("target",l,c,n,o,a),e.set(i.id,i)}}function Kue(n,e){if(!n.parentId)return!1;const t=e.get(n.parentId);return t?t.selected?!0:Kue(t,e):!1}function Kee(n,e,t){var s;let i=n;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,e))return!0;if(i===t)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function ONe(n,e,t,i){const s=new Map;for(const[o,r]of n)if((r.selected||r.id===i)&&(!r.parentId||!Kue(r,n))&&(r.draggable||e&&typeof r.draggable>"u")){const a=n.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:t.x-a.internals.positionAbsolute.x,y:t.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function J8({nodeId:n,dragItems:e,nodeLookup:t,dragging:i=!0}){var r,a,l;const s=[];for(const[c,d]of e){const h=(r=t.get(c))==null?void 0:r.internals.userNode;h&&s.push({...h,position:d.position,dragging:i})}if(!n)return[s[0],s];const o=(a=t.get(n))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=e.get(n))==null?void 0:l.position)||o.position,dragging:i}:s[0],s]}function FNe({dragItems:n,snapGrid:e,x:t,y:i}){const s=n.values().next().value;if(!s)return null;const o={x:t-s.distance.x,y:i-s.distance.y},r=JN(o,e);return{x:r.x-o.x,y:r.y-o.y}}function BNe({onNodeMouseDown:n,getStoreItems:e,onDragStart:t,onDrag:i,onDragStop:s}){let o={x:null,y:null},r=0,a=new Map,l=!1,c={x:0,y:0},d=null,h=!1,u=null,f=!1,g=!1,p=null;function m({noDragClassName:v,handleSelector:w,domNode:C,isSelectable:S,nodeId:L,nodeClickDistance:x=0}){u=Wl(C);function E({x:A,y:W}){const{nodeLookup:P,nodeExtent:B,snapGrid:V,snapToGrid:K,nodeOrigin:z,onNodeDrag:j,onSelectionDrag:Q,onError:Y,updateNodePositions:te}=e();o={x:A,y:W};let ce=!1;const Ce=a.size>1,xe=Ce&&B?VB(QN(a)):null,je=Ce&&K?FNe({dragItems:a,snapGrid:V,x:A,y:W}):null;for(const[ke,Le]of a){if(!P.has(ke))continue;let Ve={x:A-Le.distance.x,y:W-Le.distance.y};K&&(Ve=je?{x:Math.round(Ve.x+je.x),y:Math.round(Ve.y+je.y)}:JN(Ve,V));let ct=null;if(Ce&&B&&!Le.extent&&xe){const{positionAbsolute:tt}=Le.internals,Tt=tt.x-xe.x+B[0][0],Si=tt.x+Le.measured.width-xe.x2+B[1][0],Vt=tt.y-xe.y+B[0][1],In=tt.y+Le.measured.height-xe.y2+B[1][1];ct=[[Tt,Vt],[Si,In]]}const{position:dt,positionAbsolute:Be}=Tue({nodeId:ke,nextPosition:Ve,nodeLookup:P,nodeExtent:ct||B,nodeOrigin:z,onError:Y});ce=ce||Le.position.x!==dt.x||Le.position.y!==dt.y,Le.position=dt,Le.internals.positionAbsolute=Be}if(g=g||ce,!!ce&&(te(a,!0),p&&(i||j||!L&&Q))){const[ke,Le]=J8({nodeId:L,dragItems:a,nodeLookup:P});i==null||i(p,a,ke,Le),j==null||j(p,ke,Le),L||Q==null||Q(p,Le)}}async function I(){if(!d)return;const{transform:A,panBy:W,autoPanSpeed:P,autoPanOnNodeDrag:B}=e();if(!B){l=!1,cancelAnimationFrame(r);return}const[V,K]=Mue(c,d,P);(V!==0||K!==0)&&(o.x=(o.x??0)-V/A[2],o.y=(o.y??0)-K/A[2],await W({x:V,y:K})&&E(o)),r=requestAnimationFrame(I)}function R(A){var Ce;const{nodeLookup:W,multiSelectionActive:P,nodesDraggable:B,transform:V,snapGrid:K,snapToGrid:z,selectNodesOnDrag:j,onNodeDragStart:Q,onSelectionDragStart:Y,unselectNodesAndEdges:te}=e();h=!0,(!j||!S)&&!P&&L&&((Ce=W.get(L))!=null&&Ce.selected||te()),S&&j&&L&&(n==null||n(L));const ce=ok(A.sourceEvent,{transform:V,snapGrid:K,snapToGrid:z,containerBounds:d});if(o=ce,a=ONe(W,B,ce,L),a.size>0&&(t||Q||!L&&Y)){const[xe,je]=J8({nodeId:L,dragItems:a,nodeLookup:W});t==null||t(A.sourceEvent,a,xe,je),Q==null||Q(A.sourceEvent,xe,je),L||Y==null||Y(A.sourceEvent,je)}}const M=due().clickDistance(x).on("start",A=>{const{domNode:W,nodeDragThreshold:P,transform:B,snapGrid:V,snapToGrid:K}=e();d=(W==null?void 0:W.getBoundingClientRect())||null,f=!1,g=!1,p=A.sourceEvent,P===0&&R(A),o=ok(A.sourceEvent,{transform:B,snapGrid:V,snapToGrid:K,containerBounds:d}),c=Fd(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:W,transform:P,snapGrid:B,snapToGrid:V,nodeDragThreshold:K,nodeLookup:z}=e(),j=ok(A.sourceEvent,{transform:P,snapGrid:B,snapToGrid:V,containerBounds:d});if(p=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||L&&!z.has(L))&&(f=!0),!f){if(!l&&W&&h&&(l=!0,I()),!h){const Q=Fd(A.sourceEvent,d),Y=Q.x-c.x,te=Q.y-c.y;Math.sqrt(Y*Y+te*te)>K&&R(A)}(o.x!==j.xSnapped||o.y!==j.ySnapped)&&a&&h&&(c=Fd(A.sourceEvent,d),E(j))}}).on("end",A=>{if(!(!h||f)&&(l=!1,h=!1,cancelAnimationFrame(r),a.size>0)){const{nodeLookup:W,updateNodePositions:P,onNodeDragStop:B,onSelectionDragStop:V}=e();if(g&&(P(a,!1),g=!1),s||B||!L&&V){const[K,z]=J8({nodeId:L,dragItems:a,nodeLookup:W,dragging:!1});s==null||s(A.sourceEvent,a,K,z),B==null||B(A.sourceEvent,K,z),L||V==null||V(A.sourceEvent,z)}}}).filter(A=>{const W=A.target;return!A.button&&(!v||!Kee(W,`.${v}`,C))&&(!w||Kee(W,w,C))});u.call(M)}function b(){u==null||u.on(".drag",null)}return{update:m,destroy:b}}function WNe(n,e,t){const i=[],s={x:n.x-t,y:n.y-t,width:t*2,height:t*2};for(const o of e.values())qE(s,Jy(o))>0&&i.push(o);return i}const HNe=250;function VNe(n,e,t,i){var a,l;let s=[],o=1/0;const r=WNe(n,t,e+HNe);for(const c of r){const d=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const h of d){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:u,y:f}=K1(c,h,h.position,!0),g=Math.sqrt(Math.pow(u-n.x,2)+Math.pow(f-n.y,2));g>e||(g1){const c=i.type==="source"?"target":"source";return s.find(d=>d.type===c)??s[0]}return s[0]}function Gue(n,e,t,i,s,o=!1){var c,d,h;const r=i.get(n);if(!r)return null;const a=s==="strict"?(c=r.internals.handleBounds)==null?void 0:c[e]:[...((d=r.internals.handleBounds)==null?void 0:d.source)??[],...((h=r.internals.handleBounds)==null?void 0:h.target)??[]],l=(t?a==null?void 0:a.find(u=>u.id===t):a==null?void 0:a[0])??null;return l&&o?{...l,...K1(r,l,l.position,!0)}:l}function Yue(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function zNe(n,e){let t=null;return e?t=!0:n&&!e&&(t=!1),t}const Zue=()=>!0;function jNe(n,{connectionMode:e,connectionRadius:t,handleId:i,nodeId:s,edgeUpdaterType:o,isTarget:r,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:h,panBy:u,cancelConnection:f,onConnectStart:g,onConnect:p,onConnectEnd:m,isValidConnection:b=Zue,onReconnectEnd:v,updateConnection:w,getTransform:C,getFromHandle:S,autoPanSpeed:L,dragThreshold:x=1,handleDomNode:E}){const I=Fue(n.target);let R=0,M;const{x:A,y:W}=Fd(n),P=Yue(o,E),B=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!B||!P)return;const K=Gue(s,P,i,l,e);if(!K)return;let z=Fd(n,B),j=!1,Q=null,Y=!1,te=null;function ce(){if(!d||!B)return;const[dt,Be]=Mue(z,B,L);u({x:dt,y:Be}),R=requestAnimationFrame(ce)}const Ce={...K,nodeId:s,type:P,position:K.position},xe=l.get(s);let ke={inProgress:!0,isValid:null,from:K1(xe,Ce,It.Left,!0),fromHandle:Ce,fromPosition:Ce.position,fromNode:xe,to:z,toHandle:null,toPosition:Pee[Ce.position],toNode:null,pointer:z};function Le(){V=!0,w(ke),g==null||g(n,{nodeId:s,handleId:i,handleType:P})}x===0&&Le();function Ve(dt){if(!V){const{x:In,y:Nn}=Fd(dt),Os=In-A,Da=Nn-W;if(!(Os*Os+Da*Da>x*x))return;Le()}if(!S()||!Ce){ct(dt);return}const Be=C();z=Fd(dt,B),M=VNe(eD(z,Be,!1,[1,1]),t,l,Ce),j||(ce(),j=!0);const tt=Xue(dt,{handle:M,connectionMode:e,fromNodeId:s,fromHandleId:i,fromType:r?"target":"source",isValidConnection:b,doc:I,lib:c,flowId:h,nodeLookup:l});te=tt.handleDomNode,Q=tt.connection,Y=zNe(!!M,tt.isValid);const Tt=l.get(s),Si=Tt?K1(Tt,Ce,It.Left,!0):ke.from,Vt={...ke,from:Si,isValid:Y,to:tt.toHandle&&Y?jM({x:tt.toHandle.x,y:tt.toHandle.y},Be):z,toHandle:tt.toHandle,toPosition:Y&&tt.toHandle?tt.toHandle.position:Pee[Ce.position],toNode:tt.toHandle?l.get(tt.toHandle.nodeId):null,pointer:z};w(Vt),ke=Vt}function ct(dt){if(!("touches"in dt&&dt.touches.length>0)){if(V){(M||te)&&Q&&Y&&(p==null||p(Q));const{inProgress:Be,...tt}=ke,Tt={...tt,toPosition:ke.toHandle?ke.toPosition:null};m==null||m(dt,Tt),o&&(v==null||v(dt,Tt))}f(),cancelAnimationFrame(R),j=!1,Y=!1,Q=null,te=null,I.removeEventListener("mousemove",Ve),I.removeEventListener("mouseup",ct),I.removeEventListener("touchmove",Ve),I.removeEventListener("touchend",ct)}}I.addEventListener("mousemove",Ve),I.addEventListener("mouseup",ct),I.addEventListener("touchmove",Ve),I.addEventListener("touchend",ct)}function Xue(n,{handle:e,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:o,doc:r,lib:a,flowId:l,isValidConnection:c=Zue,nodeLookup:d}){const h=o==="target",u=e?r.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:f,y:g}=Fd(n),p=r.elementFromPoint(f,g),m=p!=null&&p.classList.contains(`${a}-flow__handle`)?p:u,b={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=Yue(void 0,m),w=m.getAttribute("data-nodeid"),C=m.getAttribute("data-handleid"),S=m.classList.contains("connectable"),L=m.classList.contains("connectableend");if(!w||!v)return b;const x={source:h?w:i,sourceHandle:h?C:s,target:h?i:w,targetHandle:h?s:C};b.connection=x;const I=S&&L&&(t===Xy.Strict?h&&v==="source"||!h&&v==="target":w!==i||C!==s);b.isValid=I&&c(x),b.toHandle=Gue(w,v,C,d,t,!0)}return b}const UB={onPointerDown:jNe,isValid:Xue};function $Ne({domNode:n,panZoom:e,getTransform:t,getViewScale:i}){const s=Wl(n);function o({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:h=!0,zoomable:u=!0,inversePan:f=!1}){const g=w=>{if(w.sourceEvent.type!=="wheel"||!e)return;const C=t(),S=w.sourceEvent.ctrlKey&&KE()?10:1,L=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*d,x=C[2]*Math.pow(2,L*S);e.scaleTo(x)};let p=[0,0];const m=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(p=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},b=w=>{const C=t();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!e)return;const S=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],L=[S[0]-p[0],S[1]-p[1]];p=S;const x=i()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),E={x:C[0]-L[0]*x,y:C[1]-L[1]*x},I=[[0,0],[l,c]];e.setViewportConstrained({x:E.x,y:E.y,zoom:C[2]},I,a)},v=Lue().on("start",m).on("zoom",h?b:null).on("zoom.wheel",u?g:null);s.call(v,{})}function r(){s.on("zoom",null)}return{update:o,destroy:r,pointer:yd}}const y5=n=>({x:n.x,y:n.y,zoom:n.k}),e7=({x:n,y:e,zoom:t})=>v5.translate(n,e).scale(t),i0=(n,e)=>n.target.closest(`.${e}`),Que=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),UNe=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,t7=(n,e=0,t=UNe,i=()=>{})=>{const s=typeof e=="number"&&e>0;return s||i(),s?n.transition().duration(e).ease(t).on("end",i):n},Jue=n=>{const e=n.ctrlKey&&KE()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e};function qNe({zoomPanValues:n,noWheelClassName:e,d3Selection:t,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:r,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(i0(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(d.ctrlKey&&r){const m=yd(d),b=Jue(d),v=h*Math.pow(2,b);i.scaleTo(t,v,m,d);return}const u=d.deltaMode===1?20:1;let f=s===xv.Vertical?0:d.deltaX*u,g=s===xv.Horizontal?0:d.deltaY*u;!KE()&&d.shiftKey&&s!==xv.Vertical&&(f=d.deltaY*u,g=0),i.translateBy(t,-(f/h)*o,-(g/h)*o,{internal:!0});const p=y5(t.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(l==null||l(d,p),n.panScrollTimeout=setTimeout(()=>{c==null||c(d,p),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,a==null||a(d,p))}}function KNe({noWheelClassName:n,preventScrolling:e,d3ZoomHandler:t}){return function(i,s){const o=i.type==="wheel",r=!e&&o&&!i.ctrlKey,a=i0(i,n);if(i.ctrlKey&&o&&a&&i.preventDefault(),r||a)return null;i.preventDefault(),t.call(this,i,s)}}function GNe({zoomPanValues:n,onDraggingChange:e,onPanZoomStart:t}){return i=>{var o,r,a;if((o=i.sourceEvent)!=null&&o.internal)return;const s=y5(i.transform);n.mouseButton=((r=i.sourceEvent)==null?void 0:r.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=s,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),t&&(t==null||t(i.sourceEvent,s))}}function YNe({zoomPanValues:n,panOnDrag:e,onPaneContextMenu:t,onTransformChange:i,onPanZoom:s}){return o=>{var r,a;n.usedRightMouseButton=!!(t&&Que(e,n.mouseButton??0)),(r=o.sourceEvent)!=null&&r.sync||i([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,y5(o.transform)))}}function ZNe({zoomPanValues:n,panOnDrag:e,panOnScroll:t,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:o}){return r=>{var a;if(!((a=r.sourceEvent)!=null&&a.internal)&&(n.isZoomingOrPanning=!1,o&&Que(e,n.mouseButton??0)&&!n.usedRightMouseButton&&r.sourceEvent&&o(r.sourceEvent),n.usedRightMouseButton=!1,i(!1),s)){const l=y5(r.transform);n.prevViewport=l,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{s==null||s(r.sourceEvent,l)},t?150:0)}}}function XNe({zoomActivationKeyPressed:n,zoomOnScroll:e,zoomOnPinch:t,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:r,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:d}){return h=>{var m;const u=n||e,f=t&&h.ctrlKey,g=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(i0(h,`${c}-flow__node`)||i0(h,`${c}-flow__edge`)))return!0;if(!i&&!u&&!s&&!o&&!t||r||d&&!g||i0(h,a)&&g||i0(h,l)&&(!g||s&&g&&!n)||!t&&h.ctrlKey&&g)return!1;if(!t&&h.type==="touchstart"&&((m=h.touches)==null?void 0:m.length)>1)return h.preventDefault(),!1;if(!u&&!s&&!f&&g||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const p=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||g)&&p}}function QNe({domNode:n,minZoom:e,maxZoom:t,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:r,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=n.getBoundingClientRect(),h=Lue().scaleExtent([e,t]).translateExtent(i),u=Wl(n).call(h);v({x:s.x,y:s.y,zoom:Qy(s.zoom,e,t)},[[0,0],[d.width,d.height]],i);const f=u.on("wheel.zoom"),g=u.on("dblclick.zoom");h.wheelDelta(Jue);function p(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).transform(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function m({noWheelClassName:M,noPanClassName:A,onPaneContextMenu:W,userSelectionActive:P,panOnScroll:B,panOnDrag:V,panOnScrollMode:K,panOnScrollSpeed:z,preventScrolling:j,zoomOnPinch:Q,zoomOnScroll:Y,zoomOnDoubleClick:te,zoomActivationKeyPressed:ce,lib:Ce,onTransformChange:xe,connectionInProgress:je,paneClickDistance:ke,selectionOnDrag:Le}){P&&!c.isZoomingOrPanning&&b();const Ve=B&&!ce&&!P;h.clickDistance(Le?1/0:!Od(ke)||ke<0?0:ke);const ct=Ve?qNe({zoomPanValues:c,noWheelClassName:M,d3Selection:u,d3Zoom:h,panOnScrollMode:K,panOnScrollSpeed:z,zoomOnPinch:Q,onPanZoomStart:r,onPanZoom:o,onPanZoomEnd:a}):KNe({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:f});if(u.on("wheel.zoom",ct,{passive:!1}),!P){const Be=GNe({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:r});h.on("start",Be);const tt=YNe({zoomPanValues:c,panOnDrag:V,onPaneContextMenu:!!W,onPanZoom:o,onTransformChange:xe});h.on("zoom",tt);const Tt=ZNe({zoomPanValues:c,panOnDrag:V,panOnScroll:B,onPaneContextMenu:W,onPanZoomEnd:a,onDraggingChange:l});h.on("end",Tt)}const dt=XNe({zoomActivationKeyPressed:ce,panOnDrag:V,zoomOnScroll:Y,panOnScroll:B,zoomOnDoubleClick:te,zoomOnPinch:Q,userSelectionActive:P,noPanClassName:A,noWheelClassName:M,lib:Ce,connectionInProgress:je});h.filter(dt),te?u.on("dblclick.zoom",g):u.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function v(M,A,W){const P=e7(M),B=h==null?void 0:h.constrain()(P,A,W);return B&&await p(B),new Promise(V=>V(B))}async function w(M,A){const W=e7(M);return await p(W,A),new Promise(P=>P(W))}function C(M){if(u){const A=e7(M),W=u.property("__zoom");(W.k!==M.zoom||W.x!==M.x||W.y!==M.y)&&(h==null||h.transform(u,A,null,{sync:!0}))}}function S(){const M=u?xue(u.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function L(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).scaleTo(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function x(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:mR).scaleBy(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function E(M){h==null||h.scaleExtent(M)}function I(M){h==null||h.translateExtent(M)}function R(M){const A=!Od(M)||M<0?0:M;h==null||h.clickDistance(A)}return{update:m,destroy:b,setViewport:w,setViewportConstrained:v,getViewport:S,scaleTo:L,scaleBy:x,setScaleExtent:E,setTranslateExtent:I,syncViewport:C,setClickDistance:R}}var tS;(function(n){n.Line="line",n.Handle="handle"})(tS||(tS={}));function JNe({width:n,prevWidth:e,height:t,prevHeight:i,affectsX:s,affectsY:o}){const r=n-e,a=t-i,l=[r>0?1:r<0?-1:0,a>0?1:a<0?-1:0];return r&&s&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function Gee(n){const e=n.includes("right")||n.includes("left"),t=n.includes("bottom")||n.includes("top"),i=n.includes("left"),s=n.includes("top");return{isHorizontal:e,isVertical:t,affectsX:i,affectsY:s}}function op(n,e){return Math.max(0,e-n)}function rp(n,e){return Math.max(0,n-e)}function ST(n,e,t){return Math.max(0,e-n,n-t)}function Yee(n,e){return n?!e:e}function eDe(n,e,t,i,s,o,r,a){let{affectsX:l,affectsY:c}=e;const{isHorizontal:d,isVertical:h}=e,u=d&&h,{xSnapped:f,ySnapped:g}=t,{minWidth:p,maxWidth:m,minHeight:b,maxHeight:v}=i,{x:w,y:C,width:S,height:L,aspectRatio:x}=n;let E=Math.floor(d?f-n.pointerX:0),I=Math.floor(h?g-n.pointerY:0);const R=S+(l?-E:E),M=L+(c?-I:I),A=-o[0]*S,W=-o[1]*L;let P=ST(R,p,m),B=ST(M,b,v);if(r){let z=0,j=0;l&&E<0?z=op(w+E+A,r[0][0]):!l&&E>0&&(z=rp(w+R+A,r[1][0])),c&&I<0?j=op(C+I+W,r[0][1]):!c&&I>0&&(j=rp(C+M+W,r[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(a){let z=0,j=0;l&&E>0?z=rp(w+E,a[0][0]):!l&&E<0&&(z=op(w+R,a[1][0])),c&&I>0?j=rp(C+I,a[0][1]):!c&&I<0&&(j=op(C+M,a[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(s){if(d){const z=ST(R/x,b,v)*x;if(P=Math.max(P,z),r){let j=0;!l&&!c||l&&!c&&u?j=rp(C+W+R/x,r[1][1])*x:j=op(C+W+(l?E:-E)/x,r[0][1])*x,P=Math.max(P,j)}if(a){let j=0;!l&&!c||l&&!c&&u?j=op(C+R/x,a[1][1])*x:j=rp(C+(l?E:-E)/x,a[0][1])*x,P=Math.max(P,j)}}if(h){const z=ST(M*x,p,m)/x;if(B=Math.max(B,z),r){let j=0;!l&&!c||c&&!l&&u?j=rp(w+M*x+A,r[1][0])/x:j=op(w+(c?I:-I)*x+A,r[0][0])/x,B=Math.max(B,j)}if(a){let j=0;!l&&!c||c&&!l&&u?j=op(w+M*x,a[1][0])/x:j=rp(w+(c?I:-I)*x,a[0][0])/x,B=Math.max(B,j)}}}I=I+(I<0?B:-B),E=E+(E<0?P:-P),s&&(u?R>M*x?I=(Yee(l,c)?-E:E)/x:E=(Yee(l,c)?-I:I)*x:d?(I=E/x,c=l):(E=I*x,l=c));const V=l?w+E:w,K=c?C+I:C;return{width:S+(l?-E:E),height:L+(c?-I:I),x:o[0]*E*(l?-1:1)+V,y:o[1]*I*(c?-1:1)+K}}const efe={width:0,height:0,x:0,y:0},tDe={...efe,pointerX:0,pointerY:0,aspectRatio:1};function iDe(n){return[[0,0],[n.measured.width,n.measured.height]]}function nDe(n,e,t){const i=e.position.x+n.position.x,s=e.position.y+n.position.y,o=n.measured.width??0,r=n.measured.height??0,a=t[0]*o,l=t[1]*r;return[[i-a,s-l],[i+o-a,s+r-l]]}function sDe({domNode:n,nodeId:e,getStoreItems:t,onChange:i,onEnd:s}){const o=Wl(n);let r={controlDirection:Gee("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:g,onResizeEnd:p,shouldResize:m}){let b={...efe},v={...tDe};r={boundaries:d,resizeDirection:u,keepAspectRatio:h,controlDirection:Gee(c)};let w,C=null,S=[],L,x,E,I=!1;const R=due().on("start",M=>{const{nodeLookup:A,transform:W,snapGrid:P,snapToGrid:B,nodeOrigin:V,paneDomNode:K}=t();if(w=A.get(e),!w)return;C=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:j}=ok(M.sourceEvent,{transform:W,snapGrid:P,snapToGrid:B,containerBounds:C});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},v={...b,pointerX:z,pointerY:j,aspectRatio:b.width/b.height},L=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(L=A.get(w.parentId),x=L&&w.extent==="parent"?iDe(L):void 0),S=[],E=void 0;for(const[Q,Y]of A)if(Y.parentId===e&&(S.push({id:Q,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const te=nDe(Y,w,Y.origin??V);E?E=[[Math.min(te[0][0],E[0][0]),Math.min(te[0][1],E[0][1])],[Math.max(te[1][0],E[1][0]),Math.max(te[1][1],E[1][1])]]:E=te}f==null||f(M,{...b})}).on("drag",M=>{const{transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B}=t(),V=ok(M.sourceEvent,{transform:A,snapGrid:W,snapToGrid:P,containerBounds:C}),K=[];if(!w)return;const{x:z,y:j,width:Q,height:Y}=b,te={},ce=w.origin??B,{width:Ce,height:xe,x:je,y:ke}=eDe(v,r.controlDirection,V,r.boundaries,r.keepAspectRatio,ce,x,E),Le=Ce!==Q,Ve=xe!==Y,ct=je!==z&&Le,dt=ke!==j&&Ve;if(!ct&&!dt&&!Le&&!Ve)return;if((ct||dt||ce[0]===1||ce[1]===1)&&(te.x=ct?je:b.x,te.y=dt?ke:b.y,b.x=te.x,b.y=te.y,S.length>0)){const Si=je-z,Vt=ke-j;for(const In of S)In.position={x:In.position.x-Si+ce[0]*(Ce-Q),y:In.position.y-Vt+ce[1]*(xe-Y)},K.push(In)}if((Le||Ve)&&(te.width=Le&&(!r.resizeDirection||r.resizeDirection==="horizontal")?Ce:b.width,te.height=Ve&&(!r.resizeDirection||r.resizeDirection==="vertical")?xe:b.height,b.width=te.width,b.height=te.height),L&&w.expandParent){const Si=ce[0]*(te.width??0);te.x&&te.x{I&&(p==null||p(M,{...b}),s==null||s({...b}),I=!1)});o.call(R)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var tfe={exports:{}},ife={},nfe={exports:{}},sfe={};/** +`+o.stack}return{value:n,source:e,stack:s,digest:null}}function U8(n,e,t){return{value:n,source:null,stack:t??null,digest:e??null}}function bB(n,e){try{console.error(e.value)}catch(t){setTimeout(function(){throw t})}}var Xxe=typeof WeakMap=="function"?WeakMap:Map;function vhe(n,e,t){t=tg(-1,t),t.tag=3,t.payload={element:null};var i=e.value;return t.callback=function(){RM||(RM=!0,EB=i),bB(n,e)},t}function whe(n,e,t){t=tg(-1,t),t.tag=3;var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=e.value;t.payload=function(){return i(s)},t.callback=function(){bB(n,e)}}var o=n.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(t.callback=function(){bB(n,e),typeof i!="function"&&(mm===null?mm=new Set([this]):mm.add(this));var r=e.stack;this.componentDidCatch(e.value,{componentStack:r!==null?r:""})}),t}function QJ(n,e,t){var i=n.pingCache;if(i===null){i=n.pingCache=new Xxe;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(t)||(s.add(t),n=hLe.bind(null,n,e,t),e.then(n,n))}function JJ(n){do{var e;if((e=n.tag===13)&&(e=n.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return n;n=n.return}while(n!==null);return null}function eee(n,e,t,i,s){return n.mode&1?(n.flags|=65536,n.lanes=s,n):(n===e?n.flags|=65536:(n.flags|=128,t.flags|=131072,t.flags&=-52805,t.tag===1&&(t.alternate===null?t.tag=17:(e=tg(-1,1),e.tag=2,pm(t,e,1))),t.lanes|=1),n)}var Qxe=Bg.ReactCurrentOwner,Xa=!1;function ra(n,e,t,i){e.child=n===null?Yde(e,null,t,i):jy(e,n.child,t,i)}function tee(n,e,t,i,s){t=t.render;var o=e.ref;return K0(e,s),i=BK(n,e,t,i,o,s),t=WK(),n!==null&&!Xa?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,mg(n,e,s)):(is&&t&&kK(e),e.flags|=1,ra(n,e,i,s),e.child)}function iee(n,e,t,i,s){if(n===null){var o=t.type;return typeof o=="function"&&!YK(o)&&o.defaultProps===void 0&&t.compare===null&&t.defaultProps===void 0?(e.tag=15,e.type=o,Che(n,e,o,i,s)):(n=pR(t.type,null,i,e,e.mode,s),n.ref=e.ref,n.return=e,e.child=n)}if(o=n.child,!(n.lanes&s)){var r=o.memoizedProps;if(t=t.compare,t=t!==null?t:DI,t(r,i)&&n.ref===e.ref)return mg(n,e,s)}return e.flags|=1,n=bm(o,i),n.ref=e.ref,n.return=e,e.child=n}function Che(n,e,t,i,s){if(n!==null){var o=n.memoizedProps;if(DI(o,i)&&n.ref===e.ref)if(Xa=!1,e.pendingProps=i=o,(n.lanes&s)!==0)n.flags&131072&&(Xa=!0);else return e.lanes=n.lanes,mg(n,e,s)}return vB(n,e,t,i,s)}function yhe(n,e,t){var i=e.pendingProps,s=i.children,o=n!==null?n.memoizedState:null;if(i.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},zn(ZC,El),El|=t;else{if(!(t&1073741824))return n=o!==null?o.baseLanes|t:t,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:n,cachePool:null,transitions:null},e.updateQueue=null,zn(ZC,El),El|=n,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=o!==null?o.baseLanes:t,zn(ZC,El),El|=i}else o!==null?(i=o.baseLanes|t,e.memoizedState=null):i=t,zn(ZC,El),El|=i;return ra(n,e,s,t),e.child}function She(n,e){var t=e.ref;(n===null&&t!==null||n!==null&&n.ref!==t)&&(e.flags|=512,e.flags|=2097152)}function vB(n,e,t,i,s){var o=nl(t)?P1:$r.current;return o=Vy(e,o),K0(e,s),t=BK(n,e,t,i,o,s),i=WK(),n!==null&&!Xa?(e.updateQueue=n.updateQueue,e.flags&=-2053,n.lanes&=~s,mg(n,e,s)):(is&&i&&kK(e),e.flags|=1,ra(n,e,t,s),e.child)}function nee(n,e,t,i,s){if(nl(t)){var o=!0;yM(e)}else o=!1;if(K0(e,s),e.stateNode===null)uR(n,e),bhe(e,t,i),_B(e,t,i,s),i=!0;else if(n===null){var r=e.stateNode,a=e.memoizedProps;r.props=a;var l=r.context,c=t.contextType;typeof c=="object"&&c!==null?c=qc(c):(c=nl(t)?P1:$r.current,c=Vy(e,c));var d=t.getDerivedStateFromProps,h=typeof d=="function"||typeof r.getSnapshotBeforeUpdate=="function";h||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==i||l!==c)&&XJ(e,r,i,c),yp=!1;var u=e.memoizedState;r.state=u,IM(e,i,r,s),l=e.memoizedState,a!==i||u!==l||il.current||yp?(typeof d=="function"&&(mB(e,t,d,i),l=e.memoizedState),(a=yp||ZJ(e,t,a,i,u,l,c))?(h||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(e.flags|=4194308)):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=l),r.props=i,r.state=l,r.context=c,i=a):(typeof r.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{r=e.stateNode,Xde(n,e),a=e.memoizedProps,c=e.type===e.elementType?a:wd(e.type,a),r.props=c,h=e.pendingProps,u=r.context,l=t.contextType,typeof l=="object"&&l!==null?l=qc(l):(l=nl(t)?P1:$r.current,l=Vy(e,l));var f=t.getDerivedStateFromProps;(d=typeof f=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(a!==h||u!==l)&&XJ(e,r,i,l),yp=!1,u=e.memoizedState,r.state=u,IM(e,i,r,s);var g=e.memoizedState;a!==h||u!==g||il.current||yp?(typeof f=="function"&&(mB(e,t,f,i),g=e.memoizedState),(c=yp||ZJ(e,t,c,i,u,g,l)||!1)?(d||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(i,g,l),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(i,g,l)),typeof r.componentDidUpdate=="function"&&(e.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof r.componentDidUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=g),r.props=i,r.state=g,r.context=l,i=c):(typeof r.componentDidUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||a===n.memoizedProps&&u===n.memoizedState||(e.flags|=1024),i=!1)}return wB(n,e,t,i,o,s)}function wB(n,e,t,i,s,o){She(n,e);var r=(e.flags&128)!==0;if(!i&&!r)return s&&zJ(e,t,!1),mg(n,e,o);i=e.stateNode,Qxe.current=e;var a=r&&typeof t.getDerivedStateFromError!="function"?null:i.render();return e.flags|=1,n!==null&&r?(e.child=jy(e,n.child,null,o),e.child=jy(e,null,a,o)):ra(n,e,a,o),e.memoizedState=i.state,s&&zJ(e,t,!0),e.child}function xhe(n){var e=n.stateNode;e.pendingContext?VJ(n,e.pendingContext,e.pendingContext!==e.context):e.context&&VJ(n,e.context,!1),AK(n,e.containerInfo)}function see(n,e,t,i,s){return zy(),EK(s),e.flags|=256,ra(n,e,t,i),e.child}var CB={dehydrated:null,treeContext:null,retryLane:0};function yB(n){return{baseLanes:n,cachePool:null,transitions:null}}function Lhe(n,e,t){var i=e.pendingProps,s=ps.current,o=!1,r=(e.flags&128)!==0,a;if((a=r)||(a=n!==null&&n.memoizedState===null?!1:(s&2)!==0),a?(o=!0,e.flags&=-129):(n===null||n.memoizedState!==null)&&(s|=1),zn(ps,s&1),n===null)return gB(e),n=e.memoizedState,n!==null&&(n=n.dehydrated,n!==null)?(e.mode&1?n.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(r=i.children,n=i.fallback,o?(i=e.mode,o=e.child,r={mode:"hidden",children:r},!(i&1)&&o!==null?(o.childLanes=0,o.pendingProps=r):o=d5(r,i,0,null),n=vv(n,i,t,null),o.return=e,n.return=e,o.sibling=n,e.child=o,e.child.memoizedState=yB(t),e.memoizedState=CB,n):zK(e,r));if(s=n.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Jxe(n,e,r,i,a,s,t);if(o){o=i.fallback,r=e.mode,s=n.child,a=s.sibling;var l={mode:"hidden",children:i.children};return!(r&1)&&e.child!==s?(i=e.child,i.childLanes=0,i.pendingProps=l,e.deletions=null):(i=bm(s,l),i.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=bm(a,o):(o=vv(o,r,t,null),o.flags|=2),o.return=e,i.return=e,i.sibling=o,e.child=i,i=o,o=e.child,r=n.child.memoizedState,r=r===null?yB(t):{baseLanes:r.baseLanes|t,cachePool:null,transitions:r.transitions},o.memoizedState=r,o.childLanes=n.childLanes&~t,e.memoizedState=CB,i}return o=n.child,n=o.sibling,i=bm(o,{mode:"visible",children:i.children}),!(e.mode&1)&&(i.lanes=t),i.return=e,i.sibling=null,n!==null&&(t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)),e.child=i,e.memoizedState=null,i}function zK(n,e){return e=d5({mode:"visible",children:e},n.mode,0,null),e.return=n,n.child=e}function gT(n,e,t,i){return i!==null&&EK(i),jy(e,n.child,null,t),n=zK(e,e.pendingProps.children),n.flags|=2,e.memoizedState=null,n}function Jxe(n,e,t,i,s,o,r){if(t)return e.flags&256?(e.flags&=-257,i=U8(Error(je(422))),gT(n,e,r,i)):e.memoizedState!==null?(e.child=n.child,e.flags|=128,null):(o=i.fallback,s=e.mode,i=d5({mode:"visible",children:i.children},s,0,null),o=vv(o,s,r,null),o.flags|=2,i.return=e,o.return=e,i.sibling=o,e.child=i,e.mode&1&&jy(e,n.child,null,r),e.child.memoizedState=yB(r),e.memoizedState=CB,o);if(!(e.mode&1))return gT(n,e,r,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var a=i.dgst;return i=a,o=Error(je(419)),i=U8(o,i,void 0),gT(n,e,r,i)}if(a=(r&n.childLanes)!==0,Xa||a){if(i=Go,i!==null){switch(r&-r){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|r)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,pg(n,s),$d(i,n,s,-1))}return GK(),i=U8(Error(je(421))),gT(n,e,r,i)}return s.data==="$?"?(e.flags|=128,e.child=n.child,e=uLe.bind(null,n),s._reactRetry=e,null):(n=o.treeContext,jl=gm(s.nextSibling),Ul=e,is=!0,Ed=null,n!==null&&(Ac[Pc++]=Ff,Ac[Pc++]=Bf,Ac[Pc++]=O1,Ff=n.id,Bf=n.overflow,O1=e),e=zK(e,i.children),e.flags|=4096,e)}function oee(n,e,t){n.lanes|=e;var i=n.alternate;i!==null&&(i.lanes|=e),pB(n.return,e,t)}function q8(n,e,t,i,s){var o=n.memoizedState;o===null?n.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:t,tailMode:s}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=i,o.tail=t,o.tailMode=s)}function khe(n,e,t){var i=e.pendingProps,s=i.revealOrder,o=i.tail;if(ra(n,e,i.children,t),i=ps.current,i&2)i=i&1|2,e.flags|=128;else{if(n!==null&&n.flags&128)e:for(n=e.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&oee(n,t,e);else if(n.tag===19)oee(n,t,e);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}i&=1}if(zn(ps,i),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(t=e.child,s=null;t!==null;)n=t.alternate,n!==null&&EM(n)===null&&(s=t),t=t.sibling;t=s,t===null?(s=e.child,e.child=null):(s=t.sibling,t.sibling=null),q8(e,!1,s,t,o);break;case"backwards":for(t=null,s=e.child,e.child=null;s!==null;){if(n=s.alternate,n!==null&&EM(n)===null){e.child=s;break}n=s.sibling,s.sibling=t,t=s,s=n}q8(e,!0,t,null,o);break;case"together":q8(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function uR(n,e){!(e.mode&1)&&n!==null&&(n.alternate=null,e.alternate=null,e.flags|=2)}function mg(n,e,t){if(n!==null&&(e.dependencies=n.dependencies),B1|=e.lanes,!(t&e.childLanes))return null;if(n!==null&&e.child!==n.child)throw Error(je(153));if(e.child!==null){for(n=e.child,t=bm(n,n.pendingProps),e.child=t,t.return=e;n.sibling!==null;)n=n.sibling,t=t.sibling=bm(n,n.pendingProps),t.return=e;t.sibling=null}return e.child}function eLe(n,e,t){switch(e.tag){case 3:xhe(e),zy();break;case 5:Qde(e);break;case 1:nl(e.type)&&yM(e);break;case 4:AK(e,e.stateNode.containerInfo);break;case 10:var i=e.type._context,s=e.memoizedProps.value;zn(LM,i._currentValue),i._currentValue=s;break;case 13:if(i=e.memoizedState,i!==null)return i.dehydrated!==null?(zn(ps,ps.current&1),e.flags|=128,null):t&e.child.childLanes?Lhe(n,e,t):(zn(ps,ps.current&1),n=mg(n,e,t),n!==null?n.sibling:null);zn(ps,ps.current&1);break;case 19:if(i=(t&e.childLanes)!==0,n.flags&128){if(i)return khe(n,e,t);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),zn(ps,ps.current),i)break;return null;case 22:case 23:return e.lanes=0,yhe(n,e,t)}return mg(n,e,t)}var Ihe,SB,Ehe,Nhe;Ihe=function(n,e){for(var t=e.child;t!==null;){if(t.tag===5||t.tag===6)n.appendChild(t.stateNode);else if(t.tag!==4&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}};SB=function(){};Ehe=function(n,e,t,i){var s=n.memoizedProps;if(s!==i){n=e.stateNode,Jb(hu.current);var o=null;switch(t){case"input":s=U6(n,s),i=U6(n,i),o=[];break;case"select":s=xs({},s,{value:void 0}),i=xs({},i,{value:void 0}),o=[];break;case"textarea":s=G6(n,s),i=G6(n,i),o=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(n.onclick=wM)}Z6(t,i);var r;t=null;for(c in s)if(!i.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(r in a)a.hasOwnProperty(r)&&(t||(t={}),t[r]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(SI.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in i){var l=i[c];if(a=s!=null?s[c]:void 0,i.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(r in a)!a.hasOwnProperty(r)||l&&l.hasOwnProperty(r)||(t||(t={}),t[r]="");for(r in l)l.hasOwnProperty(r)&&a[r]!==l[r]&&(t||(t={}),t[r]=l[r])}else t||(o||(o=[]),o.push(c,t)),t=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(SI.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Kn("scroll",n),o||a===l||(o=[])):(o=o||[]).push(c,l))}t&&(o=o||[]).push("style",t);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};Nhe=function(n,e,t,i){t!==i&&(e.flags|=4)};function Ax(n,e){if(!is)switch(n.tailMode){case"hidden":e=n.tail;for(var t=null;e!==null;)e.alternate!==null&&(t=e),e=e.sibling;t===null?n.tail=null:t.sibling=null;break;case"collapsed":t=n.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e||n.tail===null?n.tail=null:n.tail.sibling=null:i.sibling=null}}function Rr(n){var e=n.alternate!==null&&n.alternate.child===n.child,t=0,i=0;if(e)for(var s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=n,s=s.sibling;else for(s=n.child;s!==null;)t|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=n,s=s.sibling;return n.subtreeFlags|=i,n.childLanes=t,e}function tLe(n,e,t){var i=e.pendingProps;switch(IK(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rr(e),null;case 1:return nl(e.type)&&CM(),Rr(e),null;case 3:return i=e.stateNode,$y(),Yn(il),Yn($r),OK(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(uT(e)?e.flags|=4:n===null||n.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Ed!==null&&(TB(Ed),Ed=null))),SB(n,e),Rr(e),null;case 5:PK(e);var s=Jb(PI.current);if(t=e.type,n!==null&&e.stateNode!=null)Ehe(n,e,t,i,s),n.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!i){if(e.stateNode===null)throw Error(je(166));return Rr(e),null}if(n=Jb(hu.current),uT(e)){i=e.stateNode,t=e.type;var o=e.memoizedProps;switch(i[Zh]=e,i[MI]=o,n=(e.mode&1)!==0,t){case"dialog":Kn("cancel",i),Kn("close",i);break;case"iframe":case"object":case"embed":Kn("load",i);break;case"video":case"audio":for(s=0;s<\/script>",n=n.removeChild(n.firstChild)):typeof i.is=="string"?n=r.createElement(t,{is:i.is}):(n=r.createElement(t),t==="select"&&(r=n,i.multiple?r.multiple=!0:i.size&&(r.size=i.size))):n=r.createElementNS(n,t),n[Zh]=e,n[MI]=i,Ihe(n,e,!1,!1),e.stateNode=n;e:{switch(r=X6(t,i),t){case"dialog":Kn("cancel",n),Kn("close",n),s=i;break;case"iframe":case"object":case"embed":Kn("load",n),s=i;break;case"video":case"audio":for(s=0;sqy&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304)}else{if(!i)if(n=EM(r),n!==null){if(e.flags|=128,i=!0,t=n.updateQueue,t!==null&&(e.updateQueue=t,e.flags|=4),Ax(o,!0),o.tail===null&&o.tailMode==="hidden"&&!r.alternate&&!is)return Rr(e),null}else 2*Hs()-o.renderingStartTime>qy&&t!==1073741824&&(e.flags|=128,i=!0,Ax(o,!1),e.lanes=4194304);o.isBackwards?(r.sibling=e.child,e.child=r):(t=o.last,t!==null?t.sibling=r:e.child=r,o.last=r)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Hs(),e.sibling=null,t=ps.current,zn(ps,i?t&1|2:t&1),e):(Rr(e),null);case 22:case 23:return KK(),i=e.memoizedState!==null,n!==null&&n.memoizedState!==null!==i&&(e.flags|=8192),i&&e.mode&1?El&1073741824&&(Rr(e),e.subtreeFlags&6&&(e.flags|=8192)):Rr(e),null;case 24:return null;case 25:return null}throw Error(je(156,e.tag))}function iLe(n,e){switch(IK(e),e.tag){case 1:return nl(e.type)&&CM(),n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 3:return $y(),Yn(il),Yn($r),OK(),n=e.flags,n&65536&&!(n&128)?(e.flags=n&-65537|128,e):null;case 5:return PK(e),null;case 13:if(Yn(ps),n=e.memoizedState,n!==null&&n.dehydrated!==null){if(e.alternate===null)throw Error(je(340));zy()}return n=e.flags,n&65536?(e.flags=n&-65537|128,e):null;case 19:return Yn(ps),null;case 4:return $y(),null;case 10:return TK(e.type._context),null;case 22:case 23:return KK(),null;case 24:return null;default:return null}}var pT=!1,Br=!1,nLe=typeof WeakSet=="function"?WeakSet:Set,ft=null;function YC(n,e){var t=n.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){Ds(n,e,i)}else t.current=null}function xB(n,e,t){try{t()}catch(i){Ds(n,e,i)}}var ree=!1;function sLe(n,e){if(aB=_M,n=Ade(),LK(n)){if("selectionStart"in n)var t={start:n.selectionStart,end:n.selectionEnd};else e:{t=(t=n.ownerDocument)&&t.defaultView||window;var i=t.getSelection&&t.getSelection();if(i&&i.rangeCount!==0){t=i.anchorNode;var s=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{t.nodeType,o.nodeType}catch{t=null;break e}var r=0,a=-1,l=-1,c=0,d=0,h=n,u=null;t:for(;;){for(var f;h!==t||s!==0&&h.nodeType!==3||(a=r+s),h!==o||i!==0&&h.nodeType!==3||(l=r+i),h.nodeType===3&&(r+=h.nodeValue.length),(f=h.firstChild)!==null;)u=h,h=f;for(;;){if(h===n)break t;if(u===t&&++c===s&&(a=r),u===o&&++d===i&&(l=r),(f=h.nextSibling)!==null)break;h=u,u=h.parentNode}h=f}t=a===-1||l===-1?null:{start:a,end:l}}else t=null}t=t||{start:0,end:0}}else t=null;for(lB={focusedElem:n,selectionRange:t},_M=!1,ft=e;ft!==null;)if(e=ft,n=e.child,(e.subtreeFlags&1028)!==0&&n!==null)n.return=e,ft=n;else for(;ft!==null;){e=ft;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var p=g.memoizedProps,m=g.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?p:wd(e.type,p),m);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(je(163))}}catch(C){Ds(e,e.return,C)}if(n=e.sibling,n!==null){n.return=e.return,ft=n;break}ft=e.return}return g=ree,ree=!1,g}function tk(n,e,t){var i=e.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&n)===n){var o=s.destroy;s.destroy=void 0,o!==void 0&&xB(e,t,o)}s=s.next}while(s!==i)}}function l5(n,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var t=e=e.next;do{if((t.tag&n)===n){var i=t.create;t.destroy=i()}t=t.next}while(t!==e)}}function LB(n){var e=n.ref;if(e!==null){var t=n.stateNode;switch(n.tag){case 5:n=t;break;default:n=t}typeof e=="function"?e(n):e.current=n}}function Dhe(n){var e=n.alternate;e!==null&&(n.alternate=null,Dhe(e)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(e=n.stateNode,e!==null&&(delete e[Zh],delete e[MI],delete e[hB],delete e[Hxe],delete e[Vxe])),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}function The(n){return n.tag===5||n.tag===3||n.tag===4}function aee(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||The(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function kB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.nodeType===8?t.parentNode.insertBefore(n,e):t.insertBefore(n,e):(t.nodeType===8?(e=t.parentNode,e.insertBefore(n,t)):(e=t,e.appendChild(n)),t=t._reactRootContainer,t!=null||e.onclick!==null||(e.onclick=wM));else if(i!==4&&(n=n.child,n!==null))for(kB(n,e,t),n=n.sibling;n!==null;)kB(n,e,t),n=n.sibling}function IB(n,e,t){var i=n.tag;if(i===5||i===6)n=n.stateNode,e?t.insertBefore(n,e):t.appendChild(n);else if(i!==4&&(n=n.child,n!==null))for(IB(n,e,t),n=n.sibling;n!==null;)IB(n,e,t),n=n.sibling}var rr=null,Sd=!1;function sp(n,e,t){for(t=t.child;t!==null;)Rhe(n,e,t),t=t.sibling}function Rhe(n,e,t){if(du&&typeof du.onCommitFiberUnmount=="function")try{du.onCommitFiberUnmount(e5,t)}catch{}switch(t.tag){case 5:Br||YC(t,e);case 6:var i=rr,s=Sd;rr=null,sp(n,e,t),rr=i,Sd=s,rr!==null&&(Sd?(n=rr,t=t.stateNode,n.nodeType===8?n.parentNode.removeChild(t):n.removeChild(t)):rr.removeChild(t.stateNode));break;case 18:rr!==null&&(Sd?(n=rr,t=t.stateNode,n.nodeType===8?W8(n.parentNode,t):n.nodeType===1&&W8(n,t),EI(n)):W8(rr,t.stateNode));break;case 4:i=rr,s=Sd,rr=t.stateNode.containerInfo,Sd=!0,sp(n,e,t),rr=i,Sd=s;break;case 0:case 11:case 14:case 15:if(!Br&&(i=t.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var o=s,r=o.destroy;o=o.tag,r!==void 0&&(o&2||o&4)&&xB(t,e,r),s=s.next}while(s!==i)}sp(n,e,t);break;case 1:if(!Br&&(YC(t,e),i=t.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=t.memoizedProps,i.state=t.memoizedState,i.componentWillUnmount()}catch(a){Ds(t,e,a)}sp(n,e,t);break;case 21:sp(n,e,t);break;case 22:t.mode&1?(Br=(i=Br)||t.memoizedState!==null,sp(n,e,t),Br=i):sp(n,e,t);break;default:sp(n,e,t)}}function lee(n){var e=n.updateQueue;if(e!==null){n.updateQueue=null;var t=n.stateNode;t===null&&(t=n.stateNode=new nLe),e.forEach(function(i){var s=fLe.bind(null,n,i);t.has(i)||(t.add(i),i.then(s,s))})}}function dd(n,e){var t=e.deletions;if(t!==null)for(var i=0;is&&(s=r),i&=~o}if(i=s,i=Hs()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*rLe(i/1960))-i,10n?16:n,Up===null)var i=!1;else{if(n=Up,Up=null,MM=0,zi&6)throw Error(je(331));var s=zi;for(zi|=4,ft=n.current;ft!==null;){var o=ft,r=o.child;if(ft.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lHs()-UK?bv(n,0):$K|=t),sl(n,e)}function Hhe(n,e){e===0&&(n.mode&1?(e=rT,rT<<=1,!(rT&130023424)&&(rT=4194304)):e=1);var t=pa();n=pg(n,e),n!==null&&(UN(n,e,t),sl(n,t))}function uLe(n){var e=n.memoizedState,t=0;e!==null&&(t=e.retryLane),Hhe(n,t)}function fLe(n,e){var t=0;switch(n.tag){case 13:var i=n.stateNode,s=n.memoizedState;s!==null&&(t=s.retryLane);break;case 19:i=n.stateNode;break;default:throw Error(je(314))}i!==null&&i.delete(e),Hhe(n,t)}var Vhe;Vhe=function(n,e,t){if(n!==null)if(n.memoizedProps!==e.pendingProps||il.current)Xa=!0;else{if(!(n.lanes&t)&&!(e.flags&128))return Xa=!1,eLe(n,e,t);Xa=!!(n.flags&131072)}else Xa=!1,is&&e.flags&1048576&&Ude(e,xM,e.index);switch(e.lanes=0,e.tag){case 2:var i=e.type;uR(n,e),n=e.pendingProps;var s=Vy(e,$r.current);K0(e,t),s=BK(null,e,i,n,s,t);var o=WK();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,nl(i)?(o=!0,yM(e)):o=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,MK(e),s.updater=a5,e.stateNode=s,s._reactInternals=e,_B(e,i,n,t),e=wB(null,e,i,!0,o,t)):(e.tag=0,is&&o&&kK(e),ra(null,e,s,t),e=e.child),e;case 16:i=e.elementType;e:{switch(uR(n,e),n=e.pendingProps,s=i._init,i=s(i._payload),e.type=i,s=e.tag=pLe(i),n=wd(i,n),s){case 0:e=vB(null,e,i,n,t);break e;case 1:e=nee(null,e,i,n,t);break e;case 11:e=tee(null,e,i,n,t);break e;case 14:e=iee(null,e,i,wd(i.type,n),t);break e}throw Error(je(306,i,""))}return e;case 0:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),vB(n,e,i,s,t);case 1:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),nee(n,e,i,s,t);case 3:e:{if(xhe(e),n===null)throw Error(je(387));i=e.pendingProps,o=e.memoizedState,s=o.element,Xde(n,e),IM(e,i,null,t);var r=e.memoizedState;if(i=r.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:r.cache,pendingSuspenseBoundaries:r.pendingSuspenseBoundaries,transitions:r.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){s=Uy(Error(je(423)),e),e=see(n,e,i,t,s);break e}else if(i!==s){s=Uy(Error(je(424)),e),e=see(n,e,i,t,s);break e}else for(jl=gm(e.stateNode.containerInfo.firstChild),Ul=e,is=!0,Ed=null,t=Yde(e,null,i,t),e.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{if(zy(),i===s){e=mg(n,e,t);break e}ra(n,e,i,t)}e=e.child}return e;case 5:return Qde(e),n===null&&gB(e),i=e.type,s=e.pendingProps,o=n!==null?n.memoizedProps:null,r=s.children,cB(i,s)?r=null:o!==null&&cB(i,o)&&(e.flags|=32),She(n,e),ra(n,e,r,t),e.child;case 6:return n===null&&gB(e),null;case 13:return Lhe(n,e,t);case 4:return AK(e,e.stateNode.containerInfo),i=e.pendingProps,n===null?e.child=jy(e,null,i,t):ra(n,e,i,t),e.child;case 11:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),tee(n,e,i,s,t);case 7:return ra(n,e,e.pendingProps,t),e.child;case 8:return ra(n,e,e.pendingProps.children,t),e.child;case 12:return ra(n,e,e.pendingProps.children,t),e.child;case 10:e:{if(i=e.type._context,s=e.pendingProps,o=e.memoizedProps,r=s.value,zn(LM,i._currentValue),i._currentValue=r,o!==null)if(Zd(o.value,r)){if(o.children===s.children&&!il.current){e=mg(n,e,t);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){r=o.child;for(var l=a.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=tg(-1,t&-t),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=t,l=o.alternate,l!==null&&(l.lanes|=t),pB(o.return,t,e),a.lanes|=t;break}l=l.next}}else if(o.tag===10)r=o.type===e.type?null:o.child;else if(o.tag===18){if(r=o.return,r===null)throw Error(je(341));r.lanes|=t,a=r.alternate,a!==null&&(a.lanes|=t),pB(r,t,e),r=o.sibling}else r=o.child;if(r!==null)r.return=o;else for(r=o;r!==null;){if(r===e){r=null;break}if(o=r.sibling,o!==null){o.return=r.return,r=o;break}r=r.return}o=r}ra(n,e,s.children,t),e=e.child}return e;case 9:return s=e.type,i=e.pendingProps.children,K0(e,t),s=qc(s),i=i(s),e.flags|=1,ra(n,e,i,t),e.child;case 14:return i=e.type,s=wd(i,e.pendingProps),s=wd(i.type,s),iee(n,e,i,s,t);case 15:return Che(n,e,e.type,e.pendingProps,t);case 17:return i=e.type,s=e.pendingProps,s=e.elementType===i?s:wd(i,s),uR(n,e),e.tag=1,nl(i)?(n=!0,yM(e)):n=!1,K0(e,t),bhe(e,i,s),_B(e,i,s,t),wB(null,e,i,!0,n,t);case 19:return khe(n,e,t);case 22:return yhe(n,e,t)}throw Error(je(156,e.tag))};function zhe(n,e){return pde(n,e)}function gLe(n,e,t,i){this.tag=n,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wc(n,e,t,i){return new gLe(n,e,t,i)}function YK(n){return n=n.prototype,!(!n||!n.isReactComponent)}function pLe(n){if(typeof n=="function")return YK(n)?1:0;if(n!=null){if(n=n.$$typeof,n===gK)return 11;if(n===pK)return 14}return 2}function bm(n,e){var t=n.alternate;return t===null?(t=Wc(n.tag,e,n.key,n.mode),t.elementType=n.elementType,t.type=n.type,t.stateNode=n.stateNode,t.alternate=n,n.alternate=t):(t.pendingProps=e,t.type=n.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=n.flags&14680064,t.childLanes=n.childLanes,t.lanes=n.lanes,t.child=n.child,t.memoizedProps=n.memoizedProps,t.memoizedState=n.memoizedState,t.updateQueue=n.updateQueue,e=n.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},t.sibling=n.sibling,t.index=n.index,t.ref=n.ref,t}function pR(n,e,t,i,s,o){var r=2;if(i=n,typeof n=="function")YK(n)&&(r=1);else if(typeof n=="string")r=5;else e:switch(n){case HC:return vv(t.children,s,o,e);case fK:r=8,s|=8;break;case V6:return n=Wc(12,t,e,s|2),n.elementType=V6,n.lanes=o,n;case z6:return n=Wc(13,t,e,s),n.elementType=z6,n.lanes=o,n;case j6:return n=Wc(19,t,e,s),n.elementType=j6,n.lanes=o,n;case Qce:return d5(t,s,o,e);default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case Zce:r=10;break e;case Xce:r=9;break e;case gK:r=11;break e;case pK:r=14;break e;case Cp:r=16,i=null;break e}throw Error(je(130,n==null?n:typeof n,""))}return e=Wc(r,t,e,s),e.elementType=n,e.type=i,e.lanes=o,e}function vv(n,e,t,i){return n=Wc(7,n,i,e),n.lanes=t,n}function d5(n,e,t,i){return n=Wc(22,n,i,e),n.elementType=Qce,n.lanes=t,n.stateNode={isHidden:!1},n}function K8(n,e,t){return n=Wc(6,n,null,e),n.lanes=t,n}function G8(n,e,t){return e=Wc(4,n.children!==null?n.children:[],n.key,e),e.lanes=t,e.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},e}function mLe(n,e,t,i,s){this.tag=e,this.containerInfo=n,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=E8(0),this.expirationTimes=E8(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=E8(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function ZK(n,e,t,i,s,o,r,a,l){return n=new mLe(n,e,t,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Wc(3,null,null,e),n.current=o,o.stateNode=n,o.memoizedState={element:i,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},MK(o),n}function _Le(n,e,t){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qhe)}catch(n){console.error(n)}}qhe(),qce.exports=rc;var yLe=qce.exports,mee=yLe;W6.createRoot=mee.createRoot,W6.hydrateRoot=mee.hydrateRoot;function fo(n){if(typeof n=="string"||typeof n=="number")return""+n;let e="";if(Array.isArray(n))for(let t=0,i;t{}};function p5(){for(var n=0,e=arguments.length,t={},i;n=0&&(i=t.slice(s+1),t=t.slice(0,s)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:i}})}mR.prototype=p5.prototype={constructor:mR,on:function(n,e){var t=this._,i=xLe(n+"",t),s,o=-1,r=i.length;if(arguments.length<2){for(;++o0)for(var t=new Array(s),i=0,s,o;i=0&&(e=n.slice(0,t))!=="xmlns"&&(n=n.slice(t+1)),bee.hasOwnProperty(e)?{space:bee[e],local:n}:n}function kLe(n){return function(){var e=this.ownerDocument,t=this.namespaceURI;return t===RB&&e.documentElement.namespaceURI===RB?e.createElement(n):e.createElementNS(t,n)}}function ILe(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function Khe(n){var e=m5(n);return(e.local?ILe:kLe)(e)}function ELe(){}function eG(n){return n==null?ELe:function(){return this.querySelector(n)}}function NLe(n){typeof n!="function"&&(n=eG(n));for(var e=this._groups,t=e.length,i=new Array(t),s=0;s=w&&(w=v+1);!(S=m[w])&&++w=0;)(r=i[s])&&(o&&r.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(r,o),o=r);return this}function eke(n){n||(n=tke);function e(h,u){return h&&u?n(h.__data__,u.__data__):!h-!u}for(var t=this._groups,i=t.length,s=new Array(i),o=0;oe?1:n>=e?0:NaN}function ike(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function nke(){return Array.from(this)}function ske(){for(var n=this._groups,e=0,t=n.length;e1?this.each((e==null?pke:typeof e=="function"?_ke:mke)(n,e,t??"")):Ky(this.node(),n)}function Ky(n,e){return n.style.getPropertyValue(e)||Qhe(n).getComputedStyle(n,null).getPropertyValue(e)}function vke(n){return function(){delete this[n]}}function wke(n,e){return function(){this[n]=e}}function Cke(n,e){return function(){var t=e.apply(this,arguments);t==null?delete this[n]:this[n]=t}}function yke(n,e){return arguments.length>1?this.each((e==null?vke:typeof e=="function"?Cke:wke)(n,e)):this.node()[n]}function Jhe(n){return n.trim().split(/^|\s+/)}function tG(n){return n.classList||new eue(n)}function eue(n){this._node=n,this._names=Jhe(n.getAttribute("class")||"")}eue.prototype={add:function(n){var e=this._names.indexOf(n);e<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var e=this._names.indexOf(n);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function tue(n,e){for(var t=tG(n),i=-1,s=e.length;++i=0&&(t=e.slice(i+1),e=e.slice(0,i)),{type:e,name:t}})}function Zke(n){return function(){var e=this.__on;if(e){for(var t=0,i=-1,s=e.length,o;t()=>n;function MB(n,{sourceEvent:e,subject:t,target:i,identifier:s,active:o,x:r,y:a,dx:l,dy:c,dispatch:d}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:t,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}MB.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function rIe(n){return!n.ctrlKey&&!n.button}function aIe(){return this.parentNode}function lIe(n,e){return e??{x:n.x,y:n.y}}function cIe(){return navigator.maxTouchPoints||"ontouchstart"in this}function aue(){var n=rIe,e=aIe,t=lIe,i=cIe,s={},o=p5("start","drag","end"),r=0,a,l,c,d,h=0;function u(C){C.on("mousedown.drag",f).filter(i).on("touchstart.drag",m).on("touchmove.drag",b,oIe).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(C,S){if(!(d||!n.call(this,C,S))){var L=w(this,e.call(this,C,S),C,S,"mouse");L&&(Pl(C.view).on("mousemove.drag",g,HI).on("mouseup.drag",p,HI),oue(C.view),Y8(C),c=!1,a=C.clientX,l=C.clientY,L("start",C))}}function g(C){if(Y0(C),!c){var S=C.clientX-a,L=C.clientY-l;c=S*S+L*L>h}s.mouse("drag",C)}function p(C){Pl(C.view).on("mousemove.drag mouseup.drag",null),rue(C.view,c),Y0(C),s.mouse("end",C)}function m(C,S){if(n.call(this,C,S)){var L=C.changedTouches,x=e.call(this,C,S),I=L.length,E,R;for(E=0;E>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?vT(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?vT(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=hIe.exec(n))?new Qa(e[1],e[2],e[3],1):(e=uIe.exec(n))?new Qa(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=fIe.exec(n))?vT(e[1],e[2],e[3],e[4]):(e=gIe.exec(n))?vT(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=pIe.exec(n))?Lee(e[1],e[2]/100,e[3]/100,1):(e=mIe.exec(n))?Lee(e[1],e[2]/100,e[3]/100,e[4]):vee.hasOwnProperty(n)?yee(vee[n]):n==="transparent"?new Qa(NaN,NaN,NaN,0):null}function yee(n){return new Qa(n>>16&255,n>>8&255,n&255,1)}function vT(n,e,t,i){return i<=0&&(n=e=t=NaN),new Qa(n,e,t,i)}function vIe(n){return n instanceof ZN||(n=H1(n)),n?(n=n.rgb(),new Qa(n.r,n.g,n.b,n.opacity)):new Qa}function AB(n,e,t,i){return arguments.length===1?vIe(n):new Qa(n,e,t,i??1)}function Qa(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}iG(Qa,AB,lue(ZN,{brighter(n){return n=n==null?FM:Math.pow(FM,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?VI:Math.pow(VI,n),new Qa(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Qa(wv(this.r),wv(this.g),wv(this.b),BM(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:See,formatHex:See,formatHex8:wIe,formatRgb:xee,toString:xee}));function See(){return`#${ev(this.r)}${ev(this.g)}${ev(this.b)}`}function wIe(){return`#${ev(this.r)}${ev(this.g)}${ev(this.b)}${ev((isNaN(this.opacity)?1:this.opacity)*255)}`}function xee(){const n=BM(this.opacity);return`${n===1?"rgb(":"rgba("}${wv(this.r)}, ${wv(this.g)}, ${wv(this.b)}${n===1?")":`, ${n})`}`}function BM(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function wv(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function ev(n){return n=wv(n),(n<16?"0":"")+n.toString(16)}function Lee(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Od(n,e,t,i)}function cue(n){if(n instanceof Od)return new Od(n.h,n.s,n.l,n.opacity);if(n instanceof ZN||(n=H1(n)),!n)return new Od;if(n instanceof Od)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Od(r,a,l,n.opacity)}function CIe(n,e,t,i){return arguments.length===1?cue(n):new Od(n,e,t,i??1)}function Od(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}iG(Od,CIe,lue(ZN,{brighter(n){return n=n==null?FM:Math.pow(FM,n),new Od(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?VI:Math.pow(VI,n),new Od(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Qa(Z8(n>=240?n-240:n+120,s,i),Z8(n,s,i),Z8(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Od(kee(this.h),wT(this.s),wT(this.l),BM(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=BM(this.opacity);return`${n===1?"hsl(":"hsla("}${kee(this.h)}, ${wT(this.s)*100}%, ${wT(this.l)*100}%${n===1?")":`, ${n})`}`}}));function kee(n){return n=(n||0)%360,n<0?n+360:n}function wT(n){return Math.max(0,Math.min(1,n||0))}function Z8(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const nG=n=>()=>n;function yIe(n,e){return function(t){return n+t*e}}function SIe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function xIe(n){return(n=+n)==1?due:function(e,t){return t-e?SIe(e,t,n):nG(isNaN(e)?t:e)}}function due(n,e){var t=e-n;return t?yIe(n,t):nG(isNaN(n)?e:n)}const WM=function n(e){var t=xIe(e);function i(s,o){var r=t((s=AB(s)).r,(o=AB(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=due(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function LIe(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,i=e.slice(),s;return function(o){for(s=0;st&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:jh(i,s)})),t=X8.lastIndex;return t180?d+=360:d-c>180&&(c+=360),u.push({i:h.push(s(h)+"rotate(",null,i)-2,x:jh(c,d)})):d&&h.push(s(h)+"rotate("+d+i)}function a(c,d,h,u){c!==d?u.push({i:h.push(s(h)+"skewX(",null,i)-2,x:jh(c,d)}):d&&h.push(s(h)+"skewX("+d+i)}function l(c,d,h,u,f,g){if(c!==h||d!==u){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:jh(c,h)},{i:p-2,x:jh(d,u)})}else(h!==1||u!==1)&&f.push(s(f)+"scale("+h+","+u+")")}return function(c,d){var h=[],u=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,h,u),r(c.rotate,d.rotate,h,u),a(c.skewX,d.skewX,h,u),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,h,u),c=d=null,function(f){for(var g=-1,p=u.length,m;++g=0&&n._call.call(void 0,e),n=n._next;--Gy}function Nee(){V1=(VM=jI.now())+_5,Gy=SL=0;try{HIe()}finally{Gy=0,zIe(),V1=0}}function VIe(){var n=jI.now(),e=n-VM;e>gue&&(_5-=e,VM=n)}function zIe(){for(var n,e=HM,t,i=1/0;e;)e._call?(i>e._time&&(i=e._time),n=e,e=e._next):(t=e._next,e._next=null,e=n?n._next=t:HM=t);xL=n,FB(i)}function FB(n){if(!Gy){SL&&(SL=clearTimeout(SL));var e=n-V1;e>24?(n<1/0&&(SL=setTimeout(Nee,n-jI.now()-_5)),Ox&&(Ox=clearInterval(Ox))):(Ox||(VM=jI.now(),Ox=setInterval(VIe,gue)),Gy=1,pue(Nee))}}function Dee(n,e,t){var i=new zM;return e=e==null?0:+e,i.restart(s=>{i.stop(),n(s+e)},e,t),i}var jIe=p5("start","end","cancel","interrupt"),$Ie=[],_ue=0,Tee=1,BB=2,bR=3,Ree=4,WB=5,vR=6;function b5(n,e,t,i,s,o){var r=n.__transition;if(!r)n.__transition={};else if(t in r)return;UIe(n,t,{name:e,index:i,group:s,on:jIe,tween:$Ie,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:_ue})}function oG(n,e){var t=ah(n,e);if(t.state>_ue)throw new Error("too late; already scheduled");return t}function Du(n,e){var t=ah(n,e);if(t.state>bR)throw new Error("too late; already running");return t}function ah(n,e){var t=n.__transition;if(!t||!(t=t[e]))throw new Error("transition not found");return t}function UIe(n,e,t){var i=n.__transition,s;i[e]=t,t.timer=mue(o,0,t.time);function o(c){t.state=Tee,t.timer.restart(r,t.delay,t.time),t.delay<=c&&r(c-t.delay)}function r(c){var d,h,u,f;if(t.state!==Tee)return l();for(d in i)if(f=i[d],f.name===t.name){if(f.state===bR)return Dee(r);f.state===Ree?(f.state=vR,f.timer.stop(),f.on.call("interrupt",n,n.__data__,f.index,f.group),delete i[d]):+dBB&&i.state=0&&(e=e.slice(0,t)),!e||e==="start"})}function CEe(n,e,t){var i,s,o=wEe(e)?oG:Du;return function(){var r=o(this,n),a=r.on;a!==i&&(s=(i=a).copy()).on(e,t),r.on=s}}function yEe(n,e){var t=this._id;return arguments.length<2?ah(this.node(),t).on.on(n):this.each(CEe(t,n,e))}function SEe(n){return function(){var e=this.parentNode;for(var t in this.__transition)if(+t!==n)return;e&&e.removeChild(this)}}function xEe(){return this.on("end.remove",SEe(this._id))}function LEe(n){var e=this._name,t=this._id;typeof n!="function"&&(n=eG(n));for(var i=this._groups,s=i.length,o=new Array(s),r=0;r()=>n;function ZEe(n,{sourceEvent:e,target:t,transform:i,dispatch:s}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:t,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:s}})}function Wf(n,e,t){this.k=n,this.x=e,this.y=t}Wf.prototype={constructor:Wf,scale:function(n){return n===1?this:new Wf(this.k*n,this.x,this.y)},translate:function(n,e){return n===0&e===0?this:new Wf(this.k,this.x+this.k*n,this.y+this.k*e)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var v5=new Wf(1,0,0);Cue.prototype=Wf.prototype;function Cue(n){for(;!n.__zoom;)if(!(n=n.parentNode))return v5;return n.__zoom}function Q8(n){n.stopImmediatePropagation()}function Fx(n){n.preventDefault(),n.stopImmediatePropagation()}function XEe(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function QEe(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function Mee(){return this.__zoom||v5}function JEe(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function eNe(){return navigator.maxTouchPoints||"ontouchstart"in this}function tNe(n,e,t){var i=n.invertX(e[0][0])-t[0][0],s=n.invertX(e[1][0])-t[1][0],o=n.invertY(e[0][1])-t[0][1],r=n.invertY(e[1][1])-t[1][1];return n.translate(s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s),r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r))}function yue(){var n=XEe,e=QEe,t=tNe,i=JEe,s=eNe,o=[0,1/0],r=[[-1/0,-1/0],[1/0,1/0]],a=250,l=_R,c=p5("start","zoom","end"),d,h,u,f=500,g=150,p=0,m=10;function b(P){P.property("__zoom",Mee).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",R).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",A).on("touchend.zoom touchcancel.zoom",W).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(P,B,V,K){var z=P.selection?P.selection():P;z.property("__zoom",Mee),P!==z?S(P,B,V,K):z.interrupt().each(function(){L(this,arguments).event(K).start().zoom(null,typeof B=="function"?B.apply(this,arguments):B).end()})},b.scaleBy=function(P,B,V,K){b.scaleTo(P,function(){var z=this.__zoom.k,j=typeof B=="function"?B.apply(this,arguments):B;return z*j},V,K)},b.scaleTo=function(P,B,V,K){b.transform(P,function(){var z=e.apply(this,arguments),j=this.__zoom,X=V==null?C(z):typeof V=="function"?V.apply(this,arguments):V,Y=j.invert(X),te=typeof B=="function"?B.apply(this,arguments):B;return t(w(v(j,te),X,Y),z,r)},V,K)},b.translateBy=function(P,B,V,K){b.transform(P,function(){return t(this.__zoom.translate(typeof B=="function"?B.apply(this,arguments):B,typeof V=="function"?V.apply(this,arguments):V),e.apply(this,arguments),r)},null,K)},b.translateTo=function(P,B,V,K,z){b.transform(P,function(){var j=e.apply(this,arguments),X=this.__zoom,Y=K==null?C(j):typeof K=="function"?K.apply(this,arguments):K;return t(v5.translate(Y[0],Y[1]).scale(X.k).translate(typeof B=="function"?-B.apply(this,arguments):-B,typeof V=="function"?-V.apply(this,arguments):-V),j,r)},K,z)};function v(P,B){return B=Math.max(o[0],Math.min(o[1],B)),B===P.k?P:new Wf(B,P.x,P.y)}function w(P,B,V){var K=B[0]-V[0]*P.k,z=B[1]-V[1]*P.k;return K===P.x&&z===P.y?P:new Wf(P.k,K,z)}function C(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function S(P,B,V,K){P.on("start.zoom",function(){L(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(K).end()}).tween("zoom",function(){var z=this,j=arguments,X=L(z,j).event(K),Y=e.apply(z,j),te=V==null?C(Y):typeof V=="function"?V.apply(z,j):V,ce=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),Ce=z.__zoom,xe=typeof B=="function"?B.apply(z,j):B,Be=l(Ce.invert(te).concat(ce/Ce.k),xe.invert(te).concat(ce/xe.k));return function(Ee){if(Ee===1)Ee=xe;else{var Le=Be(Ee),ze=ce/Le[2];Ee=new Wf(ze,te[0]-Le[0]*ze,te[1]-Le[1]*ze)}X.zoom(null,Ee)}})}function L(P,B,V){return!V&&P.__zooming||new x(P,B)}function x(P,B){this.that=P,this.args=B,this.active=0,this.sourceEvent=null,this.extent=e.apply(P,B),this.taps=0}x.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,B){return this.mouse&&P!=="mouse"&&(this.mouse[1]=B.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=B.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=B.invert(this.touch1[0])),this.that.__zoom=B,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var B=Pl(this.that).datum();c.call(P,this.that,new ZEe(P,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:c}),B)}};function I(P,...B){if(!n.apply(this,arguments))return;var V=L(this,B).event(P),K=this.__zoom,z=Math.max(o[0],Math.min(o[1],K.k*Math.pow(2,i.apply(this,arguments)))),j=xd(P);if(V.wheel)(V.mouse[0][0]!==j[0]||V.mouse[0][1]!==j[1])&&(V.mouse[1]=K.invert(V.mouse[0]=j)),clearTimeout(V.wheel);else{if(K.k===z)return;V.mouse=[j,K.invert(j)],wR(this),V.start()}Fx(P),V.wheel=setTimeout(X,g),V.zoom("mouse",t(w(v(K,z),V.mouse[0],V.mouse[1]),V.extent,r));function X(){V.wheel=null,V.end()}}function E(P,...B){if(u||!n.apply(this,arguments))return;var V=P.currentTarget,K=L(this,B,!0).event(P),z=Pl(P.view).on("mousemove.zoom",te,!0).on("mouseup.zoom",ce,!0),j=xd(P,V),X=P.clientX,Y=P.clientY;oue(P.view),Q8(P),K.mouse=[j,this.__zoom.invert(j)],wR(this),K.start();function te(Ce){if(Fx(Ce),!K.moved){var xe=Ce.clientX-X,Be=Ce.clientY-Y;K.moved=xe*xe+Be*Be>p}K.event(Ce).zoom("mouse",t(w(K.that.__zoom,K.mouse[0]=xd(Ce,V),K.mouse[1]),K.extent,r))}function ce(Ce){z.on("mousemove.zoom mouseup.zoom",null),rue(Ce.view,K.moved),Fx(Ce),K.event(Ce).end()}}function R(P,...B){if(n.apply(this,arguments)){var V=this.__zoom,K=xd(P.changedTouches?P.changedTouches[0]:P,this),z=V.invert(K),j=V.k*(P.shiftKey?.5:2),X=t(w(v(V,j),K,z),e.apply(this,B),r);Fx(P),a>0?Pl(this).transition().duration(a).call(S,X,K,P):Pl(this).call(b.transform,X,K,P)}}function M(P,...B){if(n.apply(this,arguments)){var V=P.touches,K=V.length,z=L(this,B,P.changedTouches.length===K).event(P),j,X,Y,te;for(Q8(P),X=0;X"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:e,sourceHandle:t,targetHandle:i})=>`Couldn't create edge for ${n} handle id: "${n==="source"?t:i}", edge id: ${e}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},$I=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Sue=["Enter"," ","Escape"],xue={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:n,x:e,y:t})=>`Moved selected node ${n}. New position, x: ${e}, y: ${t}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Yy;(function(n){n.Strict="strict",n.Loose="loose"})(Yy||(Yy={}));var Cv;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Cv||(Cv={}));var UI;(function(n){n.Partial="partial",n.Full="full"})(UI||(UI={}));const Lue={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Df;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Df||(Df={}));var z1;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(z1||(z1={}));var Nt;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(Nt||(Nt={}));const Aee={[Nt.Left]:Nt.Right,[Nt.Right]:Nt.Left,[Nt.Top]:Nt.Bottom,[Nt.Bottom]:Nt.Top};function kue(n){return n===null?null:n?"valid":"invalid"}const Iue=n=>"id"in n&&"source"in n&&"target"in n,iNe=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),aG=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),XN=(n,e=[0,0])=>{const{width:t,height:i}=Wg(n),s=n.origin??e,o=t*s[0],r=i*s[1];return{x:n.position.x-o,y:n.position.y-r}},nNe=(n,e={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const t=n.reduce((i,s)=>{const o=typeof s=="string";let r=!e.nodeLookup&&!o?s:void 0;e.nodeLookup&&(r=o?e.nodeLookup.get(s):aG(s)?s:e.nodeLookup.get(s.id));const a=r?jM(r,e.nodeOrigin):{x:0,y:0,x2:0,y2:0};return w5(i,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return C5(t)},QN=(n,e={})=>{let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0},i=!1;return n.forEach(s=>{(e.filter===void 0||e.filter(s))&&(t=w5(t,jM(s)),i=!0)}),i?C5(t):{x:0,y:0,width:0,height:0}},lG=(n,e,[t,i,s]=[0,0,1],o=!1,r=!1)=>{const a={...eD(e,[t,i,s]),width:e.width/s,height:e.height/s},l=[];for(const c of n.values()){const{measured:d,selectable:h=!0,hidden:u=!1}=c;if(r&&!h||u)continue;const f=d.width??c.width??c.initialWidth??null,g=d.height??c.height??c.initialHeight??null,p=qI(a,Xy(c)),m=(f??0)*(g??0),b=o&&p>0;(!c.internals.handleBounds||b||p>=m||c.dragging)&&l.push(c)}return l},sNe=(n,e)=>{const t=new Set;return n.forEach(i=>{t.add(i.id)}),e.filter(i=>t.has(i.source)||t.has(i.target))};function oNe(n,e){const t=new Map,i=e!=null&&e.nodes?new Set(e.nodes.map(s=>s.id)):null;return n.forEach(s=>{s.measured.width&&s.measured.height&&((e==null?void 0:e.includeHiddenNodes)||!s.hidden)&&(!i||i.has(s.id))&&t.set(s.id,s)}),t}async function rNe({nodes:n,width:e,height:t,panZoom:i,minZoom:s,maxZoom:o},r){if(n.size===0)return Promise.resolve(!0);const a=oNe(n,r),l=QN(a),c=cG(l,e,t,(r==null?void 0:r.minZoom)??s,(r==null?void 0:r.maxZoom)??o,(r==null?void 0:r.padding)??.1);return await i.setViewport(c,{duration:r==null?void 0:r.duration,ease:r==null?void 0:r.ease,interpolate:r==null?void 0:r.interpolate}),Promise.resolve(!0)}function Eue({nodeId:n,nextPosition:e,nodeLookup:t,nodeOrigin:i=[0,0],nodeExtent:s,onError:o}){const r=t.get(n),a=r.parentId?t.get(r.parentId):void 0,{x:l,y:c}=a?a.internals.positionAbsolute:{x:0,y:0},d=r.origin??i;let h=r.extent||s;if(r.extent==="parent"&&!r.expandParent)if(!a)o==null||o("005",bu.error005());else{const f=a.measured.width,g=a.measured.height;f&&g&&(h=[[l,c],[l+f,c+g]])}else a&&Qy(r.extent)&&(h=[[r.extent[0][0]+l,r.extent[0][1]+c],[r.extent[1][0]+l,r.extent[1][1]+c]]);const u=Qy(h)?j1(e,h,r.measured):e;return(r.measured.width===void 0||r.measured.height===void 0)&&(o==null||o("015",bu.error015())),{position:{x:u.x-l+(r.measured.width??0)*d[0],y:u.y-c+(r.measured.height??0)*d[1]},positionAbsolute:u}}async function aNe({nodesToRemove:n=[],edgesToRemove:e=[],nodes:t,edges:i,onBeforeDelete:s}){const o=new Set(n.map(u=>u.id)),r=[];for(const u of t){if(u.deletable===!1)continue;const f=o.has(u.id),g=!f&&u.parentId&&r.find(p=>p.id===u.parentId);(f||g)&&r.push(u)}const a=new Set(e.map(u=>u.id)),l=i.filter(u=>u.deletable!==!1),d=sNe(r,l);for(const u of l)a.has(u.id)&&!d.find(g=>g.id===u.id)&&d.push(u);if(!s)return{edges:d,nodes:r};const h=await s({nodes:r,edges:d});return typeof h=="boolean"?h?{edges:d,nodes:r}:{edges:[],nodes:[]}:h}const Zy=(n,e=0,t=1)=>Math.min(Math.max(n,e),t),j1=(n={x:0,y:0},e,t)=>({x:Zy(n.x,e[0][0],e[1][0]-((t==null?void 0:t.width)??0)),y:Zy(n.y,e[0][1],e[1][1]-((t==null?void 0:t.height)??0))});function Nue(n,e,t){const{width:i,height:s}=Wg(t),{x:o,y:r}=t.internals.positionAbsolute;return j1(n,[[o,r],[o+i,r+s]],e)}const Pee=(n,e,t)=>nt?-Zy(Math.abs(n-t),1,e)/e:0,Due=(n,e,t=15,i=40)=>{const s=Pee(n.x,i,e.width-i)*t,o=Pee(n.y,i,e.height-i)*t;return[s,o]},w5=(n,e)=>({x:Math.min(n.x,e.x),y:Math.min(n.y,e.y),x2:Math.max(n.x2,e.x2),y2:Math.max(n.y2,e.y2)}),HB=({x:n,y:e,width:t,height:i})=>({x:n,y:e,x2:n+t,y2:e+i}),C5=({x:n,y:e,x2:t,y2:i})=>({x:n,y:e,width:t-n,height:i-e}),Xy=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=aG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,width:((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0,height:((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0}},jM=(n,e=[0,0])=>{var s,o;const{x:t,y:i}=aG(n)?n.internals.positionAbsolute:XN(n,e);return{x:t,y:i,x2:t+(((s=n.measured)==null?void 0:s.width)??n.width??n.initialWidth??0),y2:i+(((o=n.measured)==null?void 0:o.height)??n.height??n.initialHeight??0)}},Tue=(n,e)=>C5(w5(HB(n),HB(e))),qI=(n,e)=>{const t=Math.max(0,Math.min(n.x+n.width,e.x+e.width)-Math.max(n.x,e.x)),i=Math.max(0,Math.min(n.y+n.height,e.y+e.height)-Math.max(n.y,e.y));return Math.ceil(t*i)},Oee=n=>Bd(n.width)&&Bd(n.height)&&Bd(n.x)&&Bd(n.y),Bd=n=>!isNaN(n)&&isFinite(n),lNe=(n,e)=>{},JN=(n,e=[1,1])=>({x:e[0]*Math.round(n.x/e[0]),y:e[1]*Math.round(n.y/e[1])}),eD=({x:n,y:e},[t,i,s],o=!1,r=[1,1])=>{const a={x:(n-t)/s,y:(e-i)/s};return o?JN(a,r):a},$M=({x:n,y:e},[t,i,s])=>({x:n*s+t,y:e*s+i});function nC(n,e){if(typeof n=="number")return Math.floor((e-e/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(t)}if(typeof n=="string"&&n.endsWith("%")){const t=parseFloat(n);if(!Number.isNaN(t))return Math.floor(e*t*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cNe(n,e,t){if(typeof n=="string"||typeof n=="number"){const i=nC(n,t),s=nC(n,e);return{top:i,right:s,bottom:i,left:s,x:s*2,y:i*2}}if(typeof n=="object"){const i=nC(n.top??n.y??0,t),s=nC(n.bottom??n.y??0,t),o=nC(n.left??n.x??0,e),r=nC(n.right??n.x??0,e);return{top:i,right:r,bottom:s,left:o,x:o+r,y:i+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function dNe(n,e,t,i,s,o){const{x:r,y:a}=$M(n,[e,t,i]),{x:l,y:c}=$M({x:n.x+n.width,y:n.y+n.height},[e,t,i]),d=s-l,h=o-c;return{left:Math.floor(r),top:Math.floor(a),right:Math.floor(d),bottom:Math.floor(h)}}const cG=(n,e,t,i,s,o)=>{const r=cNe(o,e,t),a=(e-r.x)/n.width,l=(t-r.y)/n.height,c=Math.min(a,l),d=Zy(c,i,s),h=n.x+n.width/2,u=n.y+n.height/2,f=e/2-h*d,g=t/2-u*d,p=dNe(n,f,g,d,e,t),m={left:Math.min(p.left-r.left,0),top:Math.min(p.top-r.top,0),right:Math.min(p.right-r.right,0),bottom:Math.min(p.bottom-r.bottom,0)};return{x:f-m.left+m.right,y:g-m.top+m.bottom,zoom:d}},KI=()=>{var n;return typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)==null?void 0:n.indexOf("Mac"))>=0};function Qy(n){return n!=null&&n!=="parent"}function Wg(n){var e,t;return{width:((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth??0,height:((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight??0}}function Rue(n){var e,t;return(((e=n.measured)==null?void 0:e.width)??n.width??n.initialWidth)!==void 0&&(((t=n.measured)==null?void 0:t.height)??n.height??n.initialHeight)!==void 0}function Mue(n,e={width:0,height:0},t,i,s){const o={...n},r=i.get(t);if(r){const a=r.origin||s;o.x+=r.internals.positionAbsolute.x-(e.width??0)*a[0],o.y+=r.internals.positionAbsolute.y-(e.height??0)*a[1]}return o}function Fee(n,e){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}function hNe(){let n,e;return{promise:new Promise((i,s)=>{n=i,e=s}),resolve:n,reject:e}}function uNe(n){return{...xue,...n||{}}}function ok(n,{snapGrid:e=[0,0],snapToGrid:t=!1,transform:i,containerBounds:s}){const{x:o,y:r}=Wd(n),a=eD({x:o-((s==null?void 0:s.left)??0),y:r-((s==null?void 0:s.top)??0)},i),{x:l,y:c}=t?JN(a,e):a;return{xSnapped:l,ySnapped:c,...a}}const dG=n=>({width:n.offsetWidth,height:n.offsetHeight}),Aue=n=>{var e;return((e=n==null?void 0:n.getRootNode)==null?void 0:e.call(n))||(window==null?void 0:window.document)},fNe=["INPUT","SELECT","TEXTAREA"];function Pue(n){var i,s;const e=((s=(i=n.composedPath)==null?void 0:i.call(n))==null?void 0:s[0])||n.target;return(e==null?void 0:e.nodeType)!==1?!1:fNe.includes(e.nodeName)||e.hasAttribute("contenteditable")||!!e.closest(".nokey")}const Oue=n=>"clientX"in n,Wd=(n,e)=>{var o,r;const t=Oue(n),i=t?n.clientX:(o=n.touches)==null?void 0:o[0].clientX,s=t?n.clientY:(r=n.touches)==null?void 0:r[0].clientY;return{x:i-((e==null?void 0:e.left)??0),y:s-((e==null?void 0:e.top)??0)}},Bee=(n,e,t,i,s)=>{const o=e.querySelectorAll(`.${n}`);return!o||!o.length?null:Array.from(o).map(r=>{const a=r.getBoundingClientRect();return{id:r.getAttribute("data-handleid"),type:n,nodeId:s,position:r.getAttribute("data-handlepos"),x:(a.left-t.left)/i,y:(a.top-t.top)/i,...dG(r)}})};function Fue({sourceX:n,sourceY:e,targetX:t,targetY:i,sourceControlX:s,sourceControlY:o,targetControlX:r,targetControlY:a}){const l=n*.125+s*.375+r*.375+t*.125,c=e*.125+o*.375+a*.375+i*.125,d=Math.abs(l-n),h=Math.abs(c-e);return[l,c,d,h]}function ST(n,e){return n>=0?.5*n:e*25*Math.sqrt(-n)}function Wee({pos:n,x1:e,y1:t,x2:i,y2:s,c:o}){switch(n){case Nt.Left:return[e-ST(e-i,o),t];case Nt.Right:return[e+ST(i-e,o),t];case Nt.Top:return[e,t-ST(t-s,o)];case Nt.Bottom:return[e,t+ST(s-t,o)]}}function Bue({sourceX:n,sourceY:e,sourcePosition:t=Nt.Bottom,targetX:i,targetY:s,targetPosition:o=Nt.Top,curvature:r=.25}){const[a,l]=Wee({pos:t,x1:n,y1:e,x2:i,y2:s,c:r}),[c,d]=Wee({pos:o,x1:i,y1:s,x2:n,y2:e,c:r}),[h,u,f,g]=Fue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${n},${e} C${a},${l} ${c},${d} ${i},${s}`,h,u,f,g]}function Wue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const s=Math.abs(t-n)/2,o=t0}const mNe=({source:n,sourceHandle:e,target:t,targetHandle:i})=>`xy-edge__${n}${e||""}-${t}${i||""}`,_Ne=(n,e)=>e.some(t=>t.source===n.source&&t.target===n.target&&(t.sourceHandle===n.sourceHandle||!t.sourceHandle&&!n.sourceHandle)&&(t.targetHandle===n.targetHandle||!t.targetHandle&&!n.targetHandle)),bNe=(n,e,t={})=>{if(!n.source||!n.target)return e;const i=t.getEdgeId||mNe;let s;return Iue(n)?s={...n}:s={...n,id:i(n)},_Ne(s,e)?e:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,e.concat(s))};function Hue({sourceX:n,sourceY:e,targetX:t,targetY:i}){const[s,o,r,a]=Wue({sourceX:n,sourceY:e,targetX:t,targetY:i});return[`M ${n},${e}L ${t},${i}`,s,o,r,a]}const Hee={[Nt.Left]:{x:-1,y:0},[Nt.Right]:{x:1,y:0},[Nt.Top]:{x:0,y:-1},[Nt.Bottom]:{x:0,y:1}},vNe=({source:n,sourcePosition:e=Nt.Bottom,target:t})=>e===Nt.Left||e===Nt.Right?n.xMath.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2));function wNe({source:n,sourcePosition:e=Nt.Bottom,target:t,targetPosition:i=Nt.Top,center:s,offset:o,stepPosition:r}){const a=Hee[e],l=Hee[i],c={x:n.x+a.x*o,y:n.y+a.y*o},d={x:t.x+l.x*o,y:t.y+l.y*o},h=vNe({source:c,sourcePosition:e,target:d}),u=h.x!==0?"x":"y",f=h[u];let g=[],p,m;const b={x:0,y:0},v={x:0,y:0},[,,w,C]=Wue({sourceX:n.x,sourceY:n.y,targetX:t.x,targetY:t.y});if(a[u]*l[u]===-1){u==="x"?(p=s.x??c.x+(d.x-c.x)*r,m=s.y??(c.y+d.y)/2):(p=s.x??(c.x+d.x)/2,m=s.y??c.y+(d.y-c.y)*r);const L=[{x:p,y:c.y},{x:p,y:d.y}],x=[{x:c.x,y:m},{x:d.x,y:m}];a[u]===f?g=u==="x"?L:x:g=u==="x"?x:L}else{const L=[{x:c.x,y:d.y}],x=[{x:d.x,y:c.y}];if(u==="x"?g=a.x===f?x:L:g=a.y===f?L:x,e===i){const A=Math.abs(n[u]-t[u]);if(A<=o){const W=Math.min(o-1,o-A);a[u]===f?b[u]=(c[u]>n[u]?-1:1)*W:v[u]=(d[u]>t[u]?-1:1)*W}}if(e!==i){const A=u==="x"?"y":"x",W=a[u]===l[A],P=c[A]>d[A],B=c[A]=M?(p=(I.x+E.x)/2,m=g[0].y):(p=g[0].x,m=(I.y+E.y)/2)}return[[n,{x:c.x+b.x,y:c.y+b.y},...g,{x:d.x+v.x,y:d.y+v.y},t],p,m,w,C]}function CNe(n,e,t,i){const s=Math.min(Vee(n,e)/2,Vee(e,t)/2,i),{x:o,y:r}=e;if(n.x===o&&o===t.x||n.y===r&&r===t.y)return`L${o} ${r}`;if(n.y===r){const c=n.x{let C="";return w>0&&wt.id===e):n[0])||null}function zB(n,e){return n?typeof n=="string"?n:`${e?`${e}__`:""}${Object.keys(n).sort().map(i=>`${i}=${n[i]}`).join("&")}`:""}function SNe(n,{id:e,defaultColor:t,defaultMarkerStart:i,defaultMarkerEnd:s}){const o=new Set;return n.reduce((r,a)=>([a.markerStart||i,a.markerEnd||s].forEach(l=>{if(l&&typeof l=="object"){const c=zB(l,e);o.has(c)||(r.push({id:c,color:l.color||t,...l}),o.add(c))}}),r),[]).sort((r,a)=>r.id.localeCompare(a.id))}const Vue=1e3,xNe=10,hG={nodeOrigin:[0,0],nodeExtent:$I,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},LNe={...hG,checkEquality:!0};function uG(n,e){const t={...n};for(const i in e)e[i]!==void 0&&(t[i]=e[i]);return t}function kNe(n,e,t){const i=uG(hG,t);for(const s of n.values())if(s.parentId)gG(s,n,e,i);else{const o=XN(s,i.nodeOrigin),r=Qy(s.extent)?s.extent:i.nodeExtent,a=j1(o,r,Wg(s));s.internals.positionAbsolute=a}}function INe(n,e){if(!n.handles)return n.measured?e==null?void 0:e.internals.handleBounds:void 0;const t=[],i=[];for(const s of n.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:n.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?t.push(o):s.type==="target"&&i.push(o)}return{source:t,target:i}}function fG(n){return n==="manual"}function jB(n,e,t,i={}){var c,d;const s=uG(LNe,i),o={i:0},r=new Map(e),a=s!=null&&s.elevateNodesOnSelect&&!fG(s.zIndexMode)?Vue:0;let l=n.length>0;e.clear(),t.clear();for(const h of n){let u=r.get(h.id);if(s.checkEquality&&h===(u==null?void 0:u.internals.userNode))e.set(h.id,u);else{const f=XN(h,s.nodeOrigin),g=Qy(h.extent)?h.extent:s.nodeExtent,p=j1(f,g,Wg(h));u={...s.defaults,...h,measured:{width:(c=h.measured)==null?void 0:c.width,height:(d=h.measured)==null?void 0:d.height},internals:{positionAbsolute:p,handleBounds:INe(h,u),z:zue(h,a,s.zIndexMode),userNode:h}},e.set(h.id,u)}(u.measured===void 0||u.measured.width===void 0||u.measured.height===void 0)&&!u.hidden&&(l=!1),h.parentId&&gG(u,e,t,i,o)}return l}function ENe(n,e){if(!n.parentId)return;const t=e.get(n.parentId);t?t.set(n.id,n):e.set(n.parentId,new Map([[n.id,n]]))}function gG(n,e,t,i,s){const{elevateNodesOnSelect:o,nodeOrigin:r,nodeExtent:a,zIndexMode:l}=uG(hG,i),c=n.parentId,d=e.get(c);if(!d){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ENe(n,t),s&&!d.parentId&&d.internals.rootParentIndex===void 0&&l==="auto"&&(d.internals.rootParentIndex=++s.i,d.internals.z=d.internals.z+s.i*xNe),s&&d.internals.rootParentIndex!==void 0&&(s.i=d.internals.rootParentIndex);const h=o&&!fG(l)?Vue:0,{x:u,y:f,z:g}=NNe(n,d,r,a,h,l),{positionAbsolute:p}=n.internals,m=u!==p.x||f!==p.y;(m||g!==n.internals.z)&&e.set(n.id,{...n,internals:{...n.internals,positionAbsolute:m?{x:u,y:f}:p,z:g}})}function zue(n,e,t){const i=Bd(n.zIndex)?n.zIndex:0;return fG(t)?i:i+(n.selected?e:0)}function NNe(n,e,t,i,s,o){const{x:r,y:a}=e.internals.positionAbsolute,l=Wg(n),c=XN(n,t),d=Qy(n.extent)?j1(c,n.extent,l):c;let h=j1({x:r+d.x,y:a+d.y},i,l);n.extent==="parent"&&(h=Nue(h,l,e));const u=zue(n,s,o),f=e.internals.z??0;return{x:h.x,y:h.y,z:f>=u?f+1:u}}function pG(n,e,t,i=[0,0]){var r;const s=[],o=new Map;for(const a of n){const l=e.get(a.parentId);if(!l)continue;const c=((r=o.get(a.parentId))==null?void 0:r.expandedRect)??Xy(l),d=Tue(c,a.rect);o.set(a.parentId,{expandedRect:d,parent:l})}return o.size>0&&o.forEach(({expandedRect:a,parent:l},c)=>{var w;const d=l.internals.positionAbsolute,h=Wg(l),u=l.origin??i,f=a.x0||g>0||b||v)&&(s.push({id:c,type:"position",position:{x:l.position.x-f+b,y:l.position.y-g+v}}),(w=t.get(c))==null||w.forEach(C=>{n.some(S=>S.id===C.id)||s.push({id:C.id,type:"position",position:{x:C.position.x+f,y:C.position.y+g}})})),(h.width0){const f=pG(u,e,t,s);c.push(...f)}return{changes:c,updatedInternals:l}}async function TNe({delta:n,panZoom:e,transform:t,translateExtent:i,width:s,height:o}){if(!e||!n.x&&!n.y)return Promise.resolve(!1);const r=await e.setViewportConstrained({x:t[0]+n.x,y:t[1]+n.y,zoom:t[2]},[[0,0],[s,o]],i),a=!!r&&(r.x!==t[0]||r.y!==t[1]||r.k!==t[2]);return Promise.resolve(a)}function Uee(n,e,t,i,s,o){let r=s;const a=i.get(r)||new Map;i.set(r,a.set(t,e)),r=`${s}-${n}`;const l=i.get(r)||new Map;if(i.set(r,l.set(t,e)),o){r=`${s}-${n}-${o}`;const c=i.get(r)||new Map;i.set(r,c.set(t,e))}}function jue(n,e,t){n.clear(),e.clear();for(const i of t){const{source:s,target:o,sourceHandle:r=null,targetHandle:a=null}=i,l={edgeId:i.id,source:s,target:o,sourceHandle:r,targetHandle:a},c=`${s}-${r}--${o}-${a}`,d=`${o}-${a}--${s}-${r}`;Uee("source",l,d,n,s,r),Uee("target",l,c,n,o,a),e.set(i.id,i)}}function $ue(n,e){if(!n.parentId)return!1;const t=e.get(n.parentId);return t?t.selected?!0:$ue(t,e):!1}function qee(n,e,t){var s;let i=n;do{if((s=i==null?void 0:i.matches)!=null&&s.call(i,e))return!0;if(i===t)return!1;i=i==null?void 0:i.parentElement}while(i);return!1}function RNe(n,e,t,i){const s=new Map;for(const[o,r]of n)if((r.selected||r.id===i)&&(!r.parentId||!$ue(r,n))&&(r.draggable||e&&typeof r.draggable>"u")){const a=n.get(o);a&&s.set(o,{id:o,position:a.position||{x:0,y:0},distance:{x:t.x-a.internals.positionAbsolute.x,y:t.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return s}function J8({nodeId:n,dragItems:e,nodeLookup:t,dragging:i=!0}){var r,a,l;const s=[];for(const[c,d]of e){const h=(r=t.get(c))==null?void 0:r.internals.userNode;h&&s.push({...h,position:d.position,dragging:i})}if(!n)return[s[0],s];const o=(a=t.get(n))==null?void 0:a.internals.userNode;return[o?{...o,position:((l=e.get(n))==null?void 0:l.position)||o.position,dragging:i}:s[0],s]}function MNe({dragItems:n,snapGrid:e,x:t,y:i}){const s=n.values().next().value;if(!s)return null;const o={x:t-s.distance.x,y:i-s.distance.y},r=JN(o,e);return{x:r.x-o.x,y:r.y-o.y}}function ANe({onNodeMouseDown:n,getStoreItems:e,onDragStart:t,onDrag:i,onDragStop:s}){let o={x:null,y:null},r=0,a=new Map,l=!1,c={x:0,y:0},d=null,h=!1,u=null,f=!1,g=!1,p=null;function m({noDragClassName:v,handleSelector:w,domNode:C,isSelectable:S,nodeId:L,nodeClickDistance:x=0}){u=Pl(C);function I({x:A,y:W}){const{nodeLookup:P,nodeExtent:B,snapGrid:V,snapToGrid:K,nodeOrigin:z,onNodeDrag:j,onSelectionDrag:X,onError:Y,updateNodePositions:te}=e();o={x:A,y:W};let ce=!1;const Ce=a.size>1,xe=Ce&&B?HB(QN(a)):null,Be=Ce&&K?MNe({dragItems:a,snapGrid:V,x:A,y:W}):null;for(const[Ee,Le]of a){if(!P.has(Ee))continue;let ze={x:A-Le.distance.x,y:W-Le.distance.y};K&&(ze=Be?{x:Math.round(ze.x+Be.x),y:Math.round(ze.y+Be.y)}:JN(ze,V));let Ct=null;if(Ce&&B&&!Le.extent&&xe){const{positionAbsolute:tt}=Le.internals,_t=tt.x-xe.x+B[0][0],yi=tt.x+Le.measured.width-xe.x2+B[1][0],Pt=tt.y-xe.y+B[0][1],Cn=tt.y+Le.measured.height-xe.y2+B[1][1];Ct=[[_t,Pt],[yi,Cn]]}const{position:ct,positionAbsolute:Ue}=Eue({nodeId:Ee,nextPosition:ze,nodeLookup:P,nodeExtent:Ct||B,nodeOrigin:z,onError:Y});ce=ce||Le.position.x!==ct.x||Le.position.y!==ct.y,Le.position=ct,Le.internals.positionAbsolute=Ue}if(g=g||ce,!!ce&&(te(a,!0),p&&(i||j||!L&&X))){const[Ee,Le]=J8({nodeId:L,dragItems:a,nodeLookup:P});i==null||i(p,a,Ee,Le),j==null||j(p,Ee,Le),L||X==null||X(p,Le)}}async function E(){if(!d)return;const{transform:A,panBy:W,autoPanSpeed:P,autoPanOnNodeDrag:B}=e();if(!B){l=!1,cancelAnimationFrame(r);return}const[V,K]=Due(c,d,P);(V!==0||K!==0)&&(o.x=(o.x??0)-V/A[2],o.y=(o.y??0)-K/A[2],await W({x:V,y:K})&&I(o)),r=requestAnimationFrame(E)}function R(A){var Ce;const{nodeLookup:W,multiSelectionActive:P,nodesDraggable:B,transform:V,snapGrid:K,snapToGrid:z,selectNodesOnDrag:j,onNodeDragStart:X,onSelectionDragStart:Y,unselectNodesAndEdges:te}=e();h=!0,(!j||!S)&&!P&&L&&((Ce=W.get(L))!=null&&Ce.selected||te()),S&&j&&L&&(n==null||n(L));const ce=ok(A.sourceEvent,{transform:V,snapGrid:K,snapToGrid:z,containerBounds:d});if(o=ce,a=RNe(W,B,ce,L),a.size>0&&(t||X||!L&&Y)){const[xe,Be]=J8({nodeId:L,dragItems:a,nodeLookup:W});t==null||t(A.sourceEvent,a,xe,Be),X==null||X(A.sourceEvent,xe,Be),L||Y==null||Y(A.sourceEvent,Be)}}const M=aue().clickDistance(x).on("start",A=>{const{domNode:W,nodeDragThreshold:P,transform:B,snapGrid:V,snapToGrid:K}=e();d=(W==null?void 0:W.getBoundingClientRect())||null,f=!1,g=!1,p=A.sourceEvent,P===0&&R(A),o=ok(A.sourceEvent,{transform:B,snapGrid:V,snapToGrid:K,containerBounds:d}),c=Wd(A.sourceEvent,d)}).on("drag",A=>{const{autoPanOnNodeDrag:W,transform:P,snapGrid:B,snapToGrid:V,nodeDragThreshold:K,nodeLookup:z}=e(),j=ok(A.sourceEvent,{transform:P,snapGrid:B,snapToGrid:V,containerBounds:d});if(p=A.sourceEvent,(A.sourceEvent.type==="touchmove"&&A.sourceEvent.touches.length>1||L&&!z.has(L))&&(f=!0),!f){if(!l&&W&&h&&(l=!0,E()),!h){const X=Wd(A.sourceEvent,d),Y=X.x-c.x,te=X.y-c.y;Math.sqrt(Y*Y+te*te)>K&&R(A)}(o.x!==j.xSnapped||o.y!==j.ySnapped)&&a&&h&&(c=Wd(A.sourceEvent,d),I(j))}}).on("end",A=>{if(!(!h||f)&&(l=!1,h=!1,cancelAnimationFrame(r),a.size>0)){const{nodeLookup:W,updateNodePositions:P,onNodeDragStop:B,onSelectionDragStop:V}=e();if(g&&(P(a,!1),g=!1),s||B||!L&&V){const[K,z]=J8({nodeId:L,dragItems:a,nodeLookup:W,dragging:!1});s==null||s(A.sourceEvent,a,K,z),B==null||B(A.sourceEvent,K,z),L||V==null||V(A.sourceEvent,z)}}}).filter(A=>{const W=A.target;return!A.button&&(!v||!qee(W,`.${v}`,C))&&(!w||qee(W,w,C))});u.call(M)}function b(){u==null||u.on(".drag",null)}return{update:m,destroy:b}}function PNe(n,e,t){const i=[],s={x:n.x-t,y:n.y-t,width:t*2,height:t*2};for(const o of e.values())qI(s,Xy(o))>0&&i.push(o);return i}const ONe=250;function FNe(n,e,t,i){var a,l;let s=[],o=1/0;const r=PNe(n,t,e+ONe);for(const c of r){const d=[...((a=c.internals.handleBounds)==null?void 0:a.source)??[],...((l=c.internals.handleBounds)==null?void 0:l.target)??[]];for(const h of d){if(i.nodeId===h.nodeId&&i.type===h.type&&i.id===h.id)continue;const{x:u,y:f}=$1(c,h,h.position,!0),g=Math.sqrt(Math.pow(u-n.x,2)+Math.pow(f-n.y,2));g>e||(g1){const c=i.type==="source"?"target":"source";return s.find(d=>d.type===c)??s[0]}return s[0]}function Uue(n,e,t,i,s,o=!1){var c,d,h;const r=i.get(n);if(!r)return null;const a=s==="strict"?(c=r.internals.handleBounds)==null?void 0:c[e]:[...((d=r.internals.handleBounds)==null?void 0:d.source)??[],...((h=r.internals.handleBounds)==null?void 0:h.target)??[]],l=(t?a==null?void 0:a.find(u=>u.id===t):a==null?void 0:a[0])??null;return l&&o?{...l,...$1(r,l,l.position,!0)}:l}function que(n,e){return n||(e!=null&&e.classList.contains("target")?"target":e!=null&&e.classList.contains("source")?"source":null)}function BNe(n,e){let t=null;return e?t=!0:n&&!e&&(t=!1),t}const Kue=()=>!0;function WNe(n,{connectionMode:e,connectionRadius:t,handleId:i,nodeId:s,edgeUpdaterType:o,isTarget:r,domNode:a,nodeLookup:l,lib:c,autoPanOnConnect:d,flowId:h,panBy:u,cancelConnection:f,onConnectStart:g,onConnect:p,onConnectEnd:m,isValidConnection:b=Kue,onReconnectEnd:v,updateConnection:w,getTransform:C,getFromHandle:S,autoPanSpeed:L,dragThreshold:x=1,handleDomNode:I}){const E=Aue(n.target);let R=0,M;const{x:A,y:W}=Wd(n),P=que(o,I),B=a==null?void 0:a.getBoundingClientRect();let V=!1;if(!B||!P)return;const K=Uue(s,P,i,l,e);if(!K)return;let z=Wd(n,B),j=!1,X=null,Y=!1,te=null;function ce(){if(!d||!B)return;const[ct,Ue]=Due(z,B,L);u({x:ct,y:Ue}),R=requestAnimationFrame(ce)}const Ce={...K,nodeId:s,type:P,position:K.position},xe=l.get(s);let Ee={inProgress:!0,isValid:null,from:$1(xe,Ce,Nt.Left,!0),fromHandle:Ce,fromPosition:Ce.position,fromNode:xe,to:z,toHandle:null,toPosition:Aee[Ce.position],toNode:null,pointer:z};function Le(){V=!0,w(Ee),g==null||g(n,{nodeId:s,handleId:i,handleType:P})}x===0&&Le();function ze(ct){if(!V){const{x:Cn,y:Xn}=Wd(ct),Ks=Cn-A,kr=Xn-W;if(!(Ks*Ks+kr*kr>x*x))return;Le()}if(!S()||!Ce){Ct(ct);return}const Ue=C();z=Wd(ct,B),M=FNe(eD(z,Ue,!1,[1,1]),t,l,Ce),j||(ce(),j=!0);const tt=Gue(ct,{handle:M,connectionMode:e,fromNodeId:s,fromHandleId:i,fromType:r?"target":"source",isValidConnection:b,doc:E,lib:c,flowId:h,nodeLookup:l});te=tt.handleDomNode,X=tt.connection,Y=BNe(!!M,tt.isValid);const _t=l.get(s),yi=_t?$1(_t,Ce,Nt.Left,!0):Ee.from,Pt={...Ee,from:yi,isValid:Y,to:tt.toHandle&&Y?$M({x:tt.toHandle.x,y:tt.toHandle.y},Ue):z,toHandle:tt.toHandle,toPosition:Y&&tt.toHandle?tt.toHandle.position:Aee[Ce.position],toNode:tt.toHandle?l.get(tt.toHandle.nodeId):null,pointer:z};w(Pt),Ee=Pt}function Ct(ct){if(!("touches"in ct&&ct.touches.length>0)){if(V){(M||te)&&X&&Y&&(p==null||p(X));const{inProgress:Ue,...tt}=Ee,_t={...tt,toPosition:Ee.toHandle?Ee.toPosition:null};m==null||m(ct,_t),o&&(v==null||v(ct,_t))}f(),cancelAnimationFrame(R),j=!1,Y=!1,X=null,te=null,E.removeEventListener("mousemove",ze),E.removeEventListener("mouseup",Ct),E.removeEventListener("touchmove",ze),E.removeEventListener("touchend",Ct)}}E.addEventListener("mousemove",ze),E.addEventListener("mouseup",Ct),E.addEventListener("touchmove",ze),E.addEventListener("touchend",Ct)}function Gue(n,{handle:e,connectionMode:t,fromNodeId:i,fromHandleId:s,fromType:o,doc:r,lib:a,flowId:l,isValidConnection:c=Kue,nodeLookup:d}){const h=o==="target",u=e?r.querySelector(`.${a}-flow__handle[data-id="${l}-${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`):null,{x:f,y:g}=Wd(n),p=r.elementFromPoint(f,g),m=p!=null&&p.classList.contains(`${a}-flow__handle`)?p:u,b={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=que(void 0,m),w=m.getAttribute("data-nodeid"),C=m.getAttribute("data-handleid"),S=m.classList.contains("connectable"),L=m.classList.contains("connectableend");if(!w||!v)return b;const x={source:h?w:i,sourceHandle:h?C:s,target:h?i:w,targetHandle:h?s:C};b.connection=x;const E=S&&L&&(t===Yy.Strict?h&&v==="source"||!h&&v==="target":w!==i||C!==s);b.isValid=E&&c(x),b.toHandle=Uue(w,v,C,d,t,!0)}return b}const $B={onPointerDown:WNe,isValid:Gue};function HNe({domNode:n,panZoom:e,getTransform:t,getViewScale:i}){const s=Pl(n);function o({translateExtent:a,width:l,height:c,zoomStep:d=1,pannable:h=!0,zoomable:u=!0,inversePan:f=!1}){const g=w=>{if(w.sourceEvent.type!=="wheel"||!e)return;const C=t(),S=w.sourceEvent.ctrlKey&&KI()?10:1,L=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*d,x=C[2]*Math.pow(2,L*S);e.scaleTo(x)};let p=[0,0];const m=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(p=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},b=w=>{const C=t();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!e)return;const S=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],L=[S[0]-p[0],S[1]-p[1]];p=S;const x=i()*Math.max(C[2],Math.log(C[2]))*(f?-1:1),I={x:C[0]-L[0]*x,y:C[1]-L[1]*x},E=[[0,0],[l,c]];e.setViewportConstrained({x:I.x,y:I.y,zoom:C[2]},E,a)},v=yue().on("start",m).on("zoom",h?b:null).on("zoom.wheel",u?g:null);s.call(v,{})}function r(){s.on("zoom",null)}return{update:o,destroy:r,pointer:xd}}const y5=n=>({x:n.x,y:n.y,zoom:n.k}),e7=({x:n,y:e,zoom:t})=>v5.translate(n,e).scale(t),XC=(n,e)=>n.target.closest(`.${e}`),Yue=(n,e)=>e===2&&Array.isArray(n)&&n.includes(2),VNe=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,t7=(n,e=0,t=VNe,i=()=>{})=>{const s=typeof e=="number"&&e>0;return s||i(),s?n.transition().duration(e).ease(t).on("end",i):n},Zue=n=>{const e=n.ctrlKey&&KI()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*e};function zNe({zoomPanValues:n,noWheelClassName:e,d3Selection:t,d3Zoom:i,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:r,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:c}){return d=>{if(XC(d,e))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const h=t.property("__zoom").k||1;if(d.ctrlKey&&r){const m=xd(d),b=Zue(d),v=h*Math.pow(2,b);i.scaleTo(t,v,m,d);return}const u=d.deltaMode===1?20:1;let f=s===Cv.Vertical?0:d.deltaX*u,g=s===Cv.Horizontal?0:d.deltaY*u;!KI()&&d.shiftKey&&s!==Cv.Vertical&&(f=d.deltaY*u,g=0),i.translateBy(t,-(f/h)*o,-(g/h)*o,{internal:!0});const p=y5(t.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(l==null||l(d,p),n.panScrollTimeout=setTimeout(()=>{c==null||c(d,p),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,a==null||a(d,p))}}function jNe({noWheelClassName:n,preventScrolling:e,d3ZoomHandler:t}){return function(i,s){const o=i.type==="wheel",r=!e&&o&&!i.ctrlKey,a=XC(i,n);if(i.ctrlKey&&o&&a&&i.preventDefault(),r||a)return null;i.preventDefault(),t.call(this,i,s)}}function $Ne({zoomPanValues:n,onDraggingChange:e,onPanZoomStart:t}){return i=>{var o,r,a;if((o=i.sourceEvent)!=null&&o.internal)return;const s=y5(i.transform);n.mouseButton=((r=i.sourceEvent)==null?void 0:r.button)||0,n.isZoomingOrPanning=!0,n.prevViewport=s,((a=i.sourceEvent)==null?void 0:a.type)==="mousedown"&&e(!0),t&&(t==null||t(i.sourceEvent,s))}}function UNe({zoomPanValues:n,panOnDrag:e,onPaneContextMenu:t,onTransformChange:i,onPanZoom:s}){return o=>{var r,a;n.usedRightMouseButton=!!(t&&Yue(e,n.mouseButton??0)),(r=o.sourceEvent)!=null&&r.sync||i([o.transform.x,o.transform.y,o.transform.k]),s&&!((a=o.sourceEvent)!=null&&a.internal)&&(s==null||s(o.sourceEvent,y5(o.transform)))}}function qNe({zoomPanValues:n,panOnDrag:e,panOnScroll:t,onDraggingChange:i,onPanZoomEnd:s,onPaneContextMenu:o}){return r=>{var a;if(!((a=r.sourceEvent)!=null&&a.internal)&&(n.isZoomingOrPanning=!1,o&&Yue(e,n.mouseButton??0)&&!n.usedRightMouseButton&&r.sourceEvent&&o(r.sourceEvent),n.usedRightMouseButton=!1,i(!1),s)){const l=y5(r.transform);n.prevViewport=l,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{s==null||s(r.sourceEvent,l)},t?150:0)}}}function KNe({zoomActivationKeyPressed:n,zoomOnScroll:e,zoomOnPinch:t,panOnDrag:i,panOnScroll:s,zoomOnDoubleClick:o,userSelectionActive:r,noWheelClassName:a,noPanClassName:l,lib:c,connectionInProgress:d}){return h=>{var m;const u=n||e,f=t&&h.ctrlKey,g=h.type==="wheel";if(h.button===1&&h.type==="mousedown"&&(XC(h,`${c}-flow__node`)||XC(h,`${c}-flow__edge`)))return!0;if(!i&&!u&&!s&&!o&&!t||r||d&&!g||XC(h,a)&&g||XC(h,l)&&(!g||s&&g&&!n)||!t&&h.ctrlKey&&g)return!1;if(!t&&h.type==="touchstart"&&((m=h.touches)==null?void 0:m.length)>1)return h.preventDefault(),!1;if(!u&&!s&&!f&&g||!i&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(i)&&!i.includes(h.button)&&h.type==="mousedown")return!1;const p=Array.isArray(i)&&i.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||g)&&p}}function GNe({domNode:n,minZoom:e,maxZoom:t,translateExtent:i,viewport:s,onPanZoom:o,onPanZoomStart:r,onPanZoomEnd:a,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=n.getBoundingClientRect(),h=yue().scaleExtent([e,t]).translateExtent(i),u=Pl(n).call(h);v({x:s.x,y:s.y,zoom:Zy(s.zoom,e,t)},[[0,0],[d.width,d.height]],i);const f=u.on("wheel.zoom"),g=u.on("dblclick.zoom");h.wheelDelta(Zue);function p(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).transform(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function m({noWheelClassName:M,noPanClassName:A,onPaneContextMenu:W,userSelectionActive:P,panOnScroll:B,panOnDrag:V,panOnScrollMode:K,panOnScrollSpeed:z,preventScrolling:j,zoomOnPinch:X,zoomOnScroll:Y,zoomOnDoubleClick:te,zoomActivationKeyPressed:ce,lib:Ce,onTransformChange:xe,connectionInProgress:Be,paneClickDistance:Ee,selectionOnDrag:Le}){P&&!c.isZoomingOrPanning&&b();const ze=B&&!ce&&!P;h.clickDistance(Le?1/0:!Bd(Ee)||Ee<0?0:Ee);const Ct=ze?zNe({zoomPanValues:c,noWheelClassName:M,d3Selection:u,d3Zoom:h,panOnScrollMode:K,panOnScrollSpeed:z,zoomOnPinch:X,onPanZoomStart:r,onPanZoom:o,onPanZoomEnd:a}):jNe({noWheelClassName:M,preventScrolling:j,d3ZoomHandler:f});if(u.on("wheel.zoom",Ct,{passive:!1}),!P){const Ue=$Ne({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:r});h.on("start",Ue);const tt=UNe({zoomPanValues:c,panOnDrag:V,onPaneContextMenu:!!W,onPanZoom:o,onTransformChange:xe});h.on("zoom",tt);const _t=qNe({zoomPanValues:c,panOnDrag:V,panOnScroll:B,onPaneContextMenu:W,onPanZoomEnd:a,onDraggingChange:l});h.on("end",_t)}const ct=KNe({zoomActivationKeyPressed:ce,panOnDrag:V,zoomOnScroll:Y,panOnScroll:B,zoomOnDoubleClick:te,zoomOnPinch:X,userSelectionActive:P,noPanClassName:A,noWheelClassName:M,lib:Ce,connectionInProgress:Be});h.filter(ct),te?u.on("dblclick.zoom",g):u.on("dblclick.zoom",null)}function b(){h.on("zoom",null)}async function v(M,A,W){const P=e7(M),B=h==null?void 0:h.constrain()(P,A,W);return B&&await p(B),new Promise(V=>V(B))}async function w(M,A){const W=e7(M);return await p(W,A),new Promise(P=>P(W))}function C(M){if(u){const A=e7(M),W=u.property("__zoom");(W.k!==M.zoom||W.x!==M.x||W.y!==M.y)&&(h==null||h.transform(u,A,null,{sync:!0}))}}function S(){const M=u?Cue(u.node()):{x:0,y:0,k:1};return{x:M.x,y:M.y,zoom:M.k}}function L(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).scaleTo(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function x(M,A){return u?new Promise(W=>{h==null||h.interpolate((A==null?void 0:A.interpolate)==="linear"?sk:_R).scaleBy(t7(u,A==null?void 0:A.duration,A==null?void 0:A.ease,()=>W(!0)),M)}):Promise.resolve(!1)}function I(M){h==null||h.scaleExtent(M)}function E(M){h==null||h.translateExtent(M)}function R(M){const A=!Bd(M)||M<0?0:M;h==null||h.clickDistance(A)}return{update:m,destroy:b,setViewport:w,setViewportConstrained:v,getViewport:S,scaleTo:L,scaleBy:x,setScaleExtent:I,setTranslateExtent:E,syncViewport:C,setClickDistance:R}}var Jy;(function(n){n.Line="line",n.Handle="handle"})(Jy||(Jy={}));function YNe({width:n,prevWidth:e,height:t,prevHeight:i,affectsX:s,affectsY:o}){const r=n-e,a=t-i,l=[r>0?1:r<0?-1:0,a>0?1:a<0?-1:0];return r&&s&&(l[0]=l[0]*-1),a&&o&&(l[1]=l[1]*-1),l}function Kee(n){const e=n.includes("right")||n.includes("left"),t=n.includes("bottom")||n.includes("top"),i=n.includes("left"),s=n.includes("top");return{isHorizontal:e,isVertical:t,affectsX:i,affectsY:s}}function op(n,e){return Math.max(0,e-n)}function rp(n,e){return Math.max(0,n-e)}function xT(n,e,t){return Math.max(0,e-n,n-t)}function Gee(n,e){return n?!e:e}function ZNe(n,e,t,i,s,o,r,a){let{affectsX:l,affectsY:c}=e;const{isHorizontal:d,isVertical:h}=e,u=d&&h,{xSnapped:f,ySnapped:g}=t,{minWidth:p,maxWidth:m,minHeight:b,maxHeight:v}=i,{x:w,y:C,width:S,height:L,aspectRatio:x}=n;let I=Math.floor(d?f-n.pointerX:0),E=Math.floor(h?g-n.pointerY:0);const R=S+(l?-I:I),M=L+(c?-E:E),A=-o[0]*S,W=-o[1]*L;let P=xT(R,p,m),B=xT(M,b,v);if(r){let z=0,j=0;l&&I<0?z=op(w+I+A,r[0][0]):!l&&I>0&&(z=rp(w+R+A,r[1][0])),c&&E<0?j=op(C+E+W,r[0][1]):!c&&E>0&&(j=rp(C+M+W,r[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(a){let z=0,j=0;l&&I>0?z=rp(w+I,a[0][0]):!l&&I<0&&(z=op(w+R,a[1][0])),c&&E>0?j=rp(C+E,a[0][1]):!c&&E<0&&(j=op(C+M,a[1][1])),P=Math.max(P,z),B=Math.max(B,j)}if(s){if(d){const z=xT(R/x,b,v)*x;if(P=Math.max(P,z),r){let j=0;!l&&!c||l&&!c&&u?j=rp(C+W+R/x,r[1][1])*x:j=op(C+W+(l?I:-I)/x,r[0][1])*x,P=Math.max(P,j)}if(a){let j=0;!l&&!c||l&&!c&&u?j=op(C+R/x,a[1][1])*x:j=rp(C+(l?I:-I)/x,a[0][1])*x,P=Math.max(P,j)}}if(h){const z=xT(M*x,p,m)/x;if(B=Math.max(B,z),r){let j=0;!l&&!c||c&&!l&&u?j=rp(w+M*x+A,r[1][0])/x:j=op(w+(c?E:-E)*x+A,r[0][0])/x,B=Math.max(B,j)}if(a){let j=0;!l&&!c||c&&!l&&u?j=op(w+M*x,a[1][0])/x:j=rp(w+(c?E:-E)*x,a[0][0])/x,B=Math.max(B,j)}}}E=E+(E<0?B:-B),I=I+(I<0?P:-P),s&&(u?R>M*x?E=(Gee(l,c)?-I:I)/x:I=(Gee(l,c)?-E:E)*x:d?(E=I/x,c=l):(I=E*x,l=c));const V=l?w+I:w,K=c?C+E:C;return{width:S+(l?-I:I),height:L+(c?-E:E),x:o[0]*I*(l?-1:1)+V,y:o[1]*E*(c?-1:1)+K}}const Xue={width:0,height:0,x:0,y:0},XNe={...Xue,pointerX:0,pointerY:0,aspectRatio:1};function QNe(n){return[[0,0],[n.measured.width,n.measured.height]]}function JNe(n,e,t){const i=e.position.x+n.position.x,s=e.position.y+n.position.y,o=n.measured.width??0,r=n.measured.height??0,a=t[0]*o,l=t[1]*r;return[[i-a,s-l],[i+o-a,s+r-l]]}function eDe({domNode:n,nodeId:e,getStoreItems:t,onChange:i,onEnd:s}){const o=Pl(n);let r={controlDirection:Kee("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:c,boundaries:d,keepAspectRatio:h,resizeDirection:u,onResizeStart:f,onResize:g,onResizeEnd:p,shouldResize:m}){let b={...Xue},v={...XNe};r={boundaries:d,resizeDirection:u,keepAspectRatio:h,controlDirection:Kee(c)};let w,C=null,S=[],L,x,I,E=!1;const R=aue().on("start",M=>{const{nodeLookup:A,transform:W,snapGrid:P,snapToGrid:B,nodeOrigin:V,paneDomNode:K}=t();if(w=A.get(e),!w)return;C=(K==null?void 0:K.getBoundingClientRect())??null;const{xSnapped:z,ySnapped:j}=ok(M.sourceEvent,{transform:W,snapGrid:P,snapToGrid:B,containerBounds:C});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},v={...b,pointerX:z,pointerY:j,aspectRatio:b.width/b.height},L=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(L=A.get(w.parentId),x=L&&w.extent==="parent"?QNe(L):void 0),S=[],I=void 0;for(const[X,Y]of A)if(Y.parentId===e&&(S.push({id:X,position:{...Y.position},extent:Y.extent}),Y.extent==="parent"||Y.expandParent)){const te=JNe(Y,w,Y.origin??V);I?I=[[Math.min(te[0][0],I[0][0]),Math.min(te[0][1],I[0][1])],[Math.max(te[1][0],I[1][0]),Math.max(te[1][1],I[1][1])]]:I=te}f==null||f(M,{...b})}).on("drag",M=>{const{transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B}=t(),V=ok(M.sourceEvent,{transform:A,snapGrid:W,snapToGrid:P,containerBounds:C}),K=[];if(!w)return;const{x:z,y:j,width:X,height:Y}=b,te={},ce=w.origin??B,{width:Ce,height:xe,x:Be,y:Ee}=ZNe(v,r.controlDirection,V,r.boundaries,r.keepAspectRatio,ce,x,I),Le=Ce!==X,ze=xe!==Y,Ct=Be!==z&&Le,ct=Ee!==j&&ze;if(!Ct&&!ct&&!Le&&!ze)return;if((Ct||ct||ce[0]===1||ce[1]===1)&&(te.x=Ct?Be:b.x,te.y=ct?Ee:b.y,b.x=te.x,b.y=te.y,S.length>0)){const yi=Be-z,Pt=Ee-j;for(const Cn of S)Cn.position={x:Cn.position.x-yi+ce[0]*(Ce-X),y:Cn.position.y-Pt+ce[1]*(xe-Y)},K.push(Cn)}if((Le||ze)&&(te.width=Le&&(!r.resizeDirection||r.resizeDirection==="horizontal")?Ce:b.width,te.height=ze&&(!r.resizeDirection||r.resizeDirection==="vertical")?xe:b.height,b.width=te.width,b.height=te.height),L&&w.expandParent){const yi=ce[0]*(te.width??0);te.x&&te.x{E&&(p==null||p(M,{...b}),s==null||s({...b}),E=!1)});o.call(R)}function l(){o.on(".drag",null)}return{update:a,destroy:l}}var Que={exports:{}},Jue={},efe={exports:{}},tfe={};/** * @license React * use-sync-external-store-shim.production.js * @@ -45,7 +45,7 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var iS=$;function oDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var rDe=typeof Object.is=="function"?Object.is:oDe,aDe=iS.useState,lDe=iS.useEffect,cDe=iS.useLayoutEffect,dDe=iS.useDebugValue;function hDe(n,e){var t=e(),i=aDe({inst:{value:t,getSnapshot:e}}),s=i[0].inst,o=i[1];return cDe(function(){s.value=t,s.getSnapshot=e,i7(s)&&o({inst:s})},[n,t,e]),lDe(function(){return i7(s)&&o({inst:s}),n(function(){i7(s)&&o({inst:s})})},[n]),dDe(t),t}function i7(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!rDe(n,t)}catch{return!0}}function uDe(n,e){return e()}var fDe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?uDe:hDe;sfe.useSyncExternalStore=iS.useSyncExternalStore!==void 0?iS.useSyncExternalStore:fDe;nfe.exports=sfe;var gDe=nfe.exports;/** + */var eS=$;function tDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var iDe=typeof Object.is=="function"?Object.is:tDe,nDe=eS.useState,sDe=eS.useEffect,oDe=eS.useLayoutEffect,rDe=eS.useDebugValue;function aDe(n,e){var t=e(),i=nDe({inst:{value:t,getSnapshot:e}}),s=i[0].inst,o=i[1];return oDe(function(){s.value=t,s.getSnapshot=e,i7(s)&&o({inst:s})},[n,t,e]),sDe(function(){return i7(s)&&o({inst:s}),n(function(){i7(s)&&o({inst:s})})},[n]),rDe(t),t}function i7(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!iDe(n,t)}catch{return!0}}function lDe(n,e){return e()}var cDe=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lDe:aDe;tfe.useSyncExternalStore=eS.useSyncExternalStore!==void 0?eS.useSyncExternalStore:cDe;efe.exports=tfe;var dDe=efe.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -53,245 +53,240 @@ Error generating stack: `+o.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var S5=$,pDe=gDe;function mDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var _De=typeof Object.is=="function"?Object.is:mDe,bDe=pDe.useSyncExternalStore,vDe=S5.useRef,wDe=S5.useEffect,CDe=S5.useMemo,yDe=S5.useDebugValue;ife.useSyncExternalStoreWithSelector=function(n,e,t,i,s){var o=vDe(null);if(o.current===null){var r={hasValue:!1,value:null};o.current=r}else r=o.current;o=CDe(function(){function l(f){if(!c){if(c=!0,d=f,f=i(f),s!==void 0&&r.hasValue){var g=r.value;if(s(g,f))return h=g}return h=f}if(g=h,_De(d,f))return g;var p=i(f);return s!==void 0&&s(g,p)?(d=f,g):(d=f,h=p)}var c=!1,d,h,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,i,s]);var a=bDe(n,o[0],o[1]);return wDe(function(){r.hasValue=!0,r.value=a},[a]),yDe(a),a};tfe.exports=ife;var SDe=tfe.exports;const xDe=Fce(SDe),LDe={},Zee=n=>{let e;const t=new Set,i=(d,h)=>{const u=typeof d=="function"?d(e):d;if(!Object.is(u,e)){const f=e;e=h??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(g=>g(e,f))}},s=()=>e,l={setState:i,getState:s,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{(LDe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},c=e=n(i,s,l);return l},kDe=n=>n?Zee(n):Zee,{useDebugValue:EDe}=hm,{useSyncExternalStoreWithSelector:IDe}=xDe,NDe=n=>n;function ofe(n,e=NDe,t){const i=IDe(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return EDe(i),i}const Xee=(n,e)=>{const t=kDe(n),i=(s,o=e)=>ofe(t,s,o);return Object.assign(i,t),i},DDe=(n,e)=>n?Xee(n,e):Xee;function as(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[i,s]of n)if(!Object.is(s,e.get(i)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const i of n)if(!e.has(i))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(n[i],e[i]))return!1;return!0}const x5=$.createContext(null),TDe=x5.Provider,rfe=_u.error001();function Mi(n,e){const t=$.useContext(x5);if(t===null)throw new Error(rfe);return ofe(t,n,e)}function ds(){const n=$.useContext(x5);if(n===null)throw new Error(rfe);return $.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const Qee={display:"none"},RDe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},afe="react-flow__node-desc",lfe="react-flow__edge-desc",MDe="react-flow__aria-live",ADe=n=>n.ariaLiveMessage,PDe=n=>n.ariaLabelConfig;function ODe({rfId:n}){const e=Mi(ADe);return y.jsx("div",{id:`${MDe}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:RDe,children:e})}function FDe({rfId:n,disableKeyboardA11y:e}){const t=Mi(PDe);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${afe}-${n}`,style:Qee,children:e?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${lfe}-${n}`,style:Qee,children:t["edge.a11yDescription.default"]}),!e&&y.jsx(ODe,{rfId:n})]})}const L5=$.forwardRef(({position:n="top-left",children:e,className:t,style:i,...s},o)=>{const r=`${n}`.split("-");return y.jsx("div",{className:uo(["react-flow__panel",t,...r]),style:i,ref:o,...s,children:e})});L5.displayName="Panel";function BDe({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:y.jsx(L5,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WDe=n=>{const e=[],t=[];for(const[,i]of n.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of n.edgeLookup)i.selected&&t.push(i);return{selectedNodes:e,selectedEdges:t}},xT=n=>n.id;function HDe(n,e){return as(n.selectedNodes.map(xT),e.selectedNodes.map(xT))&&as(n.selectedEdges.map(xT),e.selectedEdges.map(xT))}function VDe({onSelectionChange:n}){const e=ds(),{selectedNodes:t,selectedEdges:i}=Mi(WDe,HDe);return $.useEffect(()=>{const s={nodes:t,edges:i};n==null||n(s),e.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[t,i,n]),null}const zDe=n=>!!n.onSelectionChangeHandlers;function jDe({onSelectionChange:n}){const e=Mi(zDe);return n||e?y.jsx(VDe,{onSelectionChange:n}):null}const cfe=[0,0],$De={x:0,y:0,zoom:1},UDe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Jee=[...UDe,"rfId"],qDe=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),ete={translateExtent:$E,nodeOrigin:cfe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function KDe(n){const{setNodes:e,setEdges:t,setMinZoom:i,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:r,reset:a,setDefaultNodesAndEdges:l}=Mi(qDe,as),c=ds();$.useEffect(()=>(l(n.defaultNodes,n.defaultEdges),()=>{d.current=ete,a()}),[]);const d=$.useRef(ete);return $.useEffect(()=>{for(const h of Jee){const u=n[h],f=d.current[h];u!==f&&(typeof n[h]>"u"||(h==="nodes"?e(u):h==="edges"?t(u):h==="minZoom"?i(u):h==="maxZoom"?s(u):h==="translateExtent"?o(u):h==="nodeExtent"?r(u):h==="ariaLabelConfig"?c.setState({ariaLabelConfig:mNe(u)}):h==="fitView"?c.setState({fitViewQueued:u}):h==="fitViewOptions"?c.setState({fitViewOptions:u}):c.setState({[h]:u})))}d.current=n},Jee.map(h=>n[h])),null}function tte(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function GDe(n){var i;const[e,t]=$.useState(n==="system"?null:n);return $.useEffect(()=>{if(n!=="system"){t(n);return}const s=tte(),o=()=>t(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[n]),e!==null?e:(i=tte())!=null&&i.matches?"dark":"light"}const ite=typeof document<"u"?document:null;function GE(n=null,e={target:ite,actInsideInputWithModifier:!0}){const[t,i]=$.useState(!1),s=$.useRef(!1),o=$.useRef(new Set([])),[r,a]=$.useMemo(()=>{if(n!==null){const c=(Array.isArray(n)?n:[n]).filter(h=>typeof h=="string").map(h=>h.replace("+",` + */var S5=$,hDe=dDe;function uDe(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var fDe=typeof Object.is=="function"?Object.is:uDe,gDe=hDe.useSyncExternalStore,pDe=S5.useRef,mDe=S5.useEffect,_De=S5.useMemo,bDe=S5.useDebugValue;Jue.useSyncExternalStoreWithSelector=function(n,e,t,i,s){var o=pDe(null);if(o.current===null){var r={hasValue:!1,value:null};o.current=r}else r=o.current;o=_De(function(){function l(f){if(!c){if(c=!0,d=f,f=i(f),s!==void 0&&r.hasValue){var g=r.value;if(s(g,f))return h=g}return h=f}if(g=h,fDe(d,f))return g;var p=i(f);return s!==void 0&&s(g,p)?(d=f,g):(d=f,h=p)}var c=!1,d,h,u=t===void 0?null:t;return[function(){return l(e())},u===null?void 0:function(){return l(u())}]},[e,t,i,s]);var a=gDe(n,o[0],o[1]);return mDe(function(){r.hasValue=!0,r.value=a},[a]),bDe(a),a};Que.exports=Jue;var vDe=Que.exports;const wDe=Ace(vDe),CDe={},Yee=n=>{let e;const t=new Set,i=(d,h)=>{const u=typeof d=="function"?d(e):d;if(!Object.is(u,e)){const f=e;e=h??(typeof u!="object"||u===null)?u:Object.assign({},e,u),t.forEach(g=>g(e,f))}},s=()=>e,l={setState:i,getState:s,getInitialState:()=>c,subscribe:d=>(t.add(d),()=>t.delete(d)),destroy:()=>{(CDe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}},c=e=n(i,s,l);return l},yDe=n=>n?Yee(n):Yee,{useDebugValue:SDe}=dm,{useSyncExternalStoreWithSelector:xDe}=wDe,LDe=n=>n;function ife(n,e=LDe,t){const i=xDe(n.subscribe,n.getState,n.getServerState||n.getInitialState,e,t);return SDe(i),i}const Zee=(n,e)=>{const t=yDe(n),i=(s,o=e)=>ife(t,s,o);return Object.assign(i,t),i},kDe=(n,e)=>n?Zee(n,e):Zee;function cs(n,e){if(Object.is(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[i,s]of n)if(!Object.is(s,e.get(i)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const i of n)if(!e.has(i))return!1;return!0}const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const i of t)if(!Object.prototype.hasOwnProperty.call(e,i)||!Object.is(n[i],e[i]))return!1;return!0}const x5=$.createContext(null),IDe=x5.Provider,nfe=bu.error001();function Ti(n,e){const t=$.useContext(x5);if(t===null)throw new Error(nfe);return ife(t,n,e)}function us(){const n=$.useContext(x5);if(n===null)throw new Error(nfe);return $.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const Xee={display:"none"},EDe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sfe="react-flow__node-desc",ofe="react-flow__edge-desc",NDe="react-flow__aria-live",DDe=n=>n.ariaLiveMessage,TDe=n=>n.ariaLabelConfig;function RDe({rfId:n}){const e=Ti(DDe);return y.jsx("div",{id:`${NDe}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:EDe,children:e})}function MDe({rfId:n,disableKeyboardA11y:e}){const t=Ti(TDe);return y.jsxs(y.Fragment,{children:[y.jsx("div",{id:`${sfe}-${n}`,style:Xee,children:e?t["node.a11yDescription.default"]:t["node.a11yDescription.keyboardDisabled"]}),y.jsx("div",{id:`${ofe}-${n}`,style:Xee,children:t["edge.a11yDescription.default"]}),!e&&y.jsx(RDe,{rfId:n})]})}const L5=$.forwardRef(({position:n="top-left",children:e,className:t,style:i,...s},o)=>{const r=`${n}`.split("-");return y.jsx("div",{className:fo(["react-flow__panel",t,...r]),style:i,ref:o,...s,children:e})});L5.displayName="Panel";function ADe({proOptions:n,position:e="bottom-right"}){return n!=null&&n.hideAttribution?null:y.jsx(L5,{position:e,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:y.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const PDe=n=>{const e=[],t=[];for(const[,i]of n.nodeLookup)i.selected&&e.push(i.internals.userNode);for(const[,i]of n.edgeLookup)i.selected&&t.push(i);return{selectedNodes:e,selectedEdges:t}},LT=n=>n.id;function ODe(n,e){return cs(n.selectedNodes.map(LT),e.selectedNodes.map(LT))&&cs(n.selectedEdges.map(LT),e.selectedEdges.map(LT))}function FDe({onSelectionChange:n}){const e=us(),{selectedNodes:t,selectedEdges:i}=Ti(PDe,ODe);return $.useEffect(()=>{const s={nodes:t,edges:i};n==null||n(s),e.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[t,i,n]),null}const BDe=n=>!!n.onSelectionChangeHandlers;function WDe({onSelectionChange:n}){const e=Ti(BDe);return n||e?y.jsx(FDe,{onSelectionChange:n}):null}const rfe=[0,0],HDe={x:0,y:0,zoom:1},VDe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Qee=[...VDe,"rfId"],zDe=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),Jee={translateExtent:$I,nodeOrigin:rfe,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jDe(n){const{setNodes:e,setEdges:t,setMinZoom:i,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:r,reset:a,setDefaultNodesAndEdges:l}=Ti(zDe,cs),c=us();$.useEffect(()=>(l(n.defaultNodes,n.defaultEdges),()=>{d.current=Jee,a()}),[]);const d=$.useRef(Jee);return $.useEffect(()=>{for(const h of Qee){const u=n[h],f=d.current[h];u!==f&&(typeof n[h]>"u"||(h==="nodes"?e(u):h==="edges"?t(u):h==="minZoom"?i(u):h==="maxZoom"?s(u):h==="translateExtent"?o(u):h==="nodeExtent"?r(u):h==="ariaLabelConfig"?c.setState({ariaLabelConfig:uNe(u)}):h==="fitView"?c.setState({fitViewQueued:u}):h==="fitViewOptions"?c.setState({fitViewOptions:u}):c.setState({[h]:u})))}d.current=n},Qee.map(h=>n[h])),null}function ete(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function $De(n){var i;const[e,t]=$.useState(n==="system"?null:n);return $.useEffect(()=>{if(n!=="system"){t(n);return}const s=ete(),o=()=>t(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[n]),e!==null?e:(i=ete())!=null&&i.matches?"dark":"light"}const tte=typeof document<"u"?document:null;function GI(n=null,e={target:tte,actInsideInputWithModifier:!0}){const[t,i]=$.useState(!1),s=$.useRef(!1),o=$.useRef(new Set([])),[r,a]=$.useMemo(()=>{if(n!==null){const c=(Array.isArray(n)?n:[n]).filter(h=>typeof h=="string").map(h=>h.replace("+",` `).replace(` `,` +`).split(` -`)),d=c.reduce((h,u)=>h.concat(...u),[]);return[c,d]}return[[],[]]},[n]);return $.useEffect(()=>{const l=(e==null?void 0:e.target)??ite,c=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(n!==null){const d=f=>{var m,b;if(s.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!s.current||s.current&&!c)&&Bue(f))return!1;const p=ste(f.code,a);if(o.current.add(f[p]),nte(r,o.current,!1)){const v=((b=(m=f.composedPath)==null?void 0:m.call(f))==null?void 0:b[0])||f.target,w=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";e.preventDefault!==!1&&(s.current||!w)&&f.preventDefault(),i(!0)}},h=f=>{const g=ste(f.code,a);nte(r,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(f[g]),f.key==="Meta"&&o.current.clear(),s.current=!1},u=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",h),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",h),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[n,i]),t}function nte(n,e,t){return n.filter(i=>t||i.length===e.size).some(i=>i.every(s=>e.has(s)))}function ste(n,e){return e.includes(n)?"code":"key"}const YDe=()=>{const n=ds();return $.useMemo(()=>({zoomIn:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,t)=>{const{panZoom:i}=n.getState();return i?i.scaleTo(e,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(e,t)=>{const{transform:[i,s,o],panZoom:r}=n.getState();return r?(await r.setViewport({x:e.x??i,y:e.y??s,zoom:e.zoom??o},t),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,t,i]=n.getState().transform;return{x:e,y:t,zoom:i}},setCenter:async(e,t,i)=>n.getState().setCenter(e,t,i),fitBounds:async(e,t)=>{const{width:i,height:s,minZoom:o,maxZoom:r,panZoom:a}=n.getState(),l=dG(e,i,s,o,r,(t==null?void 0:t.padding)??.1);return a?(await a.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,t={})=>{const{transform:i,snapGrid:s,snapToGrid:o,domNode:r}=n.getState();if(!r)return e;const{x:a,y:l}=r.getBoundingClientRect(),c={x:e.x-a,y:e.y-l},d=t.snapGrid??s,h=t.snapToGrid??o;return eD(c,i,h,d)},flowToScreenPosition:e=>{const{transform:t,domNode:i}=n.getState();if(!i)return e;const{x:s,y:o}=i.getBoundingClientRect(),r=jM(e,t);return{x:r.x+s,y:r.y+o}}}),[])};function dfe(n,e){const t=[],i=new Map,s=[];for(const o of n)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const r=i.get(o.id);r?r.push(o):i.set(o.id,[o])}for(const o of e){const r=i.get(o.id);if(!r){t.push(o);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){t.push({...r[0].item});continue}const a={...o};for(const l of r)ZDe(l,a);t.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?t.splice(o.index,0,{...o.item}):t.push({...o.item})}),t}function ZDe(n,e){switch(n.type){case"select":{e.selected=n.selected;break}case"position":{typeof n.position<"u"&&(e.position=n.position),typeof n.dragging<"u"&&(e.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(e.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(e.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(e.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(e.resizing=n.resizing);break}}}function hfe(n,e){return dfe(n,e)}function ufe(n,e){return dfe(n,e)}function lb(n,e){return{id:n,type:"select",selected:e}}function n0(n,e=new Set,t=!1){const i=[];for(const[s,o]of n){const r=e.has(s);!(o.selected===void 0&&!r)&&o.selected!==r&&(t&&(o.selected=r),i.push(lb(o.id,r)))}return i}function ote({items:n=[],lookup:e}){var s;const t=[],i=new Map(n.map(o=>[o.id,o]));for(const[o,r]of n.entries()){const a=e.get(r.id),l=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;l!==void 0&&l!==r&&t.push({id:r.id,item:r,type:"replace"}),l===void 0&&t.push({item:r,type:"add",index:o})}for(const[o]of e)i.get(o)===void 0&&t.push({id:o,type:"remove"});return t}function rte(n){return{id:n.id,type:"remove"}}const ate=n=>rNe(n),XDe=n=>Due(n);function ffe(n){return $.forwardRef(n)}const QDe=typeof window<"u"?$.useLayoutEffect:$.useEffect;function lte(n){const[e,t]=$.useState(BigInt(0)),[i]=$.useState(()=>JDe(()=>t(s=>s+BigInt(1))));return QDe(()=>{const s=i.get();s.length&&(n(s),i.reset())},[e]),i}function JDe(n){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n()}}}const gfe=$.createContext(null);function eTe({children:n}){const e=ds(),t=$.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:h,nodeLookup:u,fitViewQueued:f,onNodesChangeMiddlewareMap:g}=e.getState();let p=l;for(const b of a)p=typeof b=="function"?b(p):b;let m=ote({items:p,lookup:u});for(const b of g.values())m=b(m);d&&c(p),m.length>0?h==null||h(m):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:v,setNodes:w}=e.getState();b&&w(v)})},[]),i=lte(t),s=$.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:u}=e.getState();let f=l;for(const g of a)f=typeof g=="function"?g(f):g;d?c(f):h&&h(ote({items:f,lookup:u}))},[]),o=lte(s),r=$.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return y.jsx(gfe.Provider,{value:r,children:n})}function tTe(){const n=$.useContext(gfe);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const iTe=n=>!!n.panZoom;function _G(){const n=YDe(),e=ds(),t=tTe(),i=Mi(iTe),s=$.useMemo(()=>{const o=h=>e.getState().nodeLookup.get(h),r=h=>{t.nodeQueue.push(h)},a=h=>{t.edgeQueue.push(h)},l=h=>{var b,v;const{nodeLookup:u,nodeOrigin:f}=e.getState(),g=ate(h)?h:u.get(h.id),p=g.parentId?Oue(g.position,g.measured,g.parentId,u,f):g.position,m={...g,position:p,width:((b=g.measured)==null?void 0:b.width)??g.width,height:((v=g.measured)==null?void 0:v.height)??g.height};return Jy(m)},c=(h,u,f={replace:!1})=>{r(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&ate(m)?m:{...p,...m}}return p}))},d=(h,u,f={replace:!1})=>{a(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&XDe(m)?m:{...p,...m}}return p}))};return{getNodes:()=>e.getState().nodes.map(h=>({...h})),getNode:h=>{var u;return(u=o(h))==null?void 0:u.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=e.getState();return h.map(u=>({...u}))},getEdge:h=>e.getState().edgeLookup.get(h),setNodes:r,setEdges:a,addNodes:h=>{const u=Array.isArray(h)?h:[h];t.nodeQueue.push(f=>[...f,...u])},addEdges:h=>{const u=Array.isArray(h)?h:[h];t.edgeQueue.push(f=>[...f,...u])},toObject:()=>{const{nodes:h=[],edges:u=[],transform:f}=e.getState(),[g,p,m]=f;return{nodes:h.map(b=>({...b})),edges:u.map(b=>({...b})),viewport:{x:g,y:p,zoom:m}}},deleteElements:async({nodes:h=[],edges:u=[]})=>{const{nodes:f,edges:g,onNodesDelete:p,onEdgesDelete:m,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:w,onBeforeDelete:C}=e.getState(),{nodes:S,edges:L}=await hNe({nodesToRemove:h,edgesToRemove:u,nodes:f,edges:g,onBeforeDelete:C}),x=L.length>0,E=S.length>0;if(x){const I=L.map(rte);m==null||m(L),v(I)}if(E){const I=S.map(rte);p==null||p(S),b(I)}return(E||x)&&(w==null||w({nodes:S,edges:L})),{deletedNodes:S,deletedEdges:L}},getIntersectingNodes:(h,u=!0,f)=>{const g=Fee(h),p=g?h:l(h),m=f!==void 0;return p?(f||e.getState().nodes).filter(b=>{const v=e.getState().nodeLookup.get(b.id);if(v&&!g&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const w=Jy(m?b:v),C=qE(w,p);return u&&C>0||C>=w.width*w.height||C>=p.width*p.height}):[]},isNodeIntersecting:(h,u,f=!0)=>{const p=Fee(h)?h:l(h);if(!p)return!1;const m=qE(p,u);return f&&m>0||m>=u.width*u.height||m>=p.width*p.height},updateNode:c,updateNodeData:(h,u,f={replace:!1})=>{c(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},updateEdge:d,updateEdgeData:(h,u,f={replace:!1})=>{d(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},getNodesBounds:h=>{const{nodeLookup:u,nodeOrigin:f}=e.getState();return aNe(h,{nodeLookup:u,nodeOrigin:f})},getHandleConnections:({type:h,id:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}-${h}${u?`-${u}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:h,handleId:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}${h?u?`-${h}-${u}`:`-${h}`:""}`))==null?void 0:g.values())??[])},fitView:async h=>{const u=e.getState().fitViewResolver??pNe();return e.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:u}),t.nodeQueue.push(f=>[...f]),u.promise}}},[]);return $.useMemo(()=>({...s,...n,viewportInitialized:i}),[i])}const cte=n=>n.selected,nTe=typeof window<"u"?window:void 0;function sTe({deleteKeyCode:n,multiSelectionKeyCode:e}){const t=ds(),{deleteElements:i}=_G(),s=GE(n,{actInsideInputWithModifier:!1}),o=GE(e,{target:nTe});$.useEffect(()=>{if(s){const{edges:r,nodes:a}=t.getState();i({nodes:a.filter(cte),edges:r.filter(cte)}),t.setState({nodesSelectionActive:!1})}},[s]),$.useEffect(()=>{t.setState({multiSelectionActive:o})},[o])}function oTe(n){const e=ds();$.useEffect(()=>{const t=()=>{var s,o,r,a;if(!n.current||!(((o=(s=n.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const i=hG(n.current);(i.height===0||i.width===0)&&((a=(r=e.getState()).onError)==null||a.call(r,"004",_u.error004())),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);const i=new ResizeObserver(()=>t());return i.observe(n.current),()=>{window.removeEventListener("resize",t),i&&n.current&&i.unobserve(n.current)}}},[])}const k5={position:"absolute",width:"100%",height:"100%",top:0,left:0},rTe=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function aTe({onPaneContextMenu:n,zoomOnScroll:e=!0,zoomOnPinch:t=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=xv.Free,zoomOnDoubleClick:r=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:h,zoomActivationKeyCode:u,preventScrolling:f=!0,children:g,noWheelClassName:p,noPanClassName:m,onViewportChange:b,isControlledViewport:v,paneClickDistance:w,selectionOnDrag:C}){const S=ds(),L=$.useRef(null),{userSelectionActive:x,lib:E,connectionInProgress:I}=Mi(rTe,as),R=GE(u),M=$.useRef();oTe(L);const A=$.useCallback(W=>{b==null||b({x:W[0],y:W[1],zoom:W[2]}),v||S.setState({transform:W})},[b,v]);return $.useEffect(()=>{if(L.current){M.current=QNe({domNode:L.current,minZoom:d,maxZoom:h,translateExtent:c,viewport:l,onDraggingChange:V=>S.setState(K=>K.paneDragging===V?K:{paneDragging:V}),onPanZoomStart:(V,K)=>{const{onViewportChangeStart:z,onMoveStart:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoom:(V,K)=>{const{onViewportChange:z,onMove:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoomEnd:(V,K)=>{const{onViewportChangeEnd:z,onMoveEnd:j}=S.getState();j==null||j(V,K),z==null||z(K)}});const{x:W,y:P,zoom:B}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[W,P,B],domNode:L.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),$.useEffect(()=>{var W;(W=M.current)==null||W.update({onPaneContextMenu:n,zoomOnScroll:e,zoomOnPinch:t,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:r,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:f,noPanClassName:m,userSelectionActive:x,noWheelClassName:p,lib:E,onTransformChange:A,connectionInProgress:I,selectionOnDrag:C,paneClickDistance:w})},[n,e,t,i,s,o,r,a,R,f,m,x,p,E,A,I,C,w]),y.jsx("div",{className:"react-flow__renderer",ref:L,style:k5,children:g})}const lTe=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function cTe(){const{userSelectionActive:n,userSelectionRect:e}=Mi(lTe,as);return n&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const n7=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},dTe=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function hTe({isSelecting:n,selectionKeyPressed:e,selectionMode:t=UE.Full,panOnDrag:i,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:g}){const p=ds(),{userSelectionActive:m,elementsSelectable:b,dragging:v,connectionInProgress:w}=Mi(dTe,as),C=b&&(n||m),S=$.useRef(null),L=$.useRef(),x=$.useRef(new Set),E=$.useRef(new Set),I=$.useRef(!1),R=z=>{if(I.current||w){I.current=!1;return}l==null||l(z),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},M=z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){z.preventDefault();return}c==null||c(z)},A=d?z=>d(z):void 0,W=z=>{I.current&&(z.stopPropagation(),I.current=!1)},P=z=>{var xe,je;const{domNode:j}=p.getState();if(L.current=j==null?void 0:j.getBoundingClientRect(),!L.current)return;const Q=z.target===S.current;if(!Q&&!!z.target.closest(".nokey")||!n||!(o&&Q||e)||z.button!==0||!z.isPrimary)return;(je=(xe=z.target)==null?void 0:xe.setPointerCapture)==null||je.call(xe,z.pointerId),I.current=!1;const{x:ce,y:Ce}=Fd(z.nativeEvent,L.current);p.setState({userSelectionRect:{width:0,height:0,startX:ce,startY:Ce,x:ce,y:Ce}}),Q||(z.stopPropagation(),z.preventDefault())},B=z=>{const{userSelectionRect:j,transform:Q,nodeLookup:Y,edgeLookup:te,connectionLookup:ce,triggerNodeChanges:Ce,triggerEdgeChanges:xe,defaultEdgeOptions:je,resetSelectedElements:ke}=p.getState();if(!L.current||!j)return;const{x:Le,y:Ve}=Fd(z.nativeEvent,L.current),{startX:ct,startY:dt}=j;if(!I.current){const Vt=e?0:s;if(Math.hypot(Le-ct,Ve-dt)<=Vt)return;ke(),r==null||r(z)}I.current=!0;const Be={startX:ct,startY:dt,x:LeVt.id)),E.current=new Set;const Si=(je==null?void 0:je.selectable)??!0;for(const Vt of x.current){const In=ce.get(Vt);if(In)for(const{edgeId:Nn}of In.values()){const Os=te.get(Nn);Os&&(Os.selectable??Si)&&E.current.add(Nn)}}if(!Bee(tt,x.current)){const Vt=n0(Y,x.current,!0);Ce(Vt)}if(!Bee(Tt,E.current)){const Vt=n0(te,E.current);xe(Vt)}p.setState({userSelectionRect:Be,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var j,Q;z.button===0&&((Q=(j=z.target)==null?void 0:j.releasePointerCapture)==null||Q.call(j,z.pointerId),!m&&z.target===S.current&&p.getState().userSelectionRect&&(R==null||R(z)),p.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(a==null||a(z),p.setState({nodesSelectionActive:x.current.size>0})))},K=i===!0||Array.isArray(i)&&i.includes(0);return y.jsxs("div",{className:uo(["react-flow__pane",{draggable:K,dragging:v,selection:n}]),onClick:C?void 0:n7(R,S),onContextMenu:n7(M,S),onWheel:n7(A,S),onPointerEnter:C?void 0:h,onPointerMove:C?B:u,onPointerUp:C?V:void 0,onPointerDownCapture:C?P:void 0,onClickCapture:C?W:void 0,onPointerLeave:f,ref:S,style:k5,children:[g,y.jsx(cTe,{})]})}function qB({id:n,store:e,unselect:t=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:r,nodeLookup:a,onError:l}=e.getState(),c=a.get(n);if(!c){l==null||l("012",_u.error012(n));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&r)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):s([n])}function pfe({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:i,nodeId:s,isSelectable:o,nodeClickDistance:r}){const a=ds(),[l,c]=$.useState(!1),d=$.useRef();return $.useEffect(()=>{d.current=BNe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{qB({id:h,store:a,nodeRef:n})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),$.useEffect(()=>{if(!(e||!n.current||!d.current))return d.current.update({noDragClassName:t,handleSelector:i,domNode:n.current,isSelectable:o,nodeId:s,nodeClickDistance:r}),()=>{var h;(h=d.current)==null||h.destroy()}},[t,i,e,o,n,s,r]),l}const uTe=n=>e=>e.selected&&(e.draggable||n&&typeof e.draggable>"u");function mfe(){const n=ds();return $.useCallback(t=>{const{nodeExtent:i,snapToGrid:s,snapGrid:o,nodesDraggable:r,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=n.getState(),h=new Map,u=uTe(r),f=s?o[0]:5,g=s?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*g*t.factor;for(const[,b]of c){if(!u(b))continue;let v={x:b.internals.positionAbsolute.x+p,y:b.internals.positionAbsolute.y+m};s&&(v=JN(v,o));const{position:w,positionAbsolute:C}=Tue({nodeId:b.id,nextPosition:v,nodeLookup:c,nodeExtent:i,nodeOrigin:d,onError:a});b.position=w,b.internals.positionAbsolute=C,h.set(b.id,b)}l(h)},[])}const bG=$.createContext(null),fTe=bG.Provider;bG.Consumer;const _fe=()=>$.useContext(bG),gTe=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),pTe=(n,e,t)=>i=>{const{connectionClickStartHandle:s,connectionMode:o,connection:r}=i,{fromHandle:a,toHandle:l,isValid:c}=r,d=(l==null?void 0:l.nodeId)===n&&(l==null?void 0:l.id)===e&&(l==null?void 0:l.type)===t;return{connectingFrom:(a==null?void 0:a.nodeId)===n&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===t,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===n&&(s==null?void 0:s.id)===e&&(s==null?void 0:s.type)===t,isPossibleEndHandle:o===Xy.Strict?(a==null?void 0:a.type)!==t:n!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:d&&c}};function mTe({type:n="source",position:e=It.Top,isValidConnection:t,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:r,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...u},f){var B,V;const g=r||null,p=n==="target",m=ds(),b=_fe(),{connectOnClick:v,noPanClassName:w,rfId:C}=Mi(gTe,as),{connectingFrom:S,connectingTo:L,clickConnecting:x,isPossibleEndHandle:E,connectionInProcess:I,clickConnectionInProcess:R,valid:M}=Mi(pTe(b,g,n),as);b||(V=(B=m.getState()).onError)==null||V.call(B,"010",_u.error010());const A=K=>{const{defaultEdgeOptions:z,onConnect:j,hasDefaultEdges:Q}=m.getState(),Y={...z,...K};if(Q){const{edges:te,setEdges:ce}=m.getState();ce(yNe(Y,te))}j==null||j(Y),a==null||a(Y)},W=K=>{if(!b)return;const z=Wue(K.nativeEvent);if(s&&(z&&K.button===0||!z)){const j=m.getState();UB.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:p,handleId:g,nodeId:b,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...Q)=>{var Y,te;return(te=(Y=m.getState()).onConnectEnd)==null?void 0:te.call(Y,...Q)},updateConnection:j.updateConnection,onConnect:A,isValidConnection:t||((...Q)=>{var Y,te;return((te=(Y=m.getState()).isValidConnection)==null?void 0:te.call(Y,...Q))??!0}),getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}z?d==null||d(K):h==null||h(K)},P=K=>{const{onClickConnectStart:z,onClickConnectEnd:j,connectionClickStartHandle:Q,connectionMode:Y,isValidConnection:te,lib:ce,rfId:Ce,nodeLookup:xe,connection:je}=m.getState();if(!b||!Q&&!s)return;if(!Q){z==null||z(K.nativeEvent,{nodeId:b,handleId:g,handleType:n}),m.setState({connectionClickStartHandle:{nodeId:b,type:n,id:g}});return}const ke=Fue(K.target),Le=t||te,{connection:Ve,isValid:ct}=UB.isValid(K.nativeEvent,{handle:{nodeId:b,id:g,type:n},connectionMode:Y,fromNodeId:Q.nodeId,fromHandleId:Q.id||null,fromType:Q.type,isValidConnection:Le,flowId:Ce,doc:ke,lib:ce,nodeLookup:xe});ct&&Ve&&A(Ve);const dt=structuredClone(je);delete dt.inProgress,dt.toPosition=dt.toHandle?dt.toHandle.position:null,j==null||j(K,dt),m.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${C}-${b}-${g}-${n}`,className:uo(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",w,c,{source:!p,target:p,connectable:i,connectablestart:s,connectableend:o,clickconnecting:x,connectingfrom:S,connectingto:L,valid:M,connectionindicator:i&&(!I||E)&&(I||R?o:s)}]),onMouseDown:W,onTouchStart:W,onClick:v?P:void 0,ref:f,...u,children:l})}const nS=$.memo(ffe(mTe));function _Te({data:n,isConnectable:e,sourcePosition:t=It.Bottom}){return y.jsxs(y.Fragment,{children:[n==null?void 0:n.label,y.jsx(nS,{type:"source",position:t,isConnectable:e})]})}function bTe({data:n,isConnectable:e,targetPosition:t=It.Top,sourcePosition:i=It.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(nS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label,y.jsx(nS,{type:"source",position:i,isConnectable:e})]})}function vTe(){return null}function wTe({data:n,isConnectable:e,targetPosition:t=It.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(nS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label]})}const $M={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},dte={input:_Te,default:bTe,output:wTe,group:vTe};function CTe(n){var e,t,i,s;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((e=n.style)==null?void 0:e.width),height:n.height??n.initialHeight??((t=n.style)==null?void 0:t.height)}:{width:n.width??((i=n.style)==null?void 0:i.width),height:n.height??((s=n.style)==null?void 0:s.height)}}const yTe=n=>{const{width:e,height:t,x:i,y:s}=QN(n.nodeLookup,{filter:o=>!!o.selected});return{width:Od(e)?e:null,height:Od(t)?t:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${i}px,${s}px)`}};function STe({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const i=ds(),{width:s,height:o,transformString:r,userSelectionActive:a}=Mi(yTe,as),l=mfe(),c=$.useRef(null);$.useEffect(()=>{var f;t||(f=c.current)==null||f.focus({preventScroll:!0})},[t]);const d=!a&&s!==null&&o!==null;if(pfe({nodeRef:c,disabled:!d}),!d)return null;const h=n?f=>{const g=i.getState().nodes.filter(p=>p.selected);n(f,g)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call($M,f.key)&&(f.preventDefault(),l({direction:$M[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:uo(["react-flow__nodesselection","react-flow__container",e]),style:{transform:r},children:y.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:u,style:{width:s,height:o}})})}const hte=typeof window<"u"?window:void 0,xTe=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function bfe({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:h,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:m,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:E,defaultViewport:I,translateExtent:R,minZoom:M,maxZoom:A,preventScrolling:W,onSelectionContextMenu:P,noWheelClassName:B,noPanClassName:V,disableKeyboardA11y:K,onViewportChange:z,isControlledViewport:j}){const{nodesSelectionActive:Q,userSelectionActive:Y}=Mi(xTe,as),te=GE(c,{target:hte}),ce=GE(p,{target:hte}),Ce=ce||E,xe=ce||C,je=d&&Ce!==!0,ke=te||Y||je;return sTe({deleteKeyCode:l,multiSelectionKeyCode:g}),y.jsx(aTe,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:xe,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:!te&&Ce,defaultViewport:I,translateExtent:R,minZoom:M,maxZoom:A,zoomActivationKeyCode:m,preventScrolling:W,noWheelClassName:B,noPanClassName:V,onViewportChange:z,isControlledViewport:j,paneClickDistance:a,selectionOnDrag:je,children:y.jsxs(hTe,{onSelectionStart:u,onSelectionEnd:f,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,panOnDrag:Ce,isSelecting:!!ke,selectionMode:h,selectionKeyPressed:te,paneClickDistance:a,selectionOnDrag:je,children:[n,Q&&y.jsx(STe,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:K})]})})}bfe.displayName="FlowRenderer";const LTe=$.memo(bfe),kTe=n=>e=>n?cG(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(t=>t.id):Array.from(e.nodeLookup.keys());function ETe(n){return Mi($.useCallback(kTe(n),[n]),as)}const ITe=n=>n.updateNodeInternals;function NTe(){const n=Mi(ITe),[e]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const i=new Map;t.forEach(s=>{const o=s.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:s.target,force:!0})}),n(i)}));return $.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function DTe({node:n,nodeType:e,hasDimensions:t,resizeObserver:i}){const s=ds(),o=$.useRef(null),r=$.useRef(null),a=$.useRef(n.sourcePosition),l=$.useRef(n.targetPosition),c=$.useRef(e),d=t&&!!n.internals.handleBounds;return $.useEffect(()=>{o.current&&!n.hidden&&(!d||r.current!==o.current)&&(r.current&&(i==null||i.unobserve(r.current)),i==null||i.observe(o.current),r.current=o.current)},[d,n.hidden]),$.useEffect(()=>()=>{r.current&&(i==null||i.unobserve(r.current),r.current=null)},[]),$.useEffect(()=>{if(o.current){const h=c.current!==e,u=a.current!==n.sourcePosition,f=l.current!==n.targetPosition;(h||u||f)&&(c.current=e,a.current=n.sourcePosition,l.current=n.targetPosition,s.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:o.current,force:!0}]])))}},[n.id,e,n.sourcePosition,n.targetPosition]),o}function TTe({id:n,onClick:e,onMouseEnter:t,onMouseMove:i,onMouseLeave:s,onContextMenu:o,onDoubleClick:r,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:h,noDragClassName:u,noPanClassName:f,disableKeyboardA11y:g,rfId:p,nodeTypes:m,nodeClickDistance:b,onError:v}){const{node:w,internals:C,isParent:S}=Mi(Le=>{const Ve=Le.nodeLookup.get(n),ct=Le.parentLookup.has(n);return{node:Ve,internals:Ve.internals,isParent:ct}},as);let L=w.type||"default",x=(m==null?void 0:m[L])||dte[L];x===void 0&&(v==null||v("003",_u.error003(L)),L="default",x=(m==null?void 0:m.default)||dte.default);const E=!!(w.draggable||a&&typeof w.draggable>"u"),I=!!(w.selectable||l&&typeof w.selectable>"u"),R=!!(w.connectable||c&&typeof w.connectable>"u"),M=!!(w.focusable||d&&typeof w.focusable>"u"),A=ds(),W=Pue(w),P=DTe({node:w,nodeType:L,hasDimensions:W,resizeObserver:h}),B=pfe({nodeRef:P,disabled:w.hidden||!E,noDragClassName:u,handleSelector:w.dragHandle,nodeId:n,isSelectable:I,nodeClickDistance:b}),V=mfe();if(w.hidden)return null;const K=Wg(w),z=CTe(w),j=I||E||e||t||i||s,Q=t?Le=>t(Le,{...C.userNode}):void 0,Y=i?Le=>i(Le,{...C.userNode}):void 0,te=s?Le=>s(Le,{...C.userNode}):void 0,ce=o?Le=>o(Le,{...C.userNode}):void 0,Ce=r?Le=>r(Le,{...C.userNode}):void 0,xe=Le=>{const{selectNodesOnDrag:Ve,nodeDragThreshold:ct}=A.getState();I&&(!Ve||!E||ct>0)&&qB({id:n,store:A,nodeRef:P}),e&&e(Le,{...C.userNode})},je=Le=>{if(!(Bue(Le.nativeEvent)||g)){if(kue.includes(Le.key)&&I){const Ve=Le.key==="Escape";qB({id:n,store:A,unselect:Ve,nodeRef:P})}else if(E&&w.selected&&Object.prototype.hasOwnProperty.call($M,Le.key)){Le.preventDefault();const{ariaLabelConfig:Ve}=A.getState();A.setState({ariaLiveMessage:Ve["node.a11yDescription.ariaLiveMessage"]({direction:Le.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:$M[Le.key],factor:Le.shiftKey?4:1})}}},ke=()=>{var Tt;if(g||!((Tt=P.current)!=null&&Tt.matches(":focus-visible")))return;const{transform:Le,width:Ve,height:ct,autoPanOnNodeFocus:dt,setCenter:Be}=A.getState();if(!dt)return;cG(new Map([[n,w]]),{x:0,y:0,width:Ve,height:ct},Le,!0).length>0||Be(w.position.x+K.width/2,w.position.y+K.height/2,{zoom:Le[2]})};return y.jsx("div",{className:uo(["react-flow__node",`react-flow__node-${L}`,{[f]:E},w.className,{selected:w.selected,selectable:I,parent:S,draggable:E,dragging:B}]),ref:P,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:W?"visible":"hidden",...w.style,...z},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Q,onMouseMove:Y,onMouseLeave:te,onContextMenu:ce,onClick:xe,onDoubleClick:Ce,onKeyDown:M?je:void 0,tabIndex:M?0:void 0,onFocus:M?ke:void 0,role:w.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${afe}-${p}`,"aria-label":w.ariaLabel,...w.domAttributes,children:y.jsx(fTe,{value:n,children:y.jsx(x,{id:n,data:w.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:I,draggable:E,deletable:w.deletable??!0,isConnectable:R,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:B,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...K})})})}var RTe=$.memo(TTe);const MTe=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function vfe(n){const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,onError:o}=Mi(MTe,as),r=ETe(n.onlyRenderVisibleElements),a=NTe();return y.jsx("div",{className:"react-flow__nodes",style:k5,children:r.map(l=>y.jsx(RTe,{id:l,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,nodeClickDistance:n.nodeClickDistance,onError:o},l))})}vfe.displayName="NodeRenderer";const ATe=$.memo(vfe);function PTe(n){return Mi($.useCallback(t=>{if(!n)return t.edges.map(s=>s.id);const i=[];if(t.width&&t.height)for(const s of t.edges){const o=t.nodeLookup.get(s.source),r=t.nodeLookup.get(s.target);o&&r&&vNe({sourceNode:o,targetNode:r,width:t.width,height:t.height,transform:t.transform})&&i.push(s.id)}return i},[n]),as)}const OTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n}};return y.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},FTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n,fill:n}};return y.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},ute={[U1.Arrow]:OTe,[U1.ArrowClosed]:FTe};function BTe(n){const e=ds();return $.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(ute,n)?ute[n]:((o=(s=e.getState()).onError)==null||o.call(s,"009",_u.error009(n)),null)},[n])}const WTe=({id:n,type:e,color:t,width:i=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:r,orient:a="auto-start-reverse"})=>{const l=BTe(e);return l?y.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:y.jsx(l,{color:t,strokeWidth:r})}):null},wfe=({defaultColor:n,rfId:e})=>{const t=Mi(o=>o.edges),i=Mi(o=>o.defaultEdgeOptions),s=$.useMemo(()=>ENe(t,{id:e,defaultColor:n,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[t,i,e,n]);return s.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:s.map(o=>y.jsx(WTe,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};wfe.displayName="MarkerDefinitions";var HTe=$.memo(wfe);function Cfe({x:n,y:e,label:t,labelStyle:i,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:r=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d}){const[h,u]=$.useState({x:1,y:0,width:0,height:0}),f=uo(["react-flow__edge-textwrapper",c]),g=$.useRef(null);return $.useEffect(()=>{if(g.current){const p=g.current.getBBox();u({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),t?y.jsxs("g",{transform:`translate(${n-h.width/2} ${e-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...d,children:[s&&y.jsx("rect",{width:h.width+2*r[0],x:-r[0],y:-r[1],height:h.height+2*r[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),y.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:g,style:i,children:t}),l]}):null}Cfe.displayName="EdgeText";const VTe=$.memo(Cfe);function E5({path:n,labelX:e,labelY:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...d,d:n,fill:"none",className:uo(["react-flow__edge-path",d.className])}),c?y.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,i&&Od(e)&&Od(t)?y.jsx(VTe,{x:e,y:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function fte({pos:n,x1:e,y1:t,x2:i,y2:s}){return n===It.Left||n===It.Right?[.5*(e+i),t]:[e,.5*(t+s)]}function yfe({sourceX:n,sourceY:e,sourcePosition:t=It.Bottom,targetX:i,targetY:s,targetPosition:o=It.Top}){const[r,a]=fte({pos:t,x1:n,y1:e,x2:i,y2:s}),[l,c]=fte({pos:o,x1:i,y1:s,x2:n,y2:e}),[d,h,u,f]=Hue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:r,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${n},${e} C${r},${a} ${l},${c} ${i},${s}`,d,h,u,f]}function Sfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r,targetPosition:a,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[v,w,C]=yfe({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a}),S=n.isInternal?void 0:e;return y.jsx(E5,{id:S,path:v,labelX:w,labelY:C,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})})}const zTe=Sfe({isInternal:!1}),xfe=Sfe({isInternal:!0});zTe.displayName="SimpleBezierEdge";xfe.displayName="SimpleBezierEdgeInternal";function Lfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,sourcePosition:f=It.Bottom,targetPosition:g=It.Top,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=zB({sourceX:t,sourceY:i,sourcePosition:f,targetX:s,targetY:o,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),L=n.isInternal?void 0:e;return y.jsx(E5,{id:L,path:w,labelX:C,labelY:S,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:p,markerStart:m,interactionWidth:v})})}const kfe=Lfe({isInternal:!1}),Efe=Lfe({isInternal:!0});kfe.displayName="SmoothStepEdge";Efe.displayName="SmoothStepEdgeInternal";function Ife(n){return $.memo(({id:e,...t})=>{var s;const i=n.isInternal?void 0:e;return y.jsx(kfe,{...t,id:i,pathOptions:$.useMemo(()=>{var o;return{borderRadius:0,offset:(o=t.pathOptions)==null?void 0:o.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const jTe=Ife({isInternal:!1}),Nfe=Ife({isInternal:!0});jTe.displayName="StepEdge";Nfe.displayName="StepEdgeInternal";function Dfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})=>{const[m,b,v]=jue({sourceX:t,sourceY:i,targetX:s,targetY:o}),w=n.isInternal?void 0:e;return y.jsx(E5,{id:w,path:m,labelX:b,labelY:v,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})})}const $Te=Dfe({isInternal:!1}),Tfe=Dfe({isInternal:!0});$Te.displayName="StraightEdge";Tfe.displayName="StraightEdgeInternal";function Rfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r=It.Bottom,targetPosition:a=It.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=Vue({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a,curvature:b==null?void 0:b.curvature}),L=n.isInternal?void 0:e;return y.jsx(E5,{id:L,path:w,labelX:C,labelY:S,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:v})})}const UTe=Rfe({isInternal:!1}),Mfe=Rfe({isInternal:!0});UTe.displayName="BezierEdge";Mfe.displayName="BezierEdgeInternal";const gte={default:Mfe,straight:Tfe,step:Nfe,smoothstep:Efe,simplebezier:xfe},pte={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},qTe=(n,e,t)=>t===It.Left?n-e:t===It.Right?n+e:n,KTe=(n,e,t)=>t===It.Top?n-e:t===It.Bottom?n+e:n,mte="react-flow__edgeupdater";function _te({position:n,centerX:e,centerY:t,radius:i=10,onMouseDown:s,onMouseEnter:o,onMouseOut:r,type:a}){return y.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:r,className:uo([mte,`${mte}-${a}`]),cx:qTe(e,i,n),cy:KTe(t,i,n),r:i,stroke:"transparent",fill:"transparent"})}function GTe({isReconnectable:n,reconnectRadius:e,edge:t,sourceX:i,sourceY:s,targetX:o,targetY:r,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,setReconnecting:u,setUpdateHover:f}){const g=ds(),p=(C,S)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:x,connectionMode:E,connectionRadius:I,lib:R,onConnectStart:M,cancelConnection:A,nodeLookup:W,rfId:P,panBy:B,updateConnection:V}=g.getState(),K=S.type==="target",z=(Y,te)=>{u(!1),h==null||h(Y,t,S.type,te)},j=Y=>c==null?void 0:c(t,Y),Q=(Y,te)=>{u(!0),d==null||d(C,t,S.type),M==null||M(Y,te)};UB.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:E,connectionRadius:I,domNode:x,handleId:S.id,nodeId:S.nodeId,nodeLookup:W,isTarget:K,edgeUpdaterType:S.type,lib:R,flowId:P,cancelConnection:A,panBy:B,isValidConnection:(...Y)=>{var te,ce;return((ce=(te=g.getState()).isValidConnection)==null?void 0:ce.call(te,...Y))??!0},onConnect:j,onConnectStart:Q,onConnectEnd:(...Y)=>{var te,ce;return(ce=(te=g.getState()).onConnectEnd)==null?void 0:ce.call(te,...Y)},onReconnectEnd:z,updateConnection:V,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},m=C=>p(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>p(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),v=()=>f(!0),w=()=>f(!1);return y.jsxs(y.Fragment,{children:[(n===!0||n==="source")&&y.jsx(_te,{position:a,centerX:i,centerY:s,radius:e,onMouseDown:m,onMouseEnter:v,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&y.jsx(_te,{position:l,centerX:o,centerY:r,radius:e,onMouseDown:b,onMouseEnter:v,onMouseOut:w,type:"target"})]})}function YTe({id:n,edgesFocusable:e,edgesReconnectable:t,elementsSelectable:i,onClick:s,onDoubleClick:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,rfId:g,edgeTypes:p,noPanClassName:m,onError:b,disableKeyboardA11y:v}){let w=Mi(Be=>Be.edgeLookup.get(n));const C=Mi(Be=>Be.defaultEdgeOptions);w=C?{...C,...w}:w;let S=w.type||"default",L=(p==null?void 0:p[S])||gte[S];L===void 0&&(b==null||b("011",_u.error011(S)),S="default",L=(p==null?void 0:p.default)||gte.default);const x=!!(w.focusable||e&&typeof w.focusable>"u"),E=typeof h<"u"&&(w.reconnectable||t&&typeof w.reconnectable>"u"),I=!!(w.selectable||i&&typeof w.selectable>"u"),R=$.useRef(null),[M,A]=$.useState(!1),[W,P]=$.useState(!1),B=ds(),{zIndex:V,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te}=Mi($.useCallback(Be=>{const tt=Be.nodeLookup.get(w.source),Tt=Be.nodeLookup.get(w.target);if(!tt||!Tt)return{zIndex:w.zIndex,...pte};const Si=kNe({id:n,sourceNode:tt,targetNode:Tt,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:Be.connectionMode,onError:b});return{zIndex:bNe({selected:w.selected,zIndex:w.zIndex,sourceNode:tt,targetNode:Tt,elevateOnSelect:Be.elevateEdgesOnSelect,zIndexMode:Be.zIndexMode}),...Si||pte}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),as),ce=$.useMemo(()=>w.markerStart?`url('#${jB(w.markerStart,g)}')`:void 0,[w.markerStart,g]),Ce=$.useMemo(()=>w.markerEnd?`url('#${jB(w.markerEnd,g)}')`:void 0,[w.markerEnd,g]);if(w.hidden||K===null||z===null||j===null||Q===null)return null;const xe=Be=>{var Vt;const{addSelectedEdges:tt,unselectNodesAndEdges:Tt,multiSelectionActive:Si}=B.getState();I&&(B.setState({nodesSelectionActive:!1}),w.selected&&Si?(Tt({nodes:[],edges:[w]}),(Vt=R.current)==null||Vt.blur()):tt([n])),s&&s(Be,w)},je=o?Be=>{o(Be,{...w})}:void 0,ke=r?Be=>{r(Be,{...w})}:void 0,Le=a?Be=>{a(Be,{...w})}:void 0,Ve=l?Be=>{l(Be,{...w})}:void 0,ct=c?Be=>{c(Be,{...w})}:void 0,dt=Be=>{var tt;if(!v&&kue.includes(Be.key)&&I){const{unselectNodesAndEdges:Tt,addSelectedEdges:Si}=B.getState();Be.key==="Escape"?((tt=R.current)==null||tt.blur(),Tt({edges:[w]})):Si([n])}};return y.jsx("svg",{style:{zIndex:V},children:y.jsxs("g",{className:uo(["react-flow__edge",`react-flow__edge-${S}`,w.className,m,{selected:w.selected,animated:w.animated,inactive:!I&&!s,updating:M,selectable:I}]),onClick:xe,onDoubleClick:je,onContextMenu:ke,onMouseEnter:Le,onMouseMove:Ve,onMouseLeave:ct,onKeyDown:x?dt:void 0,tabIndex:x?0:void 0,role:w.ariaRole??(x?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":x?`${lfe}-${g}`:void 0,ref:R,...w.domAttributes,children:[!W&&y.jsx(L,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:I,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ce,markerEnd:Ce,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),E&&y.jsx(GTe,{edge:w,isReconnectable:E,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,sourceX:K,sourceY:z,targetX:j,targetY:Q,sourcePosition:Y,targetPosition:te,setUpdateHover:A,setReconnecting:P})]})})}var ZTe=$.memo(YTe);const XTe=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Afe({defaultMarkerColor:n,onlyRenderVisibleElements:e,rfId:t,edgeTypes:i,noPanClassName:s,onReconnect:o,onEdgeContextMenu:r,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,disableKeyboardA11y:p}){const{edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,onError:w}=Mi(XTe,as),C=PTe(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(HTe,{defaultColor:n,rfId:t}),C.map(S=>y.jsx(ZTe,{id:S,edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:h,onDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,rfId:t,onError:w,edgeTypes:i,disableKeyboardA11y:p},S))]})}Afe.displayName="EdgeRenderer";const QTe=$.memo(Afe),JTe=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function e2e({children:n}){const e=Mi(JTe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:n})}function t2e(n){const e=_G(),t=$.useRef(!1);$.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const i2e=n=>{var e;return(e=n.panZoom)==null?void 0:e.syncViewport};function n2e(n){const e=Mi(i2e),t=ds();return $.useEffect(()=>{n&&(e==null||e(n),t.setState({transform:[n.x,n.y,n.zoom]}))},[n,e]),null}function s2e(n){return n.connection.inProgress?{...n.connection,to:eD(n.connection.to,n.transform)}:{...n.connection}}function o2e(n){return s2e}function r2e(n){const e=o2e();return Mi(e,as)}const a2e=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function l2e({containerStyle:n,style:e,type:t,component:i}){const{nodesConnectable:s,width:o,height:r,isValid:a,inProgress:l}=Mi(a2e,as);return!(o&&s&&l)?null:y.jsx("svg",{style:n,width:o,height:r,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:uo(["react-flow__connection",Nue(a)]),children:y.jsx(Pfe,{style:e,type:t,CustomComponent:i,isValid:a})})})}const Pfe=({style:n,type:e=Nf.Bezier,CustomComponent:t,isValid:i})=>{const{inProgress:s,from:o,fromNode:r,fromHandle:a,fromPosition:l,to:c,toNode:d,toHandle:h,toPosition:u,pointer:f}=r2e();if(!s)return;if(t)return y.jsx(t,{connectionLineType:e,connectionLineStyle:n,fromNode:r,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:u,connectionStatus:Nue(i),toNode:d,toHandle:h,pointer:f});let g="";const p={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:u};switch(e){case Nf.Bezier:[g]=Vue(p);break;case Nf.SimpleBezier:[g]=yfe(p);break;case Nf.Step:[g]=zB({...p,borderRadius:0});break;case Nf.SmoothStep:[g]=zB(p);break;default:[g]=jue(p)}return y.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:n})};Pfe.displayName="ConnectionLine";const c2e={};function bte(n=c2e){$.useRef(n),ds(),$.useEffect(()=>{},[n])}function d2e(){ds(),$.useRef(!1),$.useEffect(()=>{},[])}function Ofe({nodeTypes:n,edgeTypes:e,onInit:t,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:r,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:u,onSelectionEnd:f,connectionLineType:g,connectionLineStyle:p,connectionLineComponent:m,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,deleteKeyCode:E,onlyRenderVisibleElements:I,elementsSelectable:R,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,preventScrolling:B,defaultMarkerColor:V,zoomOnScroll:K,zoomOnPinch:z,panOnScroll:j,panOnScrollSpeed:Q,panOnScrollMode:Y,zoomOnDoubleClick:te,panOnDrag:ce,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:je,onPaneMouseLeave:ke,onPaneScroll:Le,onPaneContextMenu:Ve,paneClickDistance:ct,nodeClickDistance:dt,onEdgeContextMenu:Be,onEdgeMouseEnter:tt,onEdgeMouseMove:Tt,onEdgeMouseLeave:Si,reconnectRadius:Vt,onReconnect:In,onReconnectStart:Nn,onReconnectEnd:Os,noDragClassName:Da,noWheelClassName:Mo,noPanClassName:_l,disableKeyboardA11y:Ta,nodeExtent:xr,rfId:go,viewport:ei,onViewportChange:gn}){return bte(n),bte(e),d2e(),t2e(t),n2e(ei),y.jsx(LTe,{onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:je,onPaneMouseLeave:ke,onPaneContextMenu:Ve,onPaneScroll:Le,paneClickDistance:ct,deleteKeyCode:E,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,elementsSelectable:R,zoomOnScroll:K,zoomOnPinch:z,zoomOnDoubleClick:te,panOnScroll:j,panOnScrollSpeed:Q,panOnScrollMode:Y,panOnDrag:ce,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,onSelectionContextMenu:h,preventScrolling:B,noDragClassName:Da,noWheelClassName:Mo,noPanClassName:_l,disableKeyboardA11y:Ta,onViewportChange:gn,isControlledViewport:!!ei,children:y.jsxs(e2e,{children:[y.jsx(QTe,{edgeTypes:e,onEdgeClick:s,onEdgeDoubleClick:r,onReconnect:In,onReconnectStart:Nn,onReconnectEnd:Os,onlyRenderVisibleElements:I,onEdgeContextMenu:Be,onEdgeMouseEnter:tt,onEdgeMouseMove:Tt,onEdgeMouseLeave:Si,reconnectRadius:Vt,defaultMarkerColor:V,noPanClassName:_l,disableKeyboardA11y:Ta,rfId:go}),y.jsx(l2e,{style:p,type:g,component:m,containerStyle:b}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(ATe,{nodeTypes:n,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:dt,onlyRenderVisibleElements:I,noPanClassName:_l,noDragClassName:Da,disableKeyboardA11y:Ta,nodeExtent:xr,rfId:go}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}Ofe.displayName="GraphView";const h2e=$.memo(Ofe),vte=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:h,zIndexMode:u="basic"}={})=>{const f=new Map,g=new Map,p=new Map,m=new Map,b=i??e??[],v=t??n??[],w=d??[0,0],C=h??$E;que(p,m,b);const S=$B(v,f,g,{nodeOrigin:w,nodeExtent:C,zIndexMode:u});let L=[0,0,1];if(r&&s&&o){const x=QN(f,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:E,y:I,zoom:R}=dG(x,s,o,l,c,(a==null?void 0:a.padding)??.1);L=[E,I,R]}return{rfId:"1",width:s??0,height:o??0,transform:L,nodes:v,nodesInitialized:S,nodeLookup:f,parentLookup:g,edges:b,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:$E,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Xy.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:r??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Iue},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:uNe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Eue,zIndexMode:u,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},u2e=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u})=>DDe((f,g)=>{async function p(){const{nodeLookup:m,panZoom:b,fitViewOptions:v,fitViewResolver:w,width:C,height:S,minZoom:L,maxZoom:x}=g();b&&(await dNe({nodes:m,width:C,height:S,panZoom:b,minZoom:L,maxZoom:x},v),w==null||w.resolve(!0),f({fitViewResolver:null}))}return{...vte({nodes:n,edges:e,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,defaultNodes:t,defaultEdges:i,zIndexMode:u}),setNodes:m=>{const{nodeLookup:b,parentLookup:v,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:L}=g(),x=$B(m,b,v,{nodeOrigin:w,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:L});S&&x?(p(),f({nodes:m,nodesInitialized:x,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:m,nodesInitialized:x})},setEdges:m=>{const{connectionLookup:b,edgeLookup:v}=g();que(b,v,m),f({edges:m})},setDefaultNodesAndEdges:(m,b)=>{if(m){const{setNodes:v}=g();v(m),f({hasDefaultNodes:!0})}if(b){const{setEdges:v}=g();v(b),f({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:b,nodeLookup:v,parentLookup:w,domNode:C,nodeOrigin:S,nodeExtent:L,debug:x,fitViewQueued:E,zIndexMode:I}=g(),{changes:R,updatedInternals:M}=ANe(m,v,w,C,S,L,I);M&&(DNe(v,w,{nodeOrigin:S,nodeExtent:L,zIndexMode:I}),E?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(R==null?void 0:R.length)>0&&(x&&console.log("React Flow: trigger node changes",R),b==null||b(R)))},updateNodePositions:(m,b=!1)=>{const v=[];let w=[];const{nodeLookup:C,triggerNodeChanges:S,connection:L,updateConnection:x,onNodesChangeMiddlewareMap:E}=g();for(const[I,R]of m){const M=C.get(I),A=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(R!=null&&R.position)),W={id:I,type:"position",position:A?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:b};if(M&&L.inProgress&&L.fromNode.id===M.id){const P=K1(M,L.fromHandle,It.Left,!0);x({...L,from:P})}A&&M.parentId&&v.push({id:I,parentId:M.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),w.push(W)}if(v.length>0){const{parentLookup:I,nodeOrigin:R}=g(),M=mG(v,C,I,R);w.push(...M)}for(const I of E.values())w=I(w);S(w)},triggerNodeChanges:m=>{const{onNodesChange:b,setNodes:v,nodes:w,hasDefaultNodes:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=hfe(m,w);v(L)}S&&console.log("React Flow: trigger node changes",m),b==null||b(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:b,setEdges:v,edges:w,hasDefaultEdges:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=ufe(m,w);v(L)}S&&console.log("React Flow: trigger edge changes",m),b==null||b(m)}},addSelectedNodes:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>lb(x,!0));C(L);return}C(n0(w,new Set([...m]),!0)),S(n0(v))},addSelectedEdges:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>lb(x,!0));S(L);return}S(n0(v,new Set([...m]))),C(n0(w,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:b}={})=>{const{edges:v,nodes:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:L}=g(),x=m||w,E=b||v,I=[];for(const M of x){if(!M.selected)continue;const A=C.get(M.id);A&&(A.selected=!1),I.push(lb(M.id,!1))}const R=[];for(const M of E)M.selected&&R.push(lb(M.id,!1));S(I),L(R)},setMinZoom:m=>{const{panZoom:b,maxZoom:v}=g();b==null||b.setScaleExtent([m,v]),f({minZoom:m})},setMaxZoom:m=>{const{panZoom:b,minZoom:v}=g();b==null||b.setScaleExtent([v,m]),f({maxZoom:m})},setTranslateExtent:m=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(m),f({translateExtent:m})},resetSelectedElements:()=>{const{edges:m,nodes:b,triggerNodeChanges:v,triggerEdgeChanges:w,elementsSelectable:C}=g();if(!C)return;const S=b.reduce((x,E)=>E.selected?[...x,lb(E.id,!1)]:x,[]),L=m.reduce((x,E)=>E.selected?[...x,lb(E.id,!1)]:x,[]);v(S),w(L)},setNodeExtent:m=>{const{nodes:b,nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:S,nodeExtent:L,zIndexMode:x}=g();m[0][0]===L[0][0]&&m[0][1]===L[0][1]&&m[1][0]===L[1][0]&&m[1][1]===L[1][1]||($B(b,v,w,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:x}),f({nodeExtent:m}))},panBy:m=>{const{transform:b,width:v,height:w,panZoom:C,translateExtent:S}=g();return PNe({delta:m,panZoom:C,transform:b,translateExtent:S,width:v,height:w})},setCenter:async(m,b,v)=>{const{width:w,height:C,maxZoom:S,panZoom:L}=g();if(!L)return Promise.resolve(!1);const x=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:S;return await L.setViewport({x:w/2-m*x,y:C/2-b*x,zoom:x},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...Iue}})},updateConnection:m=>{f({connection:m})},reset:()=>f({...vte()})}},Object.is);function f2e({initialNodes:n,initialEdges:e,defaultNodes:t,defaultEdges:i,initialWidth:s,initialHeight:o,initialMinZoom:r,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u,children:f}){const[g]=$.useState(()=>u2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:c,minZoom:r,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:h,zIndexMode:u}));return y.jsx(TDe,{value:g,children:y.jsx(eTe,{children:f})})}function g2e({children:n,nodes:e,edges:t,defaultNodes:i,defaultEdges:s,width:o,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f}){return $.useContext(x5)?y.jsx(y.Fragment,{children:n}):y.jsx(f2e,{initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f,children:n})}const p2e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function m2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,className:s,nodeTypes:o,edgeTypes:r,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:u,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,onNodeDragStart:x,onNodeDrag:E,onNodeDragStop:I,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onSelectionChange:W,onSelectionDragStart:P,onSelectionDrag:B,onSelectionDragStop:V,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onBeforeDelete:Q,connectionMode:Y,connectionLineType:te=Nf.Bezier,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,deleteKeyCode:je="Backspace",selectionKeyCode:ke="Shift",selectionOnDrag:Le=!1,selectionMode:Ve=UE.Full,panActivationKeyCode:ct="Space",multiSelectionKeyCode:dt=KE()?"Meta":"Control",zoomActivationKeyCode:Be=KE()?"Meta":"Control",snapToGrid:tt,snapGrid:Tt,onlyRenderVisibleElements:Si=!1,selectNodesOnDrag:Vt,nodesDraggable:In,autoPanOnNodeFocus:Nn,nodesConnectable:Os,nodesFocusable:Da,nodeOrigin:Mo=cfe,edgesFocusable:_l,edgesReconnectable:Ta,elementsSelectable:xr=!0,defaultViewport:go=$De,minZoom:ei=.5,maxZoom:gn=2,translateExtent:bl=$E,preventScrolling:Lr=!0,nodeExtent:td,defaultMarkerColor:vl="#b1b1b7",zoomOnScroll:ch=!0,zoomOnPinch:Ks=!0,panOnScroll:hs=!1,panOnScrollSpeed:qn=.5,panOnScrollMode:kr=xv.Free,zoomOnDoubleClick:tn=!0,panOnDrag:us=!0,onPaneClick:Xr,onPaneMouseEnter:Dn,onPaneMouseMove:Yg,onPaneMouseLeave:_c,onPaneScroll:X,onPaneContextMenu:wl,paneClickDistance:Cn=1,nodeClickDistance:Ii=0,children:Qr,onReconnect:Qe,onReconnectStart:dh,onReconnectEnd:fi,onEdgeContextMenu:gi,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Jo,onEdgeMouseMove:po,onEdgeMouseLeave:er,reconnectRadius:id=10,onNodesChange:Tn,onEdgesChange:Er,noDragClassName:mo="nodrag",noWheelClassName:Wu="nowheel",noPanClassName:Hn="nopan",fitView:nd,fitViewOptions:hh,connectOnClick:Zg,attributionPosition:Ct,proOptions:ae,defaultEdgeOptions:Ee,elevateNodesOnSelect:rt=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:Rn=!1,autoPanOnConnect:li,autoPanOnNodeDrag:Ls,autoPanSpeed:ks,connectionRadius:Ir,isValidConnection:Hu,onError:Qn,style:Vu,id:uh,nodeDragThreshold:I_,connectionDragThreshold:vx,viewport:wx,onViewportChange:Cl,width:Qw,height:Xg,colorMode:fh="light",debug:N_,onScroll:Qg,ariaLabelConfig:zu,zIndexMode:Jw="basic",...eC},D_){const T_=uh||"1",tC=GDe(fh),gh=$.useCallback(sd=>{sd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Qg==null||Qg(sd)},[Qg]);return y.jsx("div",{"data-testid":"rf__wrapper",...eC,onScroll:gh,style:{...Vu,...p2e},ref:D_,className:uo(["react-flow",s,tC]),id:uh,role:"application",children:y.jsxs(g2e,{nodes:n,edges:e,width:Qw,height:Xg,fitView:nd,fitViewOptions:hh,minZoom:ei,maxZoom:gn,nodeOrigin:Mo,nodeExtent:td,zIndexMode:Jw,children:[y.jsx(h2e,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,nodeTypes:o,edgeTypes:r,connectionLineType:te,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,selectionKeyCode:ke,selectionOnDrag:Le,selectionMode:Ve,deleteKeyCode:je,multiSelectionKeyCode:dt,panActivationKeyCode:ct,zoomActivationKeyCode:Be,onlyRenderVisibleElements:Si,defaultViewport:go,translateExtent:bl,minZoom:ei,maxZoom:gn,preventScrolling:Lr,zoomOnScroll:ch,zoomOnPinch:Ks,zoomOnDoubleClick:tn,panOnScroll:hs,panOnScrollSpeed:qn,panOnScrollMode:kr,panOnDrag:us,onPaneClick:Xr,onPaneMouseEnter:Dn,onPaneMouseMove:Yg,onPaneMouseLeave:_c,onPaneScroll:X,onPaneContextMenu:wl,paneClickDistance:Cn,nodeClickDistance:Ii,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onReconnect:Qe,onReconnectStart:dh,onReconnectEnd:fi,onEdgeContextMenu:gi,onEdgeDoubleClick:Ra,onEdgeMouseEnter:Jo,onEdgeMouseMove:po,onEdgeMouseLeave:er,reconnectRadius:id,defaultMarkerColor:vl,noDragClassName:mo,noWheelClassName:Wu,noPanClassName:Hn,rfId:T_,disableKeyboardA11y:Rn,nodeExtent:td,viewport:wx,onViewportChange:Cl}),y.jsx(KDe,{nodes:n,edges:e,defaultNodes:t,defaultEdges:i,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,nodesDraggable:In,autoPanOnNodeFocus:Nn,nodesConnectable:Os,nodesFocusable:Da,edgesFocusable:_l,edgesReconnectable:Ta,elementsSelectable:xr,elevateNodesOnSelect:rt,elevateEdgesOnSelect:Et,minZoom:ei,maxZoom:gn,nodeExtent:td,onNodesChange:Tn,onEdgesChange:Er,snapToGrid:tt,snapGrid:Tt,connectionMode:Y,translateExtent:bl,connectOnClick:Zg,defaultEdgeOptions:Ee,fitView:nd,fitViewOptions:hh,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onNodeDragStart:x,onNodeDrag:E,onNodeDragStop:I,onSelectionDrag:B,onSelectionDragStart:P,onSelectionDragStop:V,onMove:d,onMoveStart:h,onMoveEnd:u,noPanClassName:Hn,nodeOrigin:Mo,rfId:T_,autoPanOnConnect:li,autoPanOnNodeDrag:Ls,autoPanSpeed:ks,onError:Qn,connectionRadius:Ir,isValidConnection:Hu,selectNodesOnDrag:Vt,nodeDragThreshold:I_,connectionDragThreshold:vx,onBeforeDelete:Q,debug:N_,ariaLabelConfig:zu,zIndexMode:Jw}),y.jsx(jDe,{onSelectionChange:W}),Qr,y.jsx(BDe,{proOptions:ae,position:Ct}),y.jsx(FDe,{rfId:T_,disableKeyboardA11y:Rn})]})})}var _2e=ffe(m2e);function b2e({dimensions:n,lineWidth:e,variant:t,className:i}){return y.jsx("path",{strokeWidth:e,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:uo(["react-flow__background-pattern",t,i])})}function v2e({radius:n,className:e}){return y.jsx("circle",{cx:n,cy:n,r:n,className:uo(["react-flow__background-pattern","dots",e])})}var ig;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ig||(ig={}));const w2e={[ig.Dots]:1,[ig.Lines]:1,[ig.Cross]:6},C2e=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Ffe({id:n,variant:e=ig.Dots,gap:t=20,size:i,lineWidth:s=1,offset:o=0,color:r,bgColor:a,style:l,className:c,patternClassName:d}){const h=$.useRef(null),{transform:u,patternId:f}=Mi(C2e,as),g=i||w2e[e],p=e===ig.Dots,m=e===ig.Cross,b=Array.isArray(t)?t:[t,t],v=[b[0]*u[2]||1,b[1]*u[2]||1],w=g*u[2],C=Array.isArray(o)?o:[o,o],S=m?[w,w]:v,L=[C[0]*u[2]||1+S[0]/2,C[1]*u[2]||1+S[1]/2],x=`${f}${n||""}`;return y.jsxs("svg",{className:uo(["react-flow__background",c]),style:{...l,...k5,"--xy-background-color-props":a,"--xy-background-pattern-color-props":r},ref:h,"data-testid":"rf__background",children:[y.jsx("pattern",{id:x,x:u[0]%v[0],y:u[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:p?y.jsx(v2e,{radius:w/2,className:d}):y.jsx(b2e,{dimensions:S,lineWidth:s,variant:e,className:d})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${x})`})]})}Ffe.displayName="Background";const y2e=$.memo(Ffe);function S2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function x2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function L2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function k2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function E2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function LT({children:n,className:e,...t}){return y.jsx("button",{type:"button",className:uo(["react-flow__controls-button",e]),...t,children:n})}const I2e=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Bfe({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:r,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left",orientation:u="vertical","aria-label":f}){const g=ds(),{isInteractive:p,minZoomReached:m,maxZoomReached:b,ariaLabelConfig:v}=Mi(I2e,as),{zoomIn:w,zoomOut:C,fitView:S}=_G(),L=()=>{w(),o==null||o()},x=()=>{C(),r==null||r()},E=()=>{S(s),a==null||a()},I=()=>{g.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)},R=u==="horizontal"?"horizontal":"vertical";return y.jsxs(L5,{className:uo(["react-flow__controls",R,c]),position:h,style:n,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(LT,{onClick:L,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:y.jsx(S2e,{})}),y.jsx(LT,{onClick:x,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:m,children:y.jsx(x2e,{})})]}),t&&y.jsx(LT,{className:"react-flow__controls-fitview",onClick:E,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:y.jsx(L2e,{})}),i&&y.jsx(LT,{className:"react-flow__controls-interactive",onClick:I,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:p?y.jsx(E2e,{}):y.jsx(k2e,{})}),d]})}Bfe.displayName="Controls";const N2e=$.memo(Bfe);function D2e({id:n,x:e,y:t,width:i,height:s,style:o,color:r,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:h,selected:u,onClick:f}){const{background:g,backgroundColor:p}=o||{},m=r||g||p;return y.jsx("rect",{className:uo(["react-flow__minimap-node",{selected:u},c]),x:e,y:t,rx:d,ry:d,width:i,height:s,style:{fill:m,stroke:a,strokeWidth:l},shapeRendering:h,onClick:f?b=>f(b,n):void 0})}const T2e=$.memo(D2e),R2e=n=>n.nodes.map(e=>e.id),s7=n=>n instanceof Function?n:()=>n;function M2e({nodeStrokeColor:n,nodeColor:e,nodeClassName:t="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:o=T2e,onClick:r}){const a=Mi(R2e,as),l=s7(e),c=s7(n),d=s7(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:a.map(u=>y.jsx(P2e,{id:u,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:o,onClick:r,shapeRendering:h},u))})}function A2e({id:n,nodeColorFunc:e,nodeStrokeColorFunc:t,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:r,NodeComponent:a,onClick:l}){const{node:c,x:d,y:h,width:u,height:f}=Mi(g=>{const p=g.nodeLookup.get(n);if(!p)return{node:void 0,x:0,y:0,width:0,height:0};const m=p.internals.userNode,{x:b,y:v}=p.internals.positionAbsolute,{width:w,height:C}=Wg(m);return{node:m,x:b,y:v,width:w,height:C}},as);return!c||c.hidden||!Pue(c)?null:y.jsx(a,{x:d,y:h,width:u,height:f,style:c.style,selected:!!c.selected,className:i(c),color:e(c),borderRadius:s,strokeColor:t(c),strokeWidth:o,shapeRendering:r,onClick:l,id:c.id})}const P2e=$.memo(A2e);var O2e=$.memo(M2e);const F2e=200,B2e=150,W2e=n=>!n.hidden,H2e=n=>{const e={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:e,boundingRect:n.nodeLookup.size>0?Aue(QN(n.nodeLookup,{filter:W2e}),e):e,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},V2e="react-flow__minimap-desc";function Wfe({style:n,className:e,nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:h,position:u="bottom-right",onClick:f,onNodeClick:g,pannable:p=!1,zoomable:m=!1,ariaLabel:b,inversePan:v,zoomStep:w=1,offsetScale:C=5}){const S=ds(),L=$.useRef(null),{boundingRect:x,viewBB:E,rfId:I,panZoom:R,translateExtent:M,flowWidth:A,flowHeight:W,ariaLabelConfig:P}=Mi(H2e,as),B=(n==null?void 0:n.width)??F2e,V=(n==null?void 0:n.height)??B2e,K=x.width/B,z=x.height/V,j=Math.max(K,z),Q=j*B,Y=j*V,te=C*j,ce=x.x-(Q-x.width)/2-te,Ce=x.y-(Y-x.height)/2-te,xe=Q+te*2,je=Y+te*2,ke=`${V2e}-${I}`,Le=$.useRef(0),Ve=$.useRef();Le.current=j,$.useEffect(()=>{if(L.current&&R)return Ve.current=$Ne({domNode:L.current,panZoom:R,getTransform:()=>S.getState().transform,getViewScale:()=>Le.current}),()=>{var tt;(tt=Ve.current)==null||tt.destroy()}},[R]),$.useEffect(()=>{var tt;(tt=Ve.current)==null||tt.update({translateExtent:M,width:A,height:W,inversePan:v,pannable:p,zoomStep:w,zoomable:m})},[p,m,v,w,M,A,W]);const ct=f?tt=>{var Vt;const[Tt,Si]=((Vt=Ve.current)==null?void 0:Vt.pointer(tt))||[0,0];f(tt,{x:Tt,y:Si})}:void 0,dt=g?$.useCallback((tt,Tt)=>{const Si=S.getState().nodeLookup.get(Tt).internals.userNode;g(tt,Si)},[]):void 0,Be=b??P["minimap.ariaLabel"];return y.jsx(L5,{position:u,style:{...n,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*j:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:uo(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:B,height:V,viewBox:`${ce} ${Ce} ${xe} ${je}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ke,ref:L,onClick:ct,children:[Be&&y.jsx("title",{id:ke,children:Be}),y.jsx(O2e,{onClick:dt,nodeColor:i,nodeStrokeColor:t,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:r,nodeComponent:a}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${ce-te},${Ce-te}h${xe+te*2}v${je+te*2}h${-xe-te*2}z - M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Wfe.displayName="MiniMap";const z2e=$.memo(Wfe),j2e=n=>e=>n?`${Math.max(1/e.transform[2],1)}`:void 0,$2e={[tS.Line]:"right",[tS.Handle]:"bottom-right"};function U2e({nodeId:n,position:e,variant:t=tS.Handle,className:i,style:s=void 0,children:o,color:r,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:u,autoScale:f=!0,shouldResize:g,onResizeStart:p,onResize:m,onResizeEnd:b}){const v=_fe(),w=typeof n=="string"?n:v,C=ds(),S=$.useRef(null),L=t===tS.Handle,x=Mi($.useCallback(j2e(L&&f),[L,f]),as),E=$.useRef(null),I=e??$2e[t];$.useEffect(()=>{if(!(!S.current||!w))return E.current||(E.current=sDe({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,domNode:V}=C.getState();return{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,paneDomNode:V}},onChange:(M,A)=>{const{triggerNodeChanges:W,nodeLookup:P,parentLookup:B,nodeOrigin:V}=C.getState(),K=[],z={x:M.x,y:M.y},j=P.get(w);if(j&&j.expandParent&&j.parentId){const Q=j.origin??V,Y=M.width??j.measured.width??0,te=M.height??j.measured.height??0,ce={id:j.id,parentId:j.parentId,rect:{width:Y,height:te,...Oue({x:M.x??j.position.x,y:M.y??j.position.y},{width:Y,height:te},j.parentId,P,Q)}},Ce=mG([ce],P,B,V);K.push(...Ce),z.x=M.x?Math.max(Q[0]*Y,M.x):void 0,z.y=M.y?Math.max(Q[1]*te,M.y):void 0}if(z.x!==void 0&&z.y!==void 0){const Q={id:w,type:"position",position:{...z}};K.push(Q)}if(M.width!==void 0&&M.height!==void 0){const Y={id:w,type:"dimensions",resizing:!0,setAttributes:u?u==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};K.push(Y)}for(const Q of A){const Y={...Q,type:"position"};K.push(Y)}W(K)},onEnd:({width:M,height:A})=>{const W={id:w,type:"dimensions",resizing:!1,dimensions:{width:M,height:A}};C.getState().triggerNodeChanges([W])}})),E.current.update({controlPosition:I,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:h,resizeDirection:u,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:g}),()=>{var M;(M=E.current)==null||M.destroy()}},[I,a,l,c,d,h,p,m,b,g]);const R=I.split("-");return y.jsx("div",{className:uo(["react-flow__resize-control","nodrag",...R,t,i]),ref:S,style:{...s,scale:x,...r&&{[L?"backgroundColor":"borderColor"]:r}},children:o})}$.memo(U2e);/** +`)),d=c.reduce((h,u)=>h.concat(...u),[]);return[c,d]}return[[],[]]},[n]);return $.useEffect(()=>{const l=(e==null?void 0:e.target)??tte,c=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(n!==null){const d=f=>{var m,b;if(s.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!s.current||s.current&&!c)&&Pue(f))return!1;const p=nte(f.code,a);if(o.current.add(f[p]),ite(r,o.current,!1)){const v=((b=(m=f.composedPath)==null?void 0:m.call(f))==null?void 0:b[0])||f.target,w=(v==null?void 0:v.nodeName)==="BUTTON"||(v==null?void 0:v.nodeName)==="A";e.preventDefault!==!1&&(s.current||!w)&&f.preventDefault(),i(!0)}},h=f=>{const g=nte(f.code,a);ite(r,o.current,!0)?(i(!1),o.current.clear()):o.current.delete(f[g]),f.key==="Meta"&&o.current.clear(),s.current=!1},u=()=>{o.current.clear(),i(!1)};return l==null||l.addEventListener("keydown",d),l==null||l.addEventListener("keyup",h),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{l==null||l.removeEventListener("keydown",d),l==null||l.removeEventListener("keyup",h),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[n,i]),t}function ite(n,e,t){return n.filter(i=>t||i.length===e.size).some(i=>i.every(s=>e.has(s)))}function nte(n,e){return e.includes(n)?"code":"key"}const UDe=()=>{const n=us();return $.useMemo(()=>({zoomIn:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:t}=n.getState();return t?t.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,t)=>{const{panZoom:i}=n.getState();return i?i.scaleTo(e,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(e,t)=>{const{transform:[i,s,o],panZoom:r}=n.getState();return r?(await r.setViewport({x:e.x??i,y:e.y??s,zoom:e.zoom??o},t),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,t,i]=n.getState().transform;return{x:e,y:t,zoom:i}},setCenter:async(e,t,i)=>n.getState().setCenter(e,t,i),fitBounds:async(e,t)=>{const{width:i,height:s,minZoom:o,maxZoom:r,panZoom:a}=n.getState(),l=cG(e,i,s,o,r,(t==null?void 0:t.padding)??.1);return a?(await a.setViewport(l,{duration:t==null?void 0:t.duration,ease:t==null?void 0:t.ease,interpolate:t==null?void 0:t.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,t={})=>{const{transform:i,snapGrid:s,snapToGrid:o,domNode:r}=n.getState();if(!r)return e;const{x:a,y:l}=r.getBoundingClientRect(),c={x:e.x-a,y:e.y-l},d=t.snapGrid??s,h=t.snapToGrid??o;return eD(c,i,h,d)},flowToScreenPosition:e=>{const{transform:t,domNode:i}=n.getState();if(!i)return e;const{x:s,y:o}=i.getBoundingClientRect(),r=$M(e,t);return{x:r.x+s,y:r.y+o}}}),[])};function afe(n,e){const t=[],i=new Map,s=[];for(const o of n)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")i.set(o.id,[o]);else{const r=i.get(o.id);r?r.push(o):i.set(o.id,[o])}for(const o of e){const r=i.get(o.id);if(!r){t.push(o);continue}if(r[0].type==="remove")continue;if(r[0].type==="replace"){t.push({...r[0].item});continue}const a={...o};for(const l of r)qDe(l,a);t.push(a)}return s.length&&s.forEach(o=>{o.index!==void 0?t.splice(o.index,0,{...o.item}):t.push({...o.item})}),t}function qDe(n,e){switch(n.type){case"select":{e.selected=n.selected;break}case"position":{typeof n.position<"u"&&(e.position=n.position),typeof n.dragging<"u"&&(e.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(e.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(e.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(e.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(e.resizing=n.resizing);break}}}function lfe(n,e){return afe(n,e)}function cfe(n,e){return afe(n,e)}function ab(n,e){return{id:n,type:"select",selected:e}}function QC(n,e=new Set,t=!1){const i=[];for(const[s,o]of n){const r=e.has(s);!(o.selected===void 0&&!r)&&o.selected!==r&&(t&&(o.selected=r),i.push(ab(o.id,r)))}return i}function ste({items:n=[],lookup:e}){var s;const t=[],i=new Map(n.map(o=>[o.id,o]));for(const[o,r]of n.entries()){const a=e.get(r.id),l=((s=a==null?void 0:a.internals)==null?void 0:s.userNode)??a;l!==void 0&&l!==r&&t.push({id:r.id,item:r,type:"replace"}),l===void 0&&t.push({item:r,type:"add",index:o})}for(const[o]of e)i.get(o)===void 0&&t.push({id:o,type:"remove"});return t}function ote(n){return{id:n.id,type:"remove"}}const rte=n=>iNe(n),KDe=n=>Iue(n);function dfe(n){return $.forwardRef(n)}const GDe=typeof window<"u"?$.useLayoutEffect:$.useEffect;function ate(n){const[e,t]=$.useState(BigInt(0)),[i]=$.useState(()=>YDe(()=>t(s=>s+BigInt(1))));return GDe(()=>{const s=i.get();s.length&&(n(s),i.reset())},[e]),i}function YDe(n){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n()}}}const hfe=$.createContext(null);function ZDe({children:n}){const e=us(),t=$.useCallback(a=>{const{nodes:l=[],setNodes:c,hasDefaultNodes:d,onNodesChange:h,nodeLookup:u,fitViewQueued:f,onNodesChangeMiddlewareMap:g}=e.getState();let p=l;for(const b of a)p=typeof b=="function"?b(p):b;let m=ste({items:p,lookup:u});for(const b of g.values())m=b(m);d&&c(p),m.length>0?h==null||h(m):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:v,setNodes:w}=e.getState();b&&w(v)})},[]),i=ate(t),s=$.useCallback(a=>{const{edges:l=[],setEdges:c,hasDefaultEdges:d,onEdgesChange:h,edgeLookup:u}=e.getState();let f=l;for(const g of a)f=typeof g=="function"?g(f):g;d?c(f):h&&h(ste({items:f,lookup:u}))},[]),o=ate(s),r=$.useMemo(()=>({nodeQueue:i,edgeQueue:o}),[]);return y.jsx(hfe.Provider,{value:r,children:n})}function XDe(){const n=$.useContext(hfe);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const QDe=n=>!!n.panZoom;function mG(){const n=UDe(),e=us(),t=XDe(),i=Ti(QDe),s=$.useMemo(()=>{const o=h=>e.getState().nodeLookup.get(h),r=h=>{t.nodeQueue.push(h)},a=h=>{t.edgeQueue.push(h)},l=h=>{var b,v;const{nodeLookup:u,nodeOrigin:f}=e.getState(),g=rte(h)?h:u.get(h.id),p=g.parentId?Mue(g.position,g.measured,g.parentId,u,f):g.position,m={...g,position:p,width:((b=g.measured)==null?void 0:b.width)??g.width,height:((v=g.measured)==null?void 0:v.height)??g.height};return Xy(m)},c=(h,u,f={replace:!1})=>{r(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&rte(m)?m:{...p,...m}}return p}))},d=(h,u,f={replace:!1})=>{a(g=>g.map(p=>{if(p.id===h){const m=typeof u=="function"?u(p):u;return f.replace&&KDe(m)?m:{...p,...m}}return p}))};return{getNodes:()=>e.getState().nodes.map(h=>({...h})),getNode:h=>{var u;return(u=o(h))==null?void 0:u.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:h=[]}=e.getState();return h.map(u=>({...u}))},getEdge:h=>e.getState().edgeLookup.get(h),setNodes:r,setEdges:a,addNodes:h=>{const u=Array.isArray(h)?h:[h];t.nodeQueue.push(f=>[...f,...u])},addEdges:h=>{const u=Array.isArray(h)?h:[h];t.edgeQueue.push(f=>[...f,...u])},toObject:()=>{const{nodes:h=[],edges:u=[],transform:f}=e.getState(),[g,p,m]=f;return{nodes:h.map(b=>({...b})),edges:u.map(b=>({...b})),viewport:{x:g,y:p,zoom:m}}},deleteElements:async({nodes:h=[],edges:u=[]})=>{const{nodes:f,edges:g,onNodesDelete:p,onEdgesDelete:m,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:w,onBeforeDelete:C}=e.getState(),{nodes:S,edges:L}=await aNe({nodesToRemove:h,edgesToRemove:u,nodes:f,edges:g,onBeforeDelete:C}),x=L.length>0,I=S.length>0;if(x){const E=L.map(ote);m==null||m(L),v(E)}if(I){const E=S.map(ote);p==null||p(S),b(E)}return(I||x)&&(w==null||w({nodes:S,edges:L})),{deletedNodes:S,deletedEdges:L}},getIntersectingNodes:(h,u=!0,f)=>{const g=Oee(h),p=g?h:l(h),m=f!==void 0;return p?(f||e.getState().nodes).filter(b=>{const v=e.getState().nodeLookup.get(b.id);if(v&&!g&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const w=Xy(m?b:v),C=qI(w,p);return u&&C>0||C>=w.width*w.height||C>=p.width*p.height}):[]},isNodeIntersecting:(h,u,f=!0)=>{const p=Oee(h)?h:l(h);if(!p)return!1;const m=qI(p,u);return f&&m>0||m>=u.width*u.height||m>=p.width*p.height},updateNode:c,updateNodeData:(h,u,f={replace:!1})=>{c(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},updateEdge:d,updateEdgeData:(h,u,f={replace:!1})=>{d(h,g=>{const p=typeof u=="function"?u(g):u;return f.replace?{...g,data:p}:{...g,data:{...g.data,...p}}},f)},getNodesBounds:h=>{const{nodeLookup:u,nodeOrigin:f}=e.getState();return nNe(h,{nodeLookup:u,nodeOrigin:f})},getHandleConnections:({type:h,id:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}-${h}${u?`-${u}`:""}`))==null?void 0:g.values())??[])},getNodeConnections:({type:h,handleId:u,nodeId:f})=>{var g;return Array.from(((g=e.getState().connectionLookup.get(`${f}${h?u?`-${h}-${u}`:`-${h}`:""}`))==null?void 0:g.values())??[])},fitView:async h=>{const u=e.getState().fitViewResolver??hNe();return e.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:u}),t.nodeQueue.push(f=>[...f]),u.promise}}},[]);return $.useMemo(()=>({...s,...n,viewportInitialized:i}),[i])}const lte=n=>n.selected,JDe=typeof window<"u"?window:void 0;function eTe({deleteKeyCode:n,multiSelectionKeyCode:e}){const t=us(),{deleteElements:i}=mG(),s=GI(n,{actInsideInputWithModifier:!1}),o=GI(e,{target:JDe});$.useEffect(()=>{if(s){const{edges:r,nodes:a}=t.getState();i({nodes:a.filter(lte),edges:r.filter(lte)}),t.setState({nodesSelectionActive:!1})}},[s]),$.useEffect(()=>{t.setState({multiSelectionActive:o})},[o])}function tTe(n){const e=us();$.useEffect(()=>{const t=()=>{var s,o,r,a;if(!n.current||!(((o=(s=n.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const i=dG(n.current);(i.height===0||i.width===0)&&((a=(r=e.getState()).onError)==null||a.call(r,"004",bu.error004())),e.setState({width:i.width||500,height:i.height||500})};if(n.current){t(),window.addEventListener("resize",t);const i=new ResizeObserver(()=>t());return i.observe(n.current),()=>{window.removeEventListener("resize",t),i&&n.current&&i.unobserve(n.current)}}},[])}const k5={position:"absolute",width:"100%",height:"100%",top:0,left:0},iTe=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function nTe({onPaneContextMenu:n,zoomOnScroll:e=!0,zoomOnPinch:t=!0,panOnScroll:i=!1,panOnScrollSpeed:s=.5,panOnScrollMode:o=Cv.Free,zoomOnDoubleClick:r=!0,panOnDrag:a=!0,defaultViewport:l,translateExtent:c,minZoom:d,maxZoom:h,zoomActivationKeyCode:u,preventScrolling:f=!0,children:g,noWheelClassName:p,noPanClassName:m,onViewportChange:b,isControlledViewport:v,paneClickDistance:w,selectionOnDrag:C}){const S=us(),L=$.useRef(null),{userSelectionActive:x,lib:I,connectionInProgress:E}=Ti(iTe,cs),R=GI(u),M=$.useRef();tTe(L);const A=$.useCallback(W=>{b==null||b({x:W[0],y:W[1],zoom:W[2]}),v||S.setState({transform:W})},[b,v]);return $.useEffect(()=>{if(L.current){M.current=GNe({domNode:L.current,minZoom:d,maxZoom:h,translateExtent:c,viewport:l,onDraggingChange:V=>S.setState(K=>K.paneDragging===V?K:{paneDragging:V}),onPanZoomStart:(V,K)=>{const{onViewportChangeStart:z,onMoveStart:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoom:(V,K)=>{const{onViewportChange:z,onMove:j}=S.getState();j==null||j(V,K),z==null||z(K)},onPanZoomEnd:(V,K)=>{const{onViewportChangeEnd:z,onMoveEnd:j}=S.getState();j==null||j(V,K),z==null||z(K)}});const{x:W,y:P,zoom:B}=M.current.getViewport();return S.setState({panZoom:M.current,transform:[W,P,B],domNode:L.current.closest(".react-flow")}),()=>{var V;(V=M.current)==null||V.destroy()}}},[]),$.useEffect(()=>{var W;(W=M.current)==null||W.update({onPaneContextMenu:n,zoomOnScroll:e,zoomOnPinch:t,panOnScroll:i,panOnScrollSpeed:s,panOnScrollMode:o,zoomOnDoubleClick:r,panOnDrag:a,zoomActivationKeyPressed:R,preventScrolling:f,noPanClassName:m,userSelectionActive:x,noWheelClassName:p,lib:I,onTransformChange:A,connectionInProgress:E,selectionOnDrag:C,paneClickDistance:w})},[n,e,t,i,s,o,r,a,R,f,m,x,p,I,A,E,C,w]),y.jsx("div",{className:"react-flow__renderer",ref:L,style:k5,children:g})}const sTe=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function oTe(){const{userSelectionActive:n,userSelectionRect:e}=Ti(sTe,cs);return n&&e?y.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const n7=(n,e)=>t=>{t.target===e.current&&(n==null||n(t))},rTe=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function aTe({isSelecting:n,selectionKeyPressed:e,selectionMode:t=UI.Full,panOnDrag:i,paneClickDistance:s,selectionOnDrag:o,onSelectionStart:r,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:u,onPaneMouseLeave:f,children:g}){const p=us(),{userSelectionActive:m,elementsSelectable:b,dragging:v,connectionInProgress:w}=Ti(rTe,cs),C=b&&(n||m),S=$.useRef(null),L=$.useRef(),x=$.useRef(new Set),I=$.useRef(new Set),E=$.useRef(!1),R=z=>{if(E.current||w){E.current=!1;return}l==null||l(z),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},M=z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){z.preventDefault();return}c==null||c(z)},A=d?z=>d(z):void 0,W=z=>{E.current&&(z.stopPropagation(),E.current=!1)},P=z=>{var xe,Be;const{domNode:j}=p.getState();if(L.current=j==null?void 0:j.getBoundingClientRect(),!L.current)return;const X=z.target===S.current;if(!X&&!!z.target.closest(".nokey")||!n||!(o&&X||e)||z.button!==0||!z.isPrimary)return;(Be=(xe=z.target)==null?void 0:xe.setPointerCapture)==null||Be.call(xe,z.pointerId),E.current=!1;const{x:ce,y:Ce}=Wd(z.nativeEvent,L.current);p.setState({userSelectionRect:{width:0,height:0,startX:ce,startY:Ce,x:ce,y:Ce}}),X||(z.stopPropagation(),z.preventDefault())},B=z=>{const{userSelectionRect:j,transform:X,nodeLookup:Y,edgeLookup:te,connectionLookup:ce,triggerNodeChanges:Ce,triggerEdgeChanges:xe,defaultEdgeOptions:Be,resetSelectedElements:Ee}=p.getState();if(!L.current||!j)return;const{x:Le,y:ze}=Wd(z.nativeEvent,L.current),{startX:Ct,startY:ct}=j;if(!E.current){const Pt=e?0:s;if(Math.hypot(Le-Ct,ze-ct)<=Pt)return;Ee(),r==null||r(z)}E.current=!0;const Ue={startX:Ct,startY:ct,x:LePt.id)),I.current=new Set;const yi=(Be==null?void 0:Be.selectable)??!0;for(const Pt of x.current){const Cn=ce.get(Pt);if(Cn)for(const{edgeId:Xn}of Cn.values()){const Ks=te.get(Xn);Ks&&(Ks.selectable??yi)&&I.current.add(Xn)}}if(!Fee(tt,x.current)){const Pt=QC(Y,x.current,!0);Ce(Pt)}if(!Fee(_t,I.current)){const Pt=QC(te,I.current);xe(Pt)}p.setState({userSelectionRect:Ue,userSelectionActive:!0,nodesSelectionActive:!1})},V=z=>{var j,X;z.button===0&&((X=(j=z.target)==null?void 0:j.releasePointerCapture)==null||X.call(j,z.pointerId),!m&&z.target===S.current&&p.getState().userSelectionRect&&(R==null||R(z)),p.setState({userSelectionActive:!1,userSelectionRect:null}),E.current&&(a==null||a(z),p.setState({nodesSelectionActive:x.current.size>0})))},K=i===!0||Array.isArray(i)&&i.includes(0);return y.jsxs("div",{className:fo(["react-flow__pane",{draggable:K,dragging:v,selection:n}]),onClick:C?void 0:n7(R,S),onContextMenu:n7(M,S),onWheel:n7(A,S),onPointerEnter:C?void 0:h,onPointerMove:C?B:u,onPointerUp:C?V:void 0,onPointerDownCapture:C?P:void 0,onClickCapture:C?W:void 0,onPointerLeave:f,ref:S,style:k5,children:[g,y.jsx(oTe,{})]})}function UB({id:n,store:e,unselect:t=!1,nodeRef:i}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:r,nodeLookup:a,onError:l}=e.getState(),c=a.get(n);if(!c){l==null||l("012",bu.error012(n));return}e.setState({nodesSelectionActive:!1}),c.selected?(t||c.selected&&r)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var d;return(d=i==null?void 0:i.current)==null?void 0:d.blur()})):s([n])}function ufe({nodeRef:n,disabled:e=!1,noDragClassName:t,handleSelector:i,nodeId:s,isSelectable:o,nodeClickDistance:r}){const a=us(),[l,c]=$.useState(!1),d=$.useRef();return $.useEffect(()=>{d.current=ANe({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{UB({id:h,store:a,nodeRef:n})},onDragStart:()=>{c(!0)},onDragStop:()=>{c(!1)}})},[]),$.useEffect(()=>{if(!(e||!n.current||!d.current))return d.current.update({noDragClassName:t,handleSelector:i,domNode:n.current,isSelectable:o,nodeId:s,nodeClickDistance:r}),()=>{var h;(h=d.current)==null||h.destroy()}},[t,i,e,o,n,s,r]),l}const lTe=n=>e=>e.selected&&(e.draggable||n&&typeof e.draggable>"u");function ffe(){const n=us();return $.useCallback(t=>{const{nodeExtent:i,snapToGrid:s,snapGrid:o,nodesDraggable:r,onError:a,updateNodePositions:l,nodeLookup:c,nodeOrigin:d}=n.getState(),h=new Map,u=lTe(r),f=s?o[0]:5,g=s?o[1]:5,p=t.direction.x*f*t.factor,m=t.direction.y*g*t.factor;for(const[,b]of c){if(!u(b))continue;let v={x:b.internals.positionAbsolute.x+p,y:b.internals.positionAbsolute.y+m};s&&(v=JN(v,o));const{position:w,positionAbsolute:C}=Eue({nodeId:b.id,nextPosition:v,nodeLookup:c,nodeExtent:i,nodeOrigin:d,onError:a});b.position=w,b.internals.positionAbsolute=C,h.set(b.id,b)}l(h)},[])}const _G=$.createContext(null),cTe=_G.Provider;_G.Consumer;const gfe=()=>$.useContext(_G),dTe=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),hTe=(n,e,t)=>i=>{const{connectionClickStartHandle:s,connectionMode:o,connection:r}=i,{fromHandle:a,toHandle:l,isValid:c}=r,d=(l==null?void 0:l.nodeId)===n&&(l==null?void 0:l.id)===e&&(l==null?void 0:l.type)===t;return{connectingFrom:(a==null?void 0:a.nodeId)===n&&(a==null?void 0:a.id)===e&&(a==null?void 0:a.type)===t,connectingTo:d,clickConnecting:(s==null?void 0:s.nodeId)===n&&(s==null?void 0:s.id)===e&&(s==null?void 0:s.type)===t,isPossibleEndHandle:o===Yy.Strict?(a==null?void 0:a.type)!==t:n!==(a==null?void 0:a.nodeId)||e!==(a==null?void 0:a.id),connectionInProcess:!!a,clickConnectionInProcess:!!s,valid:d&&c}};function uTe({type:n="source",position:e=Nt.Top,isValidConnection:t,isConnectable:i=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:r,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:h,...u},f){var B,V;const g=r||null,p=n==="target",m=us(),b=gfe(),{connectOnClick:v,noPanClassName:w,rfId:C}=Ti(dTe,cs),{connectingFrom:S,connectingTo:L,clickConnecting:x,isPossibleEndHandle:I,connectionInProcess:E,clickConnectionInProcess:R,valid:M}=Ti(hTe(b,g,n),cs);b||(V=(B=m.getState()).onError)==null||V.call(B,"010",bu.error010());const A=K=>{const{defaultEdgeOptions:z,onConnect:j,hasDefaultEdges:X}=m.getState(),Y={...z,...K};if(X){const{edges:te,setEdges:ce}=m.getState();ce(bNe(Y,te))}j==null||j(Y),a==null||a(Y)},W=K=>{if(!b)return;const z=Oue(K.nativeEvent);if(s&&(z&&K.button===0||!z)){const j=m.getState();$B.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:p,handleId:g,nodeId:b,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...X)=>{var Y,te;return(te=(Y=m.getState()).onConnectEnd)==null?void 0:te.call(Y,...X)},updateConnection:j.updateConnection,onConnect:A,isValidConnection:t||((...X)=>{var Y,te;return((te=(Y=m.getState()).isValidConnection)==null?void 0:te.call(Y,...X))??!0}),getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}z?d==null||d(K):h==null||h(K)},P=K=>{const{onClickConnectStart:z,onClickConnectEnd:j,connectionClickStartHandle:X,connectionMode:Y,isValidConnection:te,lib:ce,rfId:Ce,nodeLookup:xe,connection:Be}=m.getState();if(!b||!X&&!s)return;if(!X){z==null||z(K.nativeEvent,{nodeId:b,handleId:g,handleType:n}),m.setState({connectionClickStartHandle:{nodeId:b,type:n,id:g}});return}const Ee=Aue(K.target),Le=t||te,{connection:ze,isValid:Ct}=$B.isValid(K.nativeEvent,{handle:{nodeId:b,id:g,type:n},connectionMode:Y,fromNodeId:X.nodeId,fromHandleId:X.id||null,fromType:X.type,isValidConnection:Le,flowId:Ce,doc:Ee,lib:ce,nodeLookup:xe});Ct&&ze&&A(ze);const ct=structuredClone(Be);delete ct.inProgress,ct.toPosition=ct.toHandle?ct.toHandle.position:null,j==null||j(K,ct),m.setState({connectionClickStartHandle:null})};return y.jsx("div",{"data-handleid":g,"data-nodeid":b,"data-handlepos":e,"data-id":`${C}-${b}-${g}-${n}`,className:fo(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",w,c,{source:!p,target:p,connectable:i,connectablestart:s,connectableend:o,clickconnecting:x,connectingfrom:S,connectingto:L,valid:M,connectionindicator:i&&(!E||I)&&(E||R?o:s)}]),onMouseDown:W,onTouchStart:W,onClick:v?P:void 0,ref:f,...u,children:l})}const tS=$.memo(dfe(uTe));function fTe({data:n,isConnectable:e,sourcePosition:t=Nt.Bottom}){return y.jsxs(y.Fragment,{children:[n==null?void 0:n.label,y.jsx(tS,{type:"source",position:t,isConnectable:e})]})}function gTe({data:n,isConnectable:e,targetPosition:t=Nt.Top,sourcePosition:i=Nt.Bottom}){return y.jsxs(y.Fragment,{children:[y.jsx(tS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label,y.jsx(tS,{type:"source",position:i,isConnectable:e})]})}function pTe(){return null}function mTe({data:n,isConnectable:e,targetPosition:t=Nt.Top}){return y.jsxs(y.Fragment,{children:[y.jsx(tS,{type:"target",position:t,isConnectable:e}),n==null?void 0:n.label]})}const UM={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},cte={input:fTe,default:gTe,output:mTe,group:pTe};function _Te(n){var e,t,i,s;return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??((e=n.style)==null?void 0:e.width),height:n.height??n.initialHeight??((t=n.style)==null?void 0:t.height)}:{width:n.width??((i=n.style)==null?void 0:i.width),height:n.height??((s=n.style)==null?void 0:s.height)}}const bTe=n=>{const{width:e,height:t,x:i,y:s}=QN(n.nodeLookup,{filter:o=>!!o.selected});return{width:Bd(e)?e:null,height:Bd(t)?t:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${i}px,${s}px)`}};function vTe({onSelectionContextMenu:n,noPanClassName:e,disableKeyboardA11y:t}){const i=us(),{width:s,height:o,transformString:r,userSelectionActive:a}=Ti(bTe,cs),l=ffe(),c=$.useRef(null);$.useEffect(()=>{var f;t||(f=c.current)==null||f.focus({preventScroll:!0})},[t]);const d=!a&&s!==null&&o!==null;if(ufe({nodeRef:c,disabled:!d}),!d)return null;const h=n?f=>{const g=i.getState().nodes.filter(p=>p.selected);n(f,g)}:void 0,u=f=>{Object.prototype.hasOwnProperty.call(UM,f.key)&&(f.preventDefault(),l({direction:UM[f.key],factor:f.shiftKey?4:1}))};return y.jsx("div",{className:fo(["react-flow__nodesselection","react-flow__container",e]),style:{transform:r},children:y.jsx("div",{ref:c,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:t?void 0:-1,onKeyDown:t?void 0:u,style:{width:s,height:o}})})}const dte=typeof window<"u"?window:void 0,wTe=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function pfe({children:n,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,paneClickDistance:a,deleteKeyCode:l,selectionKeyCode:c,selectionOnDrag:d,selectionMode:h,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:g,panActivationKeyCode:p,zoomActivationKeyCode:m,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:I,defaultViewport:E,translateExtent:R,minZoom:M,maxZoom:A,preventScrolling:W,onSelectionContextMenu:P,noWheelClassName:B,noPanClassName:V,disableKeyboardA11y:K,onViewportChange:z,isControlledViewport:j}){const{nodesSelectionActive:X,userSelectionActive:Y}=Ti(wTe,cs),te=GI(c,{target:dte}),ce=GI(p,{target:dte}),Ce=ce||I,xe=ce||C,Be=d&&Ce!==!0,Ee=te||Y||Be;return eTe({deleteKeyCode:l,multiSelectionKeyCode:g}),y.jsx(nTe,{onPaneContextMenu:o,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:w,panOnScroll:xe,panOnScrollSpeed:S,panOnScrollMode:L,zoomOnDoubleClick:x,panOnDrag:!te&&Ce,defaultViewport:E,translateExtent:R,minZoom:M,maxZoom:A,zoomActivationKeyCode:m,preventScrolling:W,noWheelClassName:B,noPanClassName:V,onViewportChange:z,isControlledViewport:j,paneClickDistance:a,selectionOnDrag:Be,children:y.jsxs(aTe,{onSelectionStart:u,onSelectionEnd:f,onPaneClick:e,onPaneMouseEnter:t,onPaneMouseMove:i,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:r,panOnDrag:Ce,isSelecting:!!Ee,selectionMode:h,selectionKeyPressed:te,paneClickDistance:a,selectionOnDrag:Be,children:[n,X&&y.jsx(vTe,{onSelectionContextMenu:P,noPanClassName:V,disableKeyboardA11y:K})]})})}pfe.displayName="FlowRenderer";const CTe=$.memo(pfe),yTe=n=>e=>n?lG(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(t=>t.id):Array.from(e.nodeLookup.keys());function STe(n){return Ti($.useCallback(yTe(n),[n]),cs)}const xTe=n=>n.updateNodeInternals;function LTe(){const n=Ti(xTe),[e]=$.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(t=>{const i=new Map;t.forEach(s=>{const o=s.target.getAttribute("data-id");i.set(o,{id:o,nodeElement:s.target,force:!0})}),n(i)}));return $.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function kTe({node:n,nodeType:e,hasDimensions:t,resizeObserver:i}){const s=us(),o=$.useRef(null),r=$.useRef(null),a=$.useRef(n.sourcePosition),l=$.useRef(n.targetPosition),c=$.useRef(e),d=t&&!!n.internals.handleBounds;return $.useEffect(()=>{o.current&&!n.hidden&&(!d||r.current!==o.current)&&(r.current&&(i==null||i.unobserve(r.current)),i==null||i.observe(o.current),r.current=o.current)},[d,n.hidden]),$.useEffect(()=>()=>{r.current&&(i==null||i.unobserve(r.current),r.current=null)},[]),$.useEffect(()=>{if(o.current){const h=c.current!==e,u=a.current!==n.sourcePosition,f=l.current!==n.targetPosition;(h||u||f)&&(c.current=e,a.current=n.sourcePosition,l.current=n.targetPosition,s.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:o.current,force:!0}]])))}},[n.id,e,n.sourcePosition,n.targetPosition]),o}function ITe({id:n,onClick:e,onMouseEnter:t,onMouseMove:i,onMouseLeave:s,onContextMenu:o,onDoubleClick:r,nodesDraggable:a,elementsSelectable:l,nodesConnectable:c,nodesFocusable:d,resizeObserver:h,noDragClassName:u,noPanClassName:f,disableKeyboardA11y:g,rfId:p,nodeTypes:m,nodeClickDistance:b,onError:v}){const{node:w,internals:C,isParent:S}=Ti(Le=>{const ze=Le.nodeLookup.get(n),Ct=Le.parentLookup.has(n);return{node:ze,internals:ze.internals,isParent:Ct}},cs);let L=w.type||"default",x=(m==null?void 0:m[L])||cte[L];x===void 0&&(v==null||v("003",bu.error003(L)),L="default",x=(m==null?void 0:m.default)||cte.default);const I=!!(w.draggable||a&&typeof w.draggable>"u"),E=!!(w.selectable||l&&typeof w.selectable>"u"),R=!!(w.connectable||c&&typeof w.connectable>"u"),M=!!(w.focusable||d&&typeof w.focusable>"u"),A=us(),W=Rue(w),P=kTe({node:w,nodeType:L,hasDimensions:W,resizeObserver:h}),B=ufe({nodeRef:P,disabled:w.hidden||!I,noDragClassName:u,handleSelector:w.dragHandle,nodeId:n,isSelectable:E,nodeClickDistance:b}),V=ffe();if(w.hidden)return null;const K=Wg(w),z=_Te(w),j=E||I||e||t||i||s,X=t?Le=>t(Le,{...C.userNode}):void 0,Y=i?Le=>i(Le,{...C.userNode}):void 0,te=s?Le=>s(Le,{...C.userNode}):void 0,ce=o?Le=>o(Le,{...C.userNode}):void 0,Ce=r?Le=>r(Le,{...C.userNode}):void 0,xe=Le=>{const{selectNodesOnDrag:ze,nodeDragThreshold:Ct}=A.getState();E&&(!ze||!I||Ct>0)&&UB({id:n,store:A,nodeRef:P}),e&&e(Le,{...C.userNode})},Be=Le=>{if(!(Pue(Le.nativeEvent)||g)){if(Sue.includes(Le.key)&&E){const ze=Le.key==="Escape";UB({id:n,store:A,unselect:ze,nodeRef:P})}else if(I&&w.selected&&Object.prototype.hasOwnProperty.call(UM,Le.key)){Le.preventDefault();const{ariaLabelConfig:ze}=A.getState();A.setState({ariaLiveMessage:ze["node.a11yDescription.ariaLiveMessage"]({direction:Le.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),V({direction:UM[Le.key],factor:Le.shiftKey?4:1})}}},Ee=()=>{var _t;if(g||!((_t=P.current)!=null&&_t.matches(":focus-visible")))return;const{transform:Le,width:ze,height:Ct,autoPanOnNodeFocus:ct,setCenter:Ue}=A.getState();if(!ct)return;lG(new Map([[n,w]]),{x:0,y:0,width:ze,height:Ct},Le,!0).length>0||Ue(w.position.x+K.width/2,w.position.y+K.height/2,{zoom:Le[2]})};return y.jsx("div",{className:fo(["react-flow__node",`react-flow__node-${L}`,{[f]:I},w.className,{selected:w.selected,selectable:E,parent:S,draggable:I,dragging:B}]),ref:P,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:j?"all":"none",visibility:W?"visible":"hidden",...w.style,...z},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:X,onMouseMove:Y,onMouseLeave:te,onContextMenu:ce,onClick:xe,onDoubleClick:Ce,onKeyDown:M?Be:void 0,tabIndex:M?0:void 0,onFocus:M?Ee:void 0,role:w.ariaRole??(M?"group":void 0),"aria-roledescription":"node","aria-describedby":g?void 0:`${sfe}-${p}`,"aria-label":w.ariaLabel,...w.domAttributes,children:y.jsx(cTe,{value:n,children:y.jsx(x,{id:n,data:w.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:E,draggable:I,deletable:w.deletable??!0,isConnectable:R,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:B,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...K})})})}var ETe=$.memo(ITe);const NTe=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function mfe(n){const{nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,onError:o}=Ti(NTe,cs),r=STe(n.onlyRenderVisibleElements),a=LTe();return y.jsx("div",{className:"react-flow__nodes",style:k5,children:r.map(l=>y.jsx(ETe,{id:l,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:a,nodesDraggable:e,nodesConnectable:t,nodesFocusable:i,elementsSelectable:s,nodeClickDistance:n.nodeClickDistance,onError:o},l))})}mfe.displayName="NodeRenderer";const DTe=$.memo(mfe);function TTe(n){return Ti($.useCallback(t=>{if(!n)return t.edges.map(s=>s.id);const i=[];if(t.width&&t.height)for(const s of t.edges){const o=t.nodeLookup.get(s.source),r=t.nodeLookup.get(s.target);o&&r&&pNe({sourceNode:o,targetNode:r,width:t.width,height:t.height,transform:t.transform})&&i.push(s.id)}return i},[n]),cs)}const RTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n}};return y.jsx("polyline",{className:"arrow",style:t,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},MTe=({color:n="none",strokeWidth:e=1})=>{const t={strokeWidth:e,...n&&{stroke:n,fill:n}};return y.jsx("polyline",{className:"arrowclosed",style:t,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},hte={[z1.Arrow]:RTe,[z1.ArrowClosed]:MTe};function ATe(n){const e=us();return $.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(hte,n)?hte[n]:((o=(s=e.getState()).onError)==null||o.call(s,"009",bu.error009(n)),null)},[n])}const PTe=({id:n,type:e,color:t,width:i=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:r,orient:a="auto-start-reverse"})=>{const l=ATe(e);return l?y.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${i}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:a,refX:"0",refY:"0",children:y.jsx(l,{color:t,strokeWidth:r})}):null},_fe=({defaultColor:n,rfId:e})=>{const t=Ti(o=>o.edges),i=Ti(o=>o.defaultEdgeOptions),s=$.useMemo(()=>SNe(t,{id:e,defaultColor:n,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[t,i,e,n]);return s.length?y.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:y.jsx("defs",{children:s.map(o=>y.jsx(PTe,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};_fe.displayName="MarkerDefinitions";var OTe=$.memo(_fe);function bfe({x:n,y:e,label:t,labelStyle:i,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:r=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d}){const[h,u]=$.useState({x:1,y:0,width:0,height:0}),f=fo(["react-flow__edge-textwrapper",c]),g=$.useRef(null);return $.useEffect(()=>{if(g.current){const p=g.current.getBBox();u({x:p.x,y:p.y,width:p.width,height:p.height})}},[t]),t?y.jsxs("g",{transform:`translate(${n-h.width/2} ${e-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...d,children:[s&&y.jsx("rect",{width:h.width+2*r[0],x:-r[0],y:-r[1],height:h.height+2*r[1],className:"react-flow__edge-textbg",style:o,rx:a,ry:a}),y.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:g,style:i,children:t}),l]}):null}bfe.displayName="EdgeText";const FTe=$.memo(bfe);function I5({path:n,labelX:e,labelY:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l,interactionWidth:c=20,...d}){return y.jsxs(y.Fragment,{children:[y.jsx("path",{...d,d:n,fill:"none",className:fo(["react-flow__edge-path",d.className])}),c?y.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,i&&Bd(e)&&Bd(t)?y.jsx(FTe,{x:e,y:t,label:i,labelStyle:s,labelShowBg:o,labelBgStyle:r,labelBgPadding:a,labelBgBorderRadius:l}):null]})}function ute({pos:n,x1:e,y1:t,x2:i,y2:s}){return n===Nt.Left||n===Nt.Right?[.5*(e+i),t]:[e,.5*(t+s)]}function vfe({sourceX:n,sourceY:e,sourcePosition:t=Nt.Bottom,targetX:i,targetY:s,targetPosition:o=Nt.Top}){const[r,a]=ute({pos:t,x1:n,y1:e,x2:i,y2:s}),[l,c]=ute({pos:o,x1:i,y1:s,x2:n,y2:e}),[d,h,u,f]=Fue({sourceX:n,sourceY:e,targetX:i,targetY:s,sourceControlX:r,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${n},${e} C${r},${a} ${l},${c} ${i},${s}`,d,h,u,f]}function wfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r,targetPosition:a,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})=>{const[v,w,C]=vfe({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a}),S=n.isInternal?void 0:e;return y.jsx(I5,{id:S,path:v,labelX:w,labelY:C,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:b})})}const BTe=wfe({isInternal:!1}),Cfe=wfe({isInternal:!0});BTe.displayName="SimpleBezierEdge";Cfe.displayName="SimpleBezierEdgeInternal";function yfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,sourcePosition:f=Nt.Bottom,targetPosition:g=Nt.Top,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=VB({sourceX:t,sourceY:i,sourcePosition:f,targetX:s,targetY:o,targetPosition:g,borderRadius:b==null?void 0:b.borderRadius,offset:b==null?void 0:b.offset,stepPosition:b==null?void 0:b.stepPosition}),L=n.isInternal?void 0:e;return y.jsx(I5,{id:L,path:w,labelX:C,labelY:S,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:p,markerStart:m,interactionWidth:v})})}const Sfe=yfe({isInternal:!1}),xfe=yfe({isInternal:!0});Sfe.displayName="SmoothStepEdge";xfe.displayName="SmoothStepEdgeInternal";function Lfe(n){return $.memo(({id:e,...t})=>{var s;const i=n.isInternal?void 0:e;return y.jsx(Sfe,{...t,id:i,pathOptions:$.useMemo(()=>{var o;return{borderRadius:0,offset:(o=t.pathOptions)==null?void 0:o.offset}},[(s=t.pathOptions)==null?void 0:s.offset])})})}const WTe=Lfe({isInternal:!1}),kfe=Lfe({isInternal:!0});WTe.displayName="StepEdge";kfe.displayName="StepEdgeInternal";function Ife(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})=>{const[m,b,v]=Hue({sourceX:t,sourceY:i,targetX:s,targetY:o}),w=n.isInternal?void 0:e;return y.jsx(I5,{id:w,path:m,labelX:b,labelY:v,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:h,style:u,markerEnd:f,markerStart:g,interactionWidth:p})})}const HTe=Ife({isInternal:!1}),Efe=Ife({isInternal:!0});HTe.displayName="StraightEdge";Efe.displayName="StraightEdgeInternal";function Nfe(n){return $.memo(({id:e,sourceX:t,sourceY:i,targetX:s,targetY:o,sourcePosition:r=Nt.Bottom,targetPosition:a=Nt.Top,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,pathOptions:b,interactionWidth:v})=>{const[w,C,S]=Bue({sourceX:t,sourceY:i,sourcePosition:r,targetX:s,targetY:o,targetPosition:a,curvature:b==null?void 0:b.curvature}),L=n.isInternal?void 0:e;return y.jsx(I5,{id:L,path:w,labelX:C,labelY:S,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:h,labelBgPadding:u,labelBgBorderRadius:f,style:g,markerEnd:p,markerStart:m,interactionWidth:v})})}const VTe=Nfe({isInternal:!1}),Dfe=Nfe({isInternal:!0});VTe.displayName="BezierEdge";Dfe.displayName="BezierEdgeInternal";const fte={default:Dfe,straight:Efe,step:kfe,smoothstep:xfe,simplebezier:Cfe},gte={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},zTe=(n,e,t)=>t===Nt.Left?n-e:t===Nt.Right?n+e:n,jTe=(n,e,t)=>t===Nt.Top?n-e:t===Nt.Bottom?n+e:n,pte="react-flow__edgeupdater";function mte({position:n,centerX:e,centerY:t,radius:i=10,onMouseDown:s,onMouseEnter:o,onMouseOut:r,type:a}){return y.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:r,className:fo([pte,`${pte}-${a}`]),cx:zTe(e,i,n),cy:jTe(t,i,n),r:i,stroke:"transparent",fill:"transparent"})}function $Te({isReconnectable:n,reconnectRadius:e,edge:t,sourceX:i,sourceY:s,targetX:o,targetY:r,sourcePosition:a,targetPosition:l,onReconnect:c,onReconnectStart:d,onReconnectEnd:h,setReconnecting:u,setUpdateHover:f}){const g=us(),p=(C,S)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:x,connectionMode:I,connectionRadius:E,lib:R,onConnectStart:M,cancelConnection:A,nodeLookup:W,rfId:P,panBy:B,updateConnection:V}=g.getState(),K=S.type==="target",z=(Y,te)=>{u(!1),h==null||h(Y,t,S.type,te)},j=Y=>c==null?void 0:c(t,Y),X=(Y,te)=>{u(!0),d==null||d(C,t,S.type),M==null||M(Y,te)};$B.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:I,connectionRadius:E,domNode:x,handleId:S.id,nodeId:S.nodeId,nodeLookup:W,isTarget:K,edgeUpdaterType:S.type,lib:R,flowId:P,cancelConnection:A,panBy:B,isValidConnection:(...Y)=>{var te,ce;return((ce=(te=g.getState()).isValidConnection)==null?void 0:ce.call(te,...Y))??!0},onConnect:j,onConnectStart:X,onConnectEnd:(...Y)=>{var te,ce;return(ce=(te=g.getState()).onConnectEnd)==null?void 0:ce.call(te,...Y)},onReconnectEnd:z,updateConnection:V,getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,dragThreshold:g.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},m=C=>p(C,{nodeId:t.target,id:t.targetHandle??null,type:"target"}),b=C=>p(C,{nodeId:t.source,id:t.sourceHandle??null,type:"source"}),v=()=>f(!0),w=()=>f(!1);return y.jsxs(y.Fragment,{children:[(n===!0||n==="source")&&y.jsx(mte,{position:a,centerX:i,centerY:s,radius:e,onMouseDown:m,onMouseEnter:v,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&y.jsx(mte,{position:l,centerX:o,centerY:r,radius:e,onMouseDown:b,onMouseEnter:v,onMouseOut:w,type:"target"})]})}function UTe({id:n,edgesFocusable:e,edgesReconnectable:t,elementsSelectable:i,onClick:s,onDoubleClick:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,rfId:g,edgeTypes:p,noPanClassName:m,onError:b,disableKeyboardA11y:v}){let w=Ti(Ue=>Ue.edgeLookup.get(n));const C=Ti(Ue=>Ue.defaultEdgeOptions);w=C?{...C,...w}:w;let S=w.type||"default",L=(p==null?void 0:p[S])||fte[S];L===void 0&&(b==null||b("011",bu.error011(S)),S="default",L=(p==null?void 0:p.default)||fte.default);const x=!!(w.focusable||e&&typeof w.focusable>"u"),I=typeof h<"u"&&(w.reconnectable||t&&typeof w.reconnectable>"u"),E=!!(w.selectable||i&&typeof w.selectable>"u"),R=$.useRef(null),[M,A]=$.useState(!1),[W,P]=$.useState(!1),B=us(),{zIndex:V,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te}=Ti($.useCallback(Ue=>{const tt=Ue.nodeLookup.get(w.source),_t=Ue.nodeLookup.get(w.target);if(!tt||!_t)return{zIndex:w.zIndex,...gte};const yi=yNe({id:n,sourceNode:tt,targetNode:_t,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:Ue.connectionMode,onError:b});return{zIndex:gNe({selected:w.selected,zIndex:w.zIndex,sourceNode:tt,targetNode:_t,elevateOnSelect:Ue.elevateEdgesOnSelect,zIndexMode:Ue.zIndexMode}),...yi||gte}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),cs),ce=$.useMemo(()=>w.markerStart?`url('#${zB(w.markerStart,g)}')`:void 0,[w.markerStart,g]),Ce=$.useMemo(()=>w.markerEnd?`url('#${zB(w.markerEnd,g)}')`:void 0,[w.markerEnd,g]);if(w.hidden||K===null||z===null||j===null||X===null)return null;const xe=Ue=>{var Pt;const{addSelectedEdges:tt,unselectNodesAndEdges:_t,multiSelectionActive:yi}=B.getState();E&&(B.setState({nodesSelectionActive:!1}),w.selected&&yi?(_t({nodes:[],edges:[w]}),(Pt=R.current)==null||Pt.blur()):tt([n])),s&&s(Ue,w)},Be=o?Ue=>{o(Ue,{...w})}:void 0,Ee=r?Ue=>{r(Ue,{...w})}:void 0,Le=a?Ue=>{a(Ue,{...w})}:void 0,ze=l?Ue=>{l(Ue,{...w})}:void 0,Ct=c?Ue=>{c(Ue,{...w})}:void 0,ct=Ue=>{var tt;if(!v&&Sue.includes(Ue.key)&&E){const{unselectNodesAndEdges:_t,addSelectedEdges:yi}=B.getState();Ue.key==="Escape"?((tt=R.current)==null||tt.blur(),_t({edges:[w]})):yi([n])}};return y.jsx("svg",{style:{zIndex:V},children:y.jsxs("g",{className:fo(["react-flow__edge",`react-flow__edge-${S}`,w.className,m,{selected:w.selected,animated:w.animated,inactive:!E&&!s,updating:M,selectable:E}]),onClick:xe,onDoubleClick:Be,onContextMenu:Ee,onMouseEnter:Le,onMouseMove:ze,onMouseLeave:Ct,onKeyDown:x?ct:void 0,tabIndex:x?0:void 0,role:w.ariaRole??(x?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":x?`${ofe}-${g}`:void 0,ref:R,...w.domAttributes,children:[!W&&y.jsx(L,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:E,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:ce,markerEnd:Ce,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),I&&y.jsx($Te,{edge:w,isReconnectable:I,reconnectRadius:d,onReconnect:h,onReconnectStart:u,onReconnectEnd:f,sourceX:K,sourceY:z,targetX:j,targetY:X,sourcePosition:Y,targetPosition:te,setUpdateHover:A,setReconnecting:P})]})})}var qTe=$.memo(UTe);const KTe=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Tfe({defaultMarkerColor:n,onlyRenderVisibleElements:e,rfId:t,edgeTypes:i,noPanClassName:s,onReconnect:o,onEdgeContextMenu:r,onEdgeMouseEnter:a,onEdgeMouseMove:l,onEdgeMouseLeave:c,onEdgeClick:d,reconnectRadius:h,onEdgeDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,disableKeyboardA11y:p}){const{edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,onError:w}=Ti(KTe,cs),C=TTe(e);return y.jsxs("div",{className:"react-flow__edges",children:[y.jsx(OTe,{defaultColor:n,rfId:t}),C.map(S=>y.jsx(qTe,{id:S,edgesFocusable:m,edgesReconnectable:b,elementsSelectable:v,noPanClassName:s,onReconnect:o,onContextMenu:r,onMouseEnter:a,onMouseMove:l,onMouseLeave:c,onClick:d,reconnectRadius:h,onDoubleClick:u,onReconnectStart:f,onReconnectEnd:g,rfId:t,onError:w,edgeTypes:i,disableKeyboardA11y:p},S))]})}Tfe.displayName="EdgeRenderer";const GTe=$.memo(Tfe),YTe=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function ZTe({children:n}){const e=Ti(YTe);return y.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:n})}function XTe(n){const e=mG(),t=$.useRef(!1);$.useEffect(()=>{!t.current&&e.viewportInitialized&&n&&(setTimeout(()=>n(e),1),t.current=!0)},[n,e.viewportInitialized])}const QTe=n=>{var e;return(e=n.panZoom)==null?void 0:e.syncViewport};function JTe(n){const e=Ti(QTe),t=us();return $.useEffect(()=>{n&&(e==null||e(n),t.setState({transform:[n.x,n.y,n.zoom]}))},[n,e]),null}function e2e(n){return n.connection.inProgress?{...n.connection,to:eD(n.connection.to,n.transform)}:{...n.connection}}function t2e(n){return e2e}function i2e(n){const e=t2e();return Ti(e,cs)}const n2e=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function s2e({containerStyle:n,style:e,type:t,component:i}){const{nodesConnectable:s,width:o,height:r,isValid:a,inProgress:l}=Ti(n2e,cs);return!(o&&s&&l)?null:y.jsx("svg",{style:n,width:o,height:r,className:"react-flow__connectionline react-flow__container",children:y.jsx("g",{className:fo(["react-flow__connection",kue(a)]),children:y.jsx(Rfe,{style:e,type:t,CustomComponent:i,isValid:a})})})}const Rfe=({style:n,type:e=Df.Bezier,CustomComponent:t,isValid:i})=>{const{inProgress:s,from:o,fromNode:r,fromHandle:a,fromPosition:l,to:c,toNode:d,toHandle:h,toPosition:u,pointer:f}=i2e();if(!s)return;if(t)return y.jsx(t,{connectionLineType:e,connectionLineStyle:n,fromNode:r,fromHandle:a,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:u,connectionStatus:kue(i),toNode:d,toHandle:h,pointer:f});let g="";const p={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:u};switch(e){case Df.Bezier:[g]=Bue(p);break;case Df.SimpleBezier:[g]=vfe(p);break;case Df.Step:[g]=VB({...p,borderRadius:0});break;case Df.SmoothStep:[g]=VB(p);break;default:[g]=Hue(p)}return y.jsx("path",{d:g,fill:"none",className:"react-flow__connection-path",style:n})};Rfe.displayName="ConnectionLine";const o2e={};function _te(n=o2e){$.useRef(n),us(),$.useEffect(()=>{},[n])}function r2e(){us(),$.useRef(!1),$.useEffect(()=>{},[])}function Mfe({nodeTypes:n,edgeTypes:e,onInit:t,onNodeClick:i,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:r,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,onSelectionContextMenu:h,onSelectionStart:u,onSelectionEnd:f,connectionLineType:g,connectionLineStyle:p,connectionLineComponent:m,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,deleteKeyCode:I,onlyRenderVisibleElements:E,elementsSelectable:R,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,preventScrolling:B,defaultMarkerColor:V,zoomOnScroll:K,zoomOnPinch:z,panOnScroll:j,panOnScrollSpeed:X,panOnScrollMode:Y,zoomOnDoubleClick:te,panOnDrag:ce,onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Be,onPaneMouseLeave:Ee,onPaneScroll:Le,onPaneContextMenu:ze,paneClickDistance:Ct,nodeClickDistance:ct,onEdgeContextMenu:Ue,onEdgeMouseEnter:tt,onEdgeMouseMove:_t,onEdgeMouseLeave:yi,reconnectRadius:Pt,onReconnect:Cn,onReconnectStart:Xn,onReconnectEnd:Ks,noDragClassName:kr,noWheelClassName:Ir,noPanClassName:fc,disableKeyboardA11y:Er,nodeExtent:Ta,rfId:po,viewport:gn,onViewportChange:yn}){return _te(n),_te(e),r2e(),XTe(t),JTe(gn),y.jsx(CTe,{onPaneClick:Ce,onPaneMouseEnter:xe,onPaneMouseMove:Be,onPaneMouseLeave:Ee,onPaneContextMenu:ze,onPaneScroll:Le,paneClickDistance:Ct,deleteKeyCode:I,selectionKeyCode:v,selectionOnDrag:w,selectionMode:C,onSelectionStart:u,onSelectionEnd:f,multiSelectionKeyCode:S,panActivationKeyCode:L,zoomActivationKeyCode:x,elementsSelectable:R,zoomOnScroll:K,zoomOnPinch:z,zoomOnDoubleClick:te,panOnScroll:j,panOnScrollSpeed:X,panOnScrollMode:Y,panOnDrag:ce,defaultViewport:M,translateExtent:A,minZoom:W,maxZoom:P,onSelectionContextMenu:h,preventScrolling:B,noDragClassName:kr,noWheelClassName:Ir,noPanClassName:fc,disableKeyboardA11y:Er,onViewportChange:yn,isControlledViewport:!!gn,children:y.jsxs(ZTe,{children:[y.jsx(GTe,{edgeTypes:e,onEdgeClick:s,onEdgeDoubleClick:r,onReconnect:Cn,onReconnectStart:Xn,onReconnectEnd:Ks,onlyRenderVisibleElements:E,onEdgeContextMenu:Ue,onEdgeMouseEnter:tt,onEdgeMouseMove:_t,onEdgeMouseLeave:yi,reconnectRadius:Pt,defaultMarkerColor:V,noPanClassName:fc,disableKeyboardA11y:Er,rfId:po}),y.jsx(s2e,{style:p,type:g,component:m,containerStyle:b}),y.jsx("div",{className:"react-flow__edgelabel-renderer"}),y.jsx(DTe,{nodeTypes:n,onNodeClick:i,onNodeDoubleClick:o,onNodeMouseEnter:a,onNodeMouseMove:l,onNodeMouseLeave:c,onNodeContextMenu:d,nodeClickDistance:ct,onlyRenderVisibleElements:E,noPanClassName:fc,noDragClassName:kr,disableKeyboardA11y:Er,nodeExtent:Ta,rfId:po}),y.jsx("div",{className:"react-flow__viewport-portal"})]})})}Mfe.displayName="GraphView";const a2e=$.memo(Mfe),bte=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l=.5,maxZoom:c=2,nodeOrigin:d,nodeExtent:h,zIndexMode:u="basic"}={})=>{const f=new Map,g=new Map,p=new Map,m=new Map,b=i??e??[],v=t??n??[],w=d??[0,0],C=h??$I;jue(p,m,b);const S=jB(v,f,g,{nodeOrigin:w,nodeExtent:C,zIndexMode:u});let L=[0,0,1];if(r&&s&&o){const x=QN(f,{filter:M=>!!((M.width||M.initialWidth)&&(M.height||M.initialHeight))}),{x:I,y:E,zoom:R}=cG(x,s,o,l,c,(a==null?void 0:a.padding)??.1);L=[I,E,R]}return{rfId:"1",width:s??0,height:o??0,transform:L,nodes:v,nodesInitialized:S,nodeLookup:f,parentLookup:g,edges:b,edgeLookup:m,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:t!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:l,maxZoom:c,translateExtent:$I,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Yy.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:r??!1,fitViewOptions:a,fitViewResolver:null,connection:{...Lue},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lNe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:xue,zIndexMode:u,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},l2e=({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u})=>kDe((f,g)=>{async function p(){const{nodeLookup:m,panZoom:b,fitViewOptions:v,fitViewResolver:w,width:C,height:S,minZoom:L,maxZoom:x}=g();b&&(await rNe({nodes:m,width:C,height:S,panZoom:b,minZoom:L,maxZoom:x},v),w==null||w.resolve(!0),f({fitViewResolver:null}))}return{...bte({nodes:n,edges:e,width:s,height:o,fitView:r,fitViewOptions:a,minZoom:l,maxZoom:c,nodeOrigin:d,nodeExtent:h,defaultNodes:t,defaultEdges:i,zIndexMode:u}),setNodes:m=>{const{nodeLookup:b,parentLookup:v,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:S,zIndexMode:L}=g(),x=jB(m,b,v,{nodeOrigin:w,nodeExtent:h,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:L});S&&x?(p(),f({nodes:m,nodesInitialized:x,fitViewQueued:!1,fitViewOptions:void 0})):f({nodes:m,nodesInitialized:x})},setEdges:m=>{const{connectionLookup:b,edgeLookup:v}=g();jue(b,v,m),f({edges:m})},setDefaultNodesAndEdges:(m,b)=>{if(m){const{setNodes:v}=g();v(m),f({hasDefaultNodes:!0})}if(b){const{setEdges:v}=g();v(b),f({hasDefaultEdges:!0})}},updateNodeInternals:m=>{const{triggerNodeChanges:b,nodeLookup:v,parentLookup:w,domNode:C,nodeOrigin:S,nodeExtent:L,debug:x,fitViewQueued:I,zIndexMode:E}=g(),{changes:R,updatedInternals:M}=DNe(m,v,w,C,S,L,E);M&&(kNe(v,w,{nodeOrigin:S,nodeExtent:L,zIndexMode:E}),I?(p(),f({fitViewQueued:!1,fitViewOptions:void 0})):f({}),(R==null?void 0:R.length)>0&&(x&&console.log("React Flow: trigger node changes",R),b==null||b(R)))},updateNodePositions:(m,b=!1)=>{const v=[];let w=[];const{nodeLookup:C,triggerNodeChanges:S,connection:L,updateConnection:x,onNodesChangeMiddlewareMap:I}=g();for(const[E,R]of m){const M=C.get(E),A=!!(M!=null&&M.expandParent&&(M!=null&&M.parentId)&&(R!=null&&R.position)),W={id:E,type:"position",position:A?{x:Math.max(0,R.position.x),y:Math.max(0,R.position.y)}:R.position,dragging:b};if(M&&L.inProgress&&L.fromNode.id===M.id){const P=$1(M,L.fromHandle,Nt.Left,!0);x({...L,from:P})}A&&M.parentId&&v.push({id:E,parentId:M.parentId,rect:{...R.internals.positionAbsolute,width:R.measured.width??0,height:R.measured.height??0}}),w.push(W)}if(v.length>0){const{parentLookup:E,nodeOrigin:R}=g(),M=pG(v,C,E,R);w.push(...M)}for(const E of I.values())w=E(w);S(w)},triggerNodeChanges:m=>{const{onNodesChange:b,setNodes:v,nodes:w,hasDefaultNodes:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=lfe(m,w);v(L)}S&&console.log("React Flow: trigger node changes",m),b==null||b(m)}},triggerEdgeChanges:m=>{const{onEdgesChange:b,setEdges:v,edges:w,hasDefaultEdges:C,debug:S}=g();if(m!=null&&m.length){if(C){const L=cfe(m,w);v(L)}S&&console.log("React Flow: trigger edge changes",m),b==null||b(m)}},addSelectedNodes:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>ab(x,!0));C(L);return}C(QC(w,new Set([...m]),!0)),S(QC(v))},addSelectedEdges:m=>{const{multiSelectionActive:b,edgeLookup:v,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:S}=g();if(b){const L=m.map(x=>ab(x,!0));S(L);return}S(QC(v,new Set([...m]))),C(QC(w,new Set,!0))},unselectNodesAndEdges:({nodes:m,edges:b}={})=>{const{edges:v,nodes:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:L}=g(),x=m||w,I=b||v,E=[];for(const M of x){if(!M.selected)continue;const A=C.get(M.id);A&&(A.selected=!1),E.push(ab(M.id,!1))}const R=[];for(const M of I)M.selected&&R.push(ab(M.id,!1));S(E),L(R)},setMinZoom:m=>{const{panZoom:b,maxZoom:v}=g();b==null||b.setScaleExtent([m,v]),f({minZoom:m})},setMaxZoom:m=>{const{panZoom:b,minZoom:v}=g();b==null||b.setScaleExtent([v,m]),f({maxZoom:m})},setTranslateExtent:m=>{var b;(b=g().panZoom)==null||b.setTranslateExtent(m),f({translateExtent:m})},resetSelectedElements:()=>{const{edges:m,nodes:b,triggerNodeChanges:v,triggerEdgeChanges:w,elementsSelectable:C}=g();if(!C)return;const S=b.reduce((x,I)=>I.selected?[...x,ab(I.id,!1)]:x,[]),L=m.reduce((x,I)=>I.selected?[...x,ab(I.id,!1)]:x,[]);v(S),w(L)},setNodeExtent:m=>{const{nodes:b,nodeLookup:v,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:S,nodeExtent:L,zIndexMode:x}=g();m[0][0]===L[0][0]&&m[0][1]===L[0][1]&&m[1][0]===L[1][0]&&m[1][1]===L[1][1]||(jB(b,v,w,{nodeOrigin:C,nodeExtent:m,elevateNodesOnSelect:S,checkEquality:!1,zIndexMode:x}),f({nodeExtent:m}))},panBy:m=>{const{transform:b,width:v,height:w,panZoom:C,translateExtent:S}=g();return TNe({delta:m,panZoom:C,transform:b,translateExtent:S,width:v,height:w})},setCenter:async(m,b,v)=>{const{width:w,height:C,maxZoom:S,panZoom:L}=g();if(!L)return Promise.resolve(!1);const x=typeof(v==null?void 0:v.zoom)<"u"?v.zoom:S;return await L.setViewport({x:w/2-m*x,y:C/2-b*x,zoom:x},{duration:v==null?void 0:v.duration,ease:v==null?void 0:v.ease,interpolate:v==null?void 0:v.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{f({connection:{...Lue}})},updateConnection:m=>{f({connection:m})},reset:()=>f({...bte()})}},Object.is);function c2e({initialNodes:n,initialEdges:e,defaultNodes:t,defaultEdges:i,initialWidth:s,initialHeight:o,initialMinZoom:r,initialMaxZoom:a,initialFitViewOptions:l,fitView:c,nodeOrigin:d,nodeExtent:h,zIndexMode:u,children:f}){const[g]=$.useState(()=>l2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,width:s,height:o,fitView:c,minZoom:r,maxZoom:a,fitViewOptions:l,nodeOrigin:d,nodeExtent:h,zIndexMode:u}));return y.jsx(IDe,{value:g,children:y.jsx(ZDe,{children:f})})}function d2e({children:n,nodes:e,edges:t,defaultNodes:i,defaultEdges:s,width:o,height:r,fitView:a,fitViewOptions:l,minZoom:c,maxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f}){return $.useContext(x5)?y.jsx(y.Fragment,{children:n}):y.jsx(c2e,{initialNodes:e,initialEdges:t,defaultNodes:i,defaultEdges:s,initialWidth:o,initialHeight:r,fitView:a,initialFitViewOptions:l,initialMinZoom:c,initialMaxZoom:d,nodeOrigin:h,nodeExtent:u,zIndexMode:f,children:n})}const h2e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function u2e({nodes:n,edges:e,defaultNodes:t,defaultEdges:i,className:s,nodeTypes:o,edgeTypes:r,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:h,onMoveEnd:u,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,onNodeDragStart:x,onNodeDrag:I,onNodeDragStop:E,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onSelectionChange:W,onSelectionDragStart:P,onSelectionDrag:B,onSelectionDragStop:V,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onBeforeDelete:X,connectionMode:Y,connectionLineType:te=Df.Bezier,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,deleteKeyCode:Be="Backspace",selectionKeyCode:Ee="Shift",selectionOnDrag:Le=!1,selectionMode:ze=UI.Full,panActivationKeyCode:Ct="Space",multiSelectionKeyCode:ct=KI()?"Meta":"Control",zoomActivationKeyCode:Ue=KI()?"Meta":"Control",snapToGrid:tt,snapGrid:_t,onlyRenderVisibleElements:yi=!1,selectNodesOnDrag:Pt,nodesDraggable:Cn,autoPanOnNodeFocus:Xn,nodesConnectable:Ks,nodesFocusable:kr,nodeOrigin:Ir=rfe,edgesFocusable:fc,edgesReconnectable:Er,elementsSelectable:Ta=!0,defaultViewport:po=HDe,minZoom:gn=.5,maxZoom:yn=2,translateExtent:tn=$I,preventScrolling:Ra=!0,nodeExtent:gc,defaultMarkerColor:_l="#b1b1b7",zoomOnScroll:id=!0,zoomOnPinch:Os=!0,panOnScroll:Jr=!1,panOnScrollSpeed:er=.5,panOnScrollMode:pc=Cv.Free,zoomOnDoubleClick:Mi=!0,panOnDrag:Dn=!0,onPaneClick:ks,onPaneMouseEnter:Nr,onPaneMouseMove:nd,onPaneMouseLeave:Dr,onPaneScroll:fs,onPaneContextMenu:Bn,paneClickDistance:Sn=1,nodeClickDistance:mc=0,children:Q,onReconnect:hh,onReconnectStart:uh,onReconnectEnd:Ki,onEdgeContextMenu:tr,onEdgeDoubleClick:it,onEdgeMouseEnter:ir,onEdgeMouseMove:zt,onEdgeMouseLeave:li,reconnectRadius:Ro=10,onNodesChange:Qn,onEdgesChange:Mo,noDragClassName:Jn="nodrag",noWheelClassName:Yg="nowheel",noPanClassName:_c="nopan",fitView:sd,fitViewOptions:fh,connectOnClick:Hu,attributionPosition:Qe,proOptions:re,defaultEdgeOptions:ke,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:Et=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:ci,autoPanOnNodeDrag:Un,autoPanSpeed:Gs,connectionRadius:Ao,isValidConnection:Vu,onError:es,style:od,id:gh,nodeDragThreshold:Yw,connectionDragThreshold:_x,viewport:bx,onViewportChange:bl,width:I_,height:Zg,colorMode:ph="light",debug:E_,onScroll:Xg,ariaLabelConfig:Zw,zIndexMode:Xw="basic",...Qw},N_){const mh=gh||"1",vx=$De(ph),D_=$.useCallback(Jw=>{Jw.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Xg==null||Xg(Jw)},[Xg]);return y.jsx("div",{"data-testid":"rf__wrapper",...Qw,onScroll:D_,style:{...od,...h2e},ref:N_,className:fo(["react-flow",s,vx]),id:gh,role:"application",children:y.jsxs(d2e,{nodes:n,edges:e,width:I_,height:Zg,fitView:sd,fitViewOptions:fh,minZoom:gn,maxZoom:yn,nodeOrigin:Ir,nodeExtent:gc,zIndexMode:Xw,children:[y.jsx(a2e,{onInit:c,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:v,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:S,onNodeDoubleClick:L,nodeTypes:o,edgeTypes:r,connectionLineType:te,connectionLineStyle:ce,connectionLineComponent:Ce,connectionLineContainerStyle:xe,selectionKeyCode:Ee,selectionOnDrag:Le,selectionMode:ze,deleteKeyCode:Be,multiSelectionKeyCode:ct,panActivationKeyCode:Ct,zoomActivationKeyCode:Ue,onlyRenderVisibleElements:yi,defaultViewport:po,translateExtent:tn,minZoom:gn,maxZoom:yn,preventScrolling:Ra,zoomOnScroll:id,zoomOnPinch:Os,zoomOnDoubleClick:Mi,panOnScroll:Jr,panOnScrollSpeed:er,panOnScrollMode:pc,panOnDrag:Dn,onPaneClick:ks,onPaneMouseEnter:Nr,onPaneMouseMove:nd,onPaneMouseLeave:Dr,onPaneScroll:fs,onPaneContextMenu:Bn,paneClickDistance:Sn,nodeClickDistance:mc,onSelectionContextMenu:K,onSelectionStart:z,onSelectionEnd:j,onReconnect:hh,onReconnectStart:uh,onReconnectEnd:Ki,onEdgeContextMenu:tr,onEdgeDoubleClick:it,onEdgeMouseEnter:ir,onEdgeMouseMove:zt,onEdgeMouseLeave:li,reconnectRadius:Ro,defaultMarkerColor:_l,noDragClassName:Jn,noWheelClassName:Yg,noPanClassName:_c,rfId:mh,disableKeyboardA11y:$n,nodeExtent:gc,viewport:bx,onViewportChange:bl}),y.jsx(jDe,{nodes:n,edges:e,defaultNodes:t,defaultEdges:i,onConnect:f,onConnectStart:g,onConnectEnd:p,onClickConnectStart:m,onClickConnectEnd:b,nodesDraggable:Cn,autoPanOnNodeFocus:Xn,nodesConnectable:Ks,nodesFocusable:kr,edgesFocusable:fc,edgesReconnectable:Er,elementsSelectable:Ta,elevateNodesOnSelect:dt,elevateEdgesOnSelect:Et,minZoom:gn,maxZoom:yn,nodeExtent:gc,onNodesChange:Qn,onEdgesChange:Mo,snapToGrid:tt,snapGrid:_t,connectionMode:Y,translateExtent:tn,connectOnClick:Hu,defaultEdgeOptions:ke,fitView:sd,fitViewOptions:fh,onNodesDelete:R,onEdgesDelete:M,onDelete:A,onNodeDragStart:x,onNodeDrag:I,onNodeDragStop:E,onSelectionDrag:B,onSelectionDragStart:P,onSelectionDragStop:V,onMove:d,onMoveStart:h,onMoveEnd:u,noPanClassName:_c,nodeOrigin:Ir,rfId:mh,autoPanOnConnect:ci,autoPanOnNodeDrag:Un,autoPanSpeed:Gs,onError:es,connectionRadius:Ao,isValidConnection:Vu,selectNodesOnDrag:Pt,nodeDragThreshold:Yw,connectionDragThreshold:_x,onBeforeDelete:X,debug:E_,ariaLabelConfig:Zw,zIndexMode:Xw}),y.jsx(WDe,{onSelectionChange:W}),Q,y.jsx(ADe,{proOptions:re,position:Qe}),y.jsx(MDe,{rfId:mh,disableKeyboardA11y:$n})]})})}var f2e=dfe(u2e);function g2e({dimensions:n,lineWidth:e,variant:t,className:i}){return y.jsx("path",{strokeWidth:e,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:fo(["react-flow__background-pattern",t,i])})}function p2e({radius:n,className:e}){return y.jsx("circle",{cx:n,cy:n,r:n,className:fo(["react-flow__background-pattern","dots",e])})}var ig;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ig||(ig={}));const m2e={[ig.Dots]:1,[ig.Lines]:1,[ig.Cross]:6},_2e=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Afe({id:n,variant:e=ig.Dots,gap:t=20,size:i,lineWidth:s=1,offset:o=0,color:r,bgColor:a,style:l,className:c,patternClassName:d}){const h=$.useRef(null),{transform:u,patternId:f}=Ti(_2e,cs),g=i||m2e[e],p=e===ig.Dots,m=e===ig.Cross,b=Array.isArray(t)?t:[t,t],v=[b[0]*u[2]||1,b[1]*u[2]||1],w=g*u[2],C=Array.isArray(o)?o:[o,o],S=m?[w,w]:v,L=[C[0]*u[2]||1+S[0]/2,C[1]*u[2]||1+S[1]/2],x=`${f}${n||""}`;return y.jsxs("svg",{className:fo(["react-flow__background",c]),style:{...l,...k5,"--xy-background-color-props":a,"--xy-background-pattern-color-props":r},ref:h,"data-testid":"rf__background",children:[y.jsx("pattern",{id:x,x:u[0]%v[0],y:u[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:p?y.jsx(p2e,{radius:w/2,className:d}):y.jsx(g2e,{dimensions:S,lineWidth:s,variant:e,className:d})}),y.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${x})`})]})}Afe.displayName="Background";const b2e=$.memo(Afe);function v2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:y.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function w2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:y.jsx("path",{d:"M0 0h32v4.2H0z"})})}function C2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:y.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function y2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function S2e(){return y.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:y.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function kT({children:n,className:e,...t}){return y.jsx("button",{type:"button",className:fo(["react-flow__controls-button",e]),...t,children:n})}const x2e=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Pfe({style:n,showZoom:e=!0,showFitView:t=!0,showInteractive:i=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:r,onFitView:a,onInteractiveChange:l,className:c,children:d,position:h="bottom-left",orientation:u="vertical","aria-label":f}){const g=us(),{isInteractive:p,minZoomReached:m,maxZoomReached:b,ariaLabelConfig:v}=Ti(x2e,cs),{zoomIn:w,zoomOut:C,fitView:S}=mG(),L=()=>{w(),o==null||o()},x=()=>{C(),r==null||r()},I=()=>{S(s),a==null||a()},E=()=>{g.setState({nodesDraggable:!p,nodesConnectable:!p,elementsSelectable:!p}),l==null||l(!p)},R=u==="horizontal"?"horizontal":"vertical";return y.jsxs(L5,{className:fo(["react-flow__controls",R,c]),position:h,style:n,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[e&&y.jsxs(y.Fragment,{children:[y.jsx(kT,{onClick:L,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:y.jsx(v2e,{})}),y.jsx(kT,{onClick:x,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:m,children:y.jsx(w2e,{})})]}),t&&y.jsx(kT,{className:"react-flow__controls-fitview",onClick:I,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:y.jsx(C2e,{})}),i&&y.jsx(kT,{className:"react-flow__controls-interactive",onClick:E,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:p?y.jsx(S2e,{}):y.jsx(y2e,{})}),d]})}Pfe.displayName="Controls";const L2e=$.memo(Pfe);function k2e({id:n,x:e,y:t,width:i,height:s,style:o,color:r,strokeColor:a,strokeWidth:l,className:c,borderRadius:d,shapeRendering:h,selected:u,onClick:f}){const{background:g,backgroundColor:p}=o||{},m=r||g||p;return y.jsx("rect",{className:fo(["react-flow__minimap-node",{selected:u},c]),x:e,y:t,rx:d,ry:d,width:i,height:s,style:{fill:m,stroke:a,strokeWidth:l},shapeRendering:h,onClick:f?b=>f(b,n):void 0})}const I2e=$.memo(k2e),E2e=n=>n.nodes.map(e=>e.id),s7=n=>n instanceof Function?n:()=>n;function N2e({nodeStrokeColor:n,nodeColor:e,nodeClassName:t="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:o=I2e,onClick:r}){const a=Ti(E2e,cs),l=s7(e),c=s7(n),d=s7(t),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return y.jsx(y.Fragment,{children:a.map(u=>y.jsx(T2e,{id:u,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:d,nodeBorderRadius:i,nodeStrokeWidth:s,NodeComponent:o,onClick:r,shapeRendering:h},u))})}function D2e({id:n,nodeColorFunc:e,nodeStrokeColorFunc:t,nodeClassNameFunc:i,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:r,NodeComponent:a,onClick:l}){const{node:c,x:d,y:h,width:u,height:f}=Ti(g=>{const p=g.nodeLookup.get(n);if(!p)return{node:void 0,x:0,y:0,width:0,height:0};const m=p.internals.userNode,{x:b,y:v}=p.internals.positionAbsolute,{width:w,height:C}=Wg(m);return{node:m,x:b,y:v,width:w,height:C}},cs);return!c||c.hidden||!Rue(c)?null:y.jsx(a,{x:d,y:h,width:u,height:f,style:c.style,selected:!!c.selected,className:i(c),color:e(c),borderRadius:s,strokeColor:t(c),strokeWidth:o,shapeRendering:r,onClick:l,id:c.id})}const T2e=$.memo(D2e);var R2e=$.memo(N2e);const M2e=200,A2e=150,P2e=n=>!n.hidden,O2e=n=>{const e={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:e,boundingRect:n.nodeLookup.size>0?Tue(QN(n.nodeLookup,{filter:P2e}),e):e,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},F2e="react-flow__minimap-desc";function Ofe({style:n,className:e,nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:a,bgColor:l,maskColor:c,maskStrokeColor:d,maskStrokeWidth:h,position:u="bottom-right",onClick:f,onNodeClick:g,pannable:p=!1,zoomable:m=!1,ariaLabel:b,inversePan:v,zoomStep:w=1,offsetScale:C=5}){const S=us(),L=$.useRef(null),{boundingRect:x,viewBB:I,rfId:E,panZoom:R,translateExtent:M,flowWidth:A,flowHeight:W,ariaLabelConfig:P}=Ti(O2e,cs),B=(n==null?void 0:n.width)??M2e,V=(n==null?void 0:n.height)??A2e,K=x.width/B,z=x.height/V,j=Math.max(K,z),X=j*B,Y=j*V,te=C*j,ce=x.x-(X-x.width)/2-te,Ce=x.y-(Y-x.height)/2-te,xe=X+te*2,Be=Y+te*2,Ee=`${F2e}-${E}`,Le=$.useRef(0),ze=$.useRef();Le.current=j,$.useEffect(()=>{if(L.current&&R)return ze.current=HNe({domNode:L.current,panZoom:R,getTransform:()=>S.getState().transform,getViewScale:()=>Le.current}),()=>{var tt;(tt=ze.current)==null||tt.destroy()}},[R]),$.useEffect(()=>{var tt;(tt=ze.current)==null||tt.update({translateExtent:M,width:A,height:W,inversePan:v,pannable:p,zoomStep:w,zoomable:m})},[p,m,v,w,M,A,W]);const Ct=f?tt=>{var Pt;const[_t,yi]=((Pt=ze.current)==null?void 0:Pt.pointer(tt))||[0,0];f(tt,{x:_t,y:yi})}:void 0,ct=g?$.useCallback((tt,_t)=>{const yi=S.getState().nodeLookup.get(_t).internals.userNode;g(tt,yi)},[]):void 0,Ue=b??P["minimap.ariaLabel"];return y.jsx(L5,{position:u,style:{...n,"--xy-minimap-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*j:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof t=="string"?t:void 0,"--xy-minimap-node-stroke-width-props":typeof r=="number"?r:void 0},className:fo(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:y.jsxs("svg",{width:B,height:V,viewBox:`${ce} ${Ce} ${xe} ${Be}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Ee,ref:L,onClick:Ct,children:[Ue&&y.jsx("title",{id:Ee,children:Ue}),y.jsx(R2e,{onClick:ct,nodeColor:i,nodeStrokeColor:t,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:r,nodeComponent:a}),y.jsx("path",{className:"react-flow__minimap-mask",d:`M${ce-te},${Ce-te}h${xe+te*2}v${Be+te*2}h${-xe-te*2}z + M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Ofe.displayName="MiniMap";const B2e=$.memo(Ofe),W2e=n=>e=>n?`${Math.max(1/e.transform[2],1)}`:void 0,H2e={[Jy.Line]:"right",[Jy.Handle]:"bottom-right"};function V2e({nodeId:n,position:e,variant:t=Jy.Handle,className:i,style:s=void 0,children:o,color:r,minWidth:a=10,minHeight:l=10,maxWidth:c=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:u,autoScale:f=!0,shouldResize:g,onResizeStart:p,onResize:m,onResizeEnd:b}){const v=gfe(),w=typeof n=="string"?n:v,C=us(),S=$.useRef(null),L=t===Jy.Handle,x=Ti($.useCallback(W2e(L&&f),[L,f]),cs),I=$.useRef(null),E=e??H2e[t];$.useEffect(()=>{if(!(!S.current||!w))return I.current||(I.current=eDe({domNode:S.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,domNode:V}=C.getState();return{nodeLookup:M,transform:A,snapGrid:W,snapToGrid:P,nodeOrigin:B,paneDomNode:V}},onChange:(M,A)=>{const{triggerNodeChanges:W,nodeLookup:P,parentLookup:B,nodeOrigin:V}=C.getState(),K=[],z={x:M.x,y:M.y},j=P.get(w);if(j&&j.expandParent&&j.parentId){const X=j.origin??V,Y=M.width??j.measured.width??0,te=M.height??j.measured.height??0,ce={id:j.id,parentId:j.parentId,rect:{width:Y,height:te,...Mue({x:M.x??j.position.x,y:M.y??j.position.y},{width:Y,height:te},j.parentId,P,X)}},Ce=pG([ce],P,B,V);K.push(...Ce),z.x=M.x?Math.max(X[0]*Y,M.x):void 0,z.y=M.y?Math.max(X[1]*te,M.y):void 0}if(z.x!==void 0&&z.y!==void 0){const X={id:w,type:"position",position:{...z}};K.push(X)}if(M.width!==void 0&&M.height!==void 0){const Y={id:w,type:"dimensions",resizing:!0,setAttributes:u?u==="horizontal"?"width":"height":!0,dimensions:{width:M.width,height:M.height}};K.push(Y)}for(const X of A){const Y={...X,type:"position"};K.push(Y)}W(K)},onEnd:({width:M,height:A})=>{const W={id:w,type:"dimensions",resizing:!1,dimensions:{width:M,height:A}};C.getState().triggerNodeChanges([W])}})),I.current.update({controlPosition:E,boundaries:{minWidth:a,minHeight:l,maxWidth:c,maxHeight:d},keepAspectRatio:h,resizeDirection:u,onResizeStart:p,onResize:m,onResizeEnd:b,shouldResize:g}),()=>{var M;(M=I.current)==null||M.destroy()}},[E,a,l,c,d,h,p,m,b,g]);const R=E.split("-");return y.jsx("div",{className:fo(["react-flow__resize-control","nodrag",...R,t,i]),ref:S,style:{...s,scale:x,...r&&{[L?"backgroundColor":"borderColor"]:r}},children:o})}$.memo(V2e);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q2e=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hfe=(...n)=>n.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/** + */const z2e=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ffe=(...n)=>n.filter((e,t,i)=>!!e&&i.indexOf(e)===t).join(" ");/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var K2e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var j2e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const G2e=$.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:r,...a},l)=>$.createElement("svg",{ref:l,...K2e,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Hfe("lucide",s),...a},[...r.map(([c,d])=>$.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** + */const $2e=$.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:i,className:s="",children:o,iconNode:r,...a},l)=>$.createElement("svg",{ref:l,...j2e,width:e,height:e,stroke:n,strokeWidth:i?Number(t)*24/Number(e):t,className:Ffe("lucide",s),...a},[...r.map(([c,d])=>$.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ci=(n,e)=>{const t=$.forwardRef(({className:i,...s},o)=>$.createElement(G2e,{ref:o,iconNode:e,className:Hfe(`lucide-${q2e(n)}`,i),...s}));return t.displayName=`${n}`,t};/** + */const fi=(n,e)=>{const t=$.forwardRef(({className:i,...s},o)=>$.createElement($2e,{ref:o,iconNode:e,className:Ffe(`lucide-${z2e(n)}`,i),...s}));return t.displayName=`${n}`,t};/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wR=ci("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** + */const CR=fi("ArrowRightLeft",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iv=ci("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const JC=fi("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vfe=ci("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const Bfe=fi("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Op=ci("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Pp=fi("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LL=ci("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const LL=fi("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UM=ci("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const vte=fi("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y2e=ci("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const U2e=fi("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Z2e=ci("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + */const q2e=fi("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const X2e=ci("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const YI=fi("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YE=ci("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const yR=fi("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CR=ci("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const K2e=fi("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q2e=ci("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const G2e=fi("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wte=ci("FileCode2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m5 12-3 3 3 3",key:"oke12k"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]]);/** + */const e0=fi("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wf=ci("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const Y2e=fi("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const J2e=ci("FolderPlus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const Z2e=fi("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eRe=ci("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const wte=fi("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cte=ci("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const X2e=fi("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tRe=ci("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** + */const Q2e=fi("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iRe=ci("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + */const Cte=fi("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yte=ci("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** + */const yte=fi("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ste=ci("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const J2e=fi("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nRe=ci("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** + */const eRe=fi("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sRe=ci("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** + */const t0=fi("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s0=ci("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + */const xf=fi("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Sp=ci("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const rk=fi("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rk=ci("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const tRe=fi("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zfe=ci("Rows3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);/** + */const iRe=fi("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oRe=ci("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + */const lb=fi("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cb=ci("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const nRe=fi("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rRe=ci("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const ZI=fi("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZE=ci("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + */const sRe=fi("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aRe=ci("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + */const oRe=fi("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xte=ci("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** + */const Ste=fi("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lte=ci("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/** + */const rRe=fi("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lRe=ci("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const gp=fi("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gp=ci("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const IT=fi("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kT=ci("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** + */const kL=fi("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kL=ci("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + */const xte=fi("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kte=ci("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]);/** + */const aRe=fi("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.400.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cRe=ci("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** - * @license lucide-react v0.400.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nv=ci("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),jfe="/api",KB="aevatar:auth-required";function Ete(n){const e=String(n||"").toLowerCase();return e.includes("application/json")||e.includes("+json")}function Ite(n){const e=String(n||"").toLowerCase();return e.includes("text/html")||e.includes("application/xhtml+xml")}function ak(n){typeof window>"u"||window.dispatchEvent(new CustomEvent(KB,{detail:n}))}function dRe(n){if(typeof window>"u")return()=>{};const e=t=>{const i=t.detail||{};n(i)};return window.addEventListener(KB,e),()=>window.removeEventListener(KB,e)}async function Xt(n,e){const t=new Headers(e==null?void 0:e.headers);!(typeof FormData<"u"&&(e==null?void 0:e.body)instanceof FormData)&&!t.has("Content-Type")&&t.set("Content-Type","application/json");const s=await fetch(`${jfe}${n}`,{...e,headers:t}),o=s.headers.get("content-type");if(!s.ok){const a=Ete(o)?await s.json().catch(()=>({})):{message:await s.text().catch(()=>"")};throw(s.status===401||a!=null&&a.loginUrl)&&ak({loginUrl:a==null?void 0:a.loginUrl,message:(a==null?void 0:a.message)||"Sign in to continue."}),{status:s.status,...a}}if(s.status===204)return;if(Ete(o))return s.json();s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."});const r=await s.text().catch(()=>"");throw(Ite(o)||s.redirected)&&ak({loginUrl:s.redirected?s.url:null,message:"API returned HTML instead of JSON. Sign-in may be required."}),{status:s.redirected?401:s.status,message:Ite(o)?"API returned HTML instead of JSON. Sign-in may be required.":"API returned an unexpected response format.",rawBody:r}}async function Nte(n,e,t,i){const s=await fetch(`${jfe}${n}`,{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(e),signal:i});if(s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."}),!s.ok){const l=await s.json().catch(()=>({}));throw(s.status===401||l!=null&&l.loginUrl)&&ak({loginUrl:(l==null?void 0:l.loginUrl)||(s.redirected?s.url:null),message:(l==null?void 0:l.message)||"Sign in to continue."}),{status:s.status,...l}}if(!s.body)return;const o=s.body.getReader(),r=new TextDecoder;let a="";for(;;){const{value:l,done:c}=await o.read();a+=r.decode(l||new Uint8Array,{stream:!c});let d=a.indexOf(` + */const i0=fi("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Wfe="/api",qB="aevatar:auth-required";function Lte(n){const e=String(n||"").toLowerCase();return e.includes("application/json")||e.includes("+json")}function kte(n){const e=String(n||"").toLowerCase();return e.includes("text/html")||e.includes("application/xhtml+xml")}function ak(n){typeof window>"u"||window.dispatchEvent(new CustomEvent(qB,{detail:n}))}function lRe(n){if(typeof window>"u")return()=>{};const e=t=>{const i=t.detail||{};n(i)};return window.addEventListener(qB,e),()=>window.removeEventListener(qB,e)}async function Qt(n,e){const t=new Headers(e==null?void 0:e.headers);!(typeof FormData<"u"&&(e==null?void 0:e.body)instanceof FormData)&&!t.has("Content-Type")&&t.set("Content-Type","application/json");const s=await fetch(`${Wfe}${n}`,{...e,headers:t}),o=s.headers.get("content-type");if(!s.ok){const a=Lte(o)?await s.json().catch(()=>({})):{message:await s.text().catch(()=>"")};throw(s.status===401||a!=null&&a.loginUrl)&&ak({loginUrl:a==null?void 0:a.loginUrl,message:(a==null?void 0:a.message)||"Sign in to continue."}),{status:s.status,...a}}if(s.status===204)return;if(Lte(o))return s.json();s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."});const r=await s.text().catch(()=>"");throw(kte(o)||s.redirected)&&ak({loginUrl:s.redirected?s.url:null,message:"API returned HTML instead of JSON. Sign-in may be required."}),{status:s.redirected?401:s.status,message:kte(o)?"API returned HTML instead of JSON. Sign-in may be required.":"API returned an unexpected response format.",rawBody:r}}async function Ite(n,e,t,i){const s=await fetch(`${Wfe}${n}`,{method:"POST",headers:{Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(e),signal:i});if(s.redirected&&ak({loginUrl:s.url,message:"Sign in to continue."}),!s.ok){const l=await s.json().catch(()=>({}));throw(s.status===401||l!=null&&l.loginUrl)&&ak({loginUrl:(l==null?void 0:l.loginUrl)||(s.redirected?s.url:null),message:(l==null?void 0:l.message)||"Sign in to continue."}),{status:s.status,...l}}if(!s.body)return;const o=s.body.getReader(),r=new TextDecoder;let a="";for(;;){const{value:l,done:c}=await o.read();a+=r.decode(l||new Uint8Array,{stream:!c});let d=a.indexOf(` `);for(;d>=0;){const h=a.slice(0,d);a=a.slice(d+2);const u=h.split(` `).filter(f=>f.startsWith("data:")).map(f=>f.slice(5).trim()).join(` `);u&&u!=="[DONE]"&&t(JSON.parse(u)),d=a.indexOf(` -`)}if(c)break}}function Dte(n){return!n||typeof n!="object"?null:n.type?n:n.textMessageContent?{type:"TEXT_MESSAGE_CONTENT",delta:n.textMessageContent.delta||""}:n.textMessageReasoning?{type:"TEXT_MESSAGE_REASONING",delta:n.textMessageReasoning.delta||""}:n.textMessageEnd?{type:"TEXT_MESSAGE_END",message:n.textMessageEnd.message||"",delta:n.textMessageEnd.delta||""}:n.runError?{type:"RUN_ERROR",message:n.runError.message||"Assistant run failed."}:n}const ap={parseYaml:(n,e)=>Xt("/editor/parse-yaml",{method:"POST",body:JSON.stringify({yaml:n,availableWorkflowNames:e})}),serializeYaml:(n,e)=>Xt("/editor/serialize-yaml",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),validate:(n,e)=>Xt("/editor/validate",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),normalize:(n,e)=>Xt("/editor/normalize",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),diff:(n,e)=>Xt("/editor/diff",{method:"POST",body:JSON.stringify({before:n,after:e})})},lp={getSettings:()=>Xt("/workspace"),updateSettings:n=>Xt("/workspace/settings",{method:"PUT",body:JSON.stringify(n)}),addDirectory:n=>Xt("/workspace/directories",{method:"POST",body:JSON.stringify(n)}),removeDirectory:n=>Xt(`/workspace/directories/${n}`,{method:"DELETE"}),listWorkflows:()=>Xt("/workspace/workflows"),getWorkflow:n=>Xt(`/workspace/workflows/${n}`),saveWorkflow:n=>Xt("/workspace/workflows",{method:"POST",body:JSON.stringify(n)})},cC={getCatalog:()=>Xt("/connectors"),saveCatalog:n=>Xt("/connectors",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Xt("/connectors/import",{method:"POST",body:e})},getDraft:()=>Xt("/connectors/draft"),saveDraft:n=>Xt("/connectors/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Xt("/connectors/draft",{method:"DELETE"})},dC={getCatalog:()=>Xt("/roles"),saveCatalog:n=>Xt("/roles",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Xt("/roles/import",{method:"POST",body:e})},getDraft:()=>Xt("/roles/draft"),saveDraft:n=>Xt("/roles/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Xt("/roles/draft",{method:"DELETE"})},ET={get:()=>Xt("/settings"),save:n=>Xt("/settings",{method:"PUT",body:JSON.stringify(n)}),testRuntime:n=>Xt("/settings/runtime/test",{method:"POST",body:JSON.stringify(n)})},z_={list:()=>Xt("/executions"),get:n=>Xt(`/executions/${n}`),start:n=>Xt("/executions",{method:"POST",body:JSON.stringify(n)}),resume:(n,e)=>Xt(`/executions/${n}/resume`,{method:"POST",body:JSON.stringify(e)}),stop:(n,e)=>Xt(`/executions/${n}/stop`,{method:"POST",body:JSON.stringify(e)})},$fe={authorWorkflow:async(n,e)=>{let t="",i="";return await Nte("/app/workflow-generator",n,s=>{var r,a,l;const o=Dte(s);if(o){if(o.type==="TEXT_MESSAGE_CONTENT"){t+=o.delta||"",(r=e==null?void 0:e.onText)==null||r.call(e,t);return}if(o.type==="TEXT_MESSAGE_REASONING"){i+=o.delta||"",(a=e==null?void 0:e.onReasoning)==null||a.call(e,i);return}if(o.type==="TEXT_MESSAGE_END"){t=t||o.message||o.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(o.type==="RUN_ERROR")throw new Error(o.message||"Assistant run failed.")}},e==null?void 0:e.signal),t},authorScript:async(n,e)=>{let t="",i="",s=null,o="";return await Nte("/app/scripts/generator",n,r=>{var l,c,d;const a=Dte(r);if(a){if(a.type==="TEXT_MESSAGE_CONTENT"){t+=a.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(a.type==="TEXT_MESSAGE_REASONING"){i+=a.delta||"",(c=e==null?void 0:e.onReasoning)==null||c.call(e,i);return}if(a.type==="TEXT_MESSAGE_END"){t=t||a.message||a.delta||"",s=a.scriptPackage||null,o=a.currentFilePath||"",(d=e==null?void 0:e.onText)==null||d.call(e,t);return}if(a.type==="RUN_ERROR")throw new Error(a.message||"Assistant run failed.")}},e==null?void 0:e.signal),{text:t,scriptPackage:s,currentFilePath:o}}},hRe={getSession:()=>Xt("/auth/me")},xl={getContext:()=>Xt("/app/context"),validateDraftScript:(n,e)=>Xt("/app/scripts/validate",{method:"POST",body:JSON.stringify(n),signal:e}),listScripts:(n=!1)=>Xt(`/app/scripts?includeSource=${n?"true":"false"}`),getScript:n=>Xt(`/app/scripts/${encodeURIComponent(n)}`),getScriptCatalog:n=>Xt(`/app/scripts/${encodeURIComponent(n)}/catalog`),listScriptRuntimes:(n=24)=>Xt(`/app/scripts/runtimes?take=${n}`),getEvolutionDecision:n=>Xt(`/app/scripts/evolutions/${encodeURIComponent(n)}`),getRuntimeReadModel:n=>Xt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),saveScript:n=>Xt("/app/scripts",{method:"POST",body:JSON.stringify(n)}),runDraftScript:n=>Xt("/app/scripts/draft-run",{method:"POST",body:JSON.stringify(n)})},uRe={getReadModel:n=>Xt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),proposeEvolution:n=>Xt("/app/scripts/evolutions/proposals",{method:"POST",body:JSON.stringify(n)})};function Tte(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};IT.initial(n),IT.handler(e);var t={current:n},i=EL(ORe)(t,e),s=EL(PRe)(t),o=EL(IT.changes)(n),r=EL(ARe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return IT.selector(c),c(t.current)}function l(c){xRe(i,s,o,r)(c)}return[a,l]}function ARe(n,e){return XE(e)?e(n.current):e}function PRe(n,e){return n.current=Pte(Pte({},n.current),e),e}function ORe(n,e,t){return XE(e)?e(n.current):Object.keys(t).forEach(function(i){var s;return(s=e[i])===null||s===void 0?void 0:s.call(e,n.current[i])}),t}var FRe={create:MRe},BRe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function WRe(n){return function e(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;lQt("/editor/parse-yaml",{method:"POST",body:JSON.stringify({yaml:n,availableWorkflowNames:e})}),serializeYaml:(n,e)=>Qt("/editor/serialize-yaml",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),validate:(n,e)=>Qt("/editor/validate",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),normalize:(n,e)=>Qt("/editor/normalize",{method:"POST",body:JSON.stringify({document:n,availableWorkflowNames:e})}),diff:(n,e)=>Qt("/editor/diff",{method:"POST",body:JSON.stringify({before:n,after:e})})},lp={getSettings:()=>Qt("/workspace"),updateSettings:n=>Qt("/workspace/settings",{method:"PUT",body:JSON.stringify(n)}),addDirectory:n=>Qt("/workspace/directories",{method:"POST",body:JSON.stringify(n)}),removeDirectory:n=>Qt(`/workspace/directories/${n}`,{method:"DELETE"}),listWorkflows:()=>Qt("/workspace/workflows"),getWorkflow:n=>Qt(`/workspace/workflows/${n}`),saveWorkflow:n=>Qt("/workspace/workflows",{method:"POST",body:JSON.stringify(n)})},sC={getCatalog:()=>Qt("/connectors"),saveCatalog:n=>Qt("/connectors",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Qt("/connectors/import",{method:"POST",body:e})},getDraft:()=>Qt("/connectors/draft"),saveDraft:n=>Qt("/connectors/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Qt("/connectors/draft",{method:"DELETE"})},oC={getCatalog:()=>Qt("/roles"),saveCatalog:n=>Qt("/roles",{method:"PUT",body:JSON.stringify(n)}),importCatalog:n=>{const e=new FormData;return e.set("file",n,n.name),Qt("/roles/import",{method:"POST",body:e})},getDraft:()=>Qt("/roles/draft"),saveDraft:n=>Qt("/roles/draft",{method:"PUT",body:JSON.stringify(n)}),deleteDraft:()=>Qt("/roles/draft",{method:"DELETE"})},ET={get:()=>Qt("/settings"),save:n=>Qt("/settings",{method:"PUT",body:JSON.stringify(n)}),testRuntime:n=>Qt("/settings/runtime/test",{method:"POST",body:JSON.stringify(n)})},V_={list:()=>Qt("/executions"),get:n=>Qt(`/executions/${n}`),start:n=>Qt("/executions",{method:"POST",body:JSON.stringify(n)}),resume:(n,e)=>Qt(`/executions/${n}/resume`,{method:"POST",body:JSON.stringify(e)}),stop:(n,e)=>Qt(`/executions/${n}/stop`,{method:"POST",body:JSON.stringify(e)})},Hfe={authorWorkflow:async(n,e)=>{let t="",i="";return await Ite("/app/workflow-generator",n,s=>{var r,a,l;const o=Ete(s);if(o){if(o.type==="TEXT_MESSAGE_CONTENT"){t+=o.delta||"",(r=e==null?void 0:e.onText)==null||r.call(e,t);return}if(o.type==="TEXT_MESSAGE_REASONING"){i+=o.delta||"",(a=e==null?void 0:e.onReasoning)==null||a.call(e,i);return}if(o.type==="TEXT_MESSAGE_END"){t=t||o.message||o.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(o.type==="RUN_ERROR")throw new Error(o.message||"Assistant run failed.")}},e==null?void 0:e.signal),t},authorScript:async(n,e)=>{let t="",i="",s=null,o="";return await Ite("/app/scripts/generator",n,r=>{var l,c,d;const a=Ete(r);if(a){if(a.type==="TEXT_MESSAGE_CONTENT"){t+=a.delta||"",(l=e==null?void 0:e.onText)==null||l.call(e,t);return}if(a.type==="TEXT_MESSAGE_REASONING"){i+=a.delta||"",(c=e==null?void 0:e.onReasoning)==null||c.call(e,i);return}if(a.type==="TEXT_MESSAGE_END"){t=t||a.message||a.delta||"",s=a.scriptPackage||null,o=a.currentFilePath||"",(d=e==null?void 0:e.onText)==null||d.call(e,t);return}if(a.type==="RUN_ERROR")throw new Error(a.message||"Assistant run failed.")}},e==null?void 0:e.signal),{text:t,scriptPackage:s,currentFilePath:o}}},cRe={getSession:()=>Qt("/auth/me")},wl={getContext:()=>Qt("/app/context"),validateDraftScript:(n,e)=>Qt("/app/scripts/validate",{method:"POST",body:JSON.stringify(n),signal:e}),listScripts:(n=!1)=>Qt(`/app/scripts?includeSource=${n?"true":"false"}`),getScript:n=>Qt(`/app/scripts/${encodeURIComponent(n)}`),getScriptCatalog:n=>Qt(`/app/scripts/${encodeURIComponent(n)}/catalog`),listScriptRuntimes:(n=24)=>Qt(`/app/scripts/runtimes?take=${n}`),getEvolutionDecision:n=>Qt(`/app/scripts/evolutions/${encodeURIComponent(n)}`),getRuntimeReadModel:n=>Qt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),saveScript:n=>Qt("/app/scripts",{method:"POST",body:JSON.stringify(n)}),runDraftScript:n=>Qt("/app/scripts/draft-run",{method:"POST",body:JSON.stringify(n)})},dRe={getReadModel:n=>Qt(`/app/scripts/runtimes/${encodeURIComponent(n)}/readmodel`),proposeEvolution:n=>Qt("/app/scripts/evolutions/proposals",{method:"POST",body:JSON.stringify(n)})};function Nte(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,i=Array(e);t=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l1&&arguments[1]!==void 0?arguments[1]:{};NT.initial(n),NT.handler(e);var t={current:n},i=IL(ARe)(t,e),s=IL(MRe)(t),o=IL(NT.changes)(n),r=IL(RRe)(t);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return NT.selector(c),c(t.current)}function l(c){yRe(i,s,o,r)(c)}return[a,l]}function RRe(n,e){return XI(e)?e(n.current):e}function MRe(n,e){return n.current=Mte(Mte({},n.current),e),e}function ARe(n,e,t){return XI(e)?e(n.current):Object.keys(t).forEach(function(i){var s;return(s=e[i])===null||s===void 0?void 0:s.call(e,n.current[i])}),t}var PRe={create:TRe},ORe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function FRe(n){return function e(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o=n.length?n.apply(this,s):function(){for(var r=arguments.length,a=new Array(r),l=0;l{i.current=!1}:n,e)}var Al=hMe;function lk(){}function o0(n,e,t,i){return uMe(n,i)||fMe(n,e,t,i)}function uMe(n,e){return n.editor.getModel(Xfe(n,e))}function fMe(n,e,t,i){return n.editor.createModel(e,t,i?Xfe(n,i):void 0)}function Xfe(n,e){return n.Uri.parse(e)}function gMe({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:r,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:h={},height:u="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=lk,onMount:b=lk}){let[v,w]=$.useState(!1),[C,S]=$.useState(!0),L=$.useRef(null),x=$.useRef(null),E=$.useRef(null),I=$.useRef(b),R=$.useRef(m),M=$.useRef(!1);Zfe(()=>{let B=vG.init();return B.then(V=>(x.current=V)&&S(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>L.current?P():B.cancel()}),Al(()=>{if(L.current&&x.current){let B=L.current.getOriginalEditor(),V=o0(x.current,n||"",i||t||"text",o||"");V!==B.getModel()&&B.setModel(V)}},[o],v),Al(()=>{if(L.current&&x.current){let B=L.current.getModifiedEditor(),V=o0(x.current,e||"",s||t||"text",r||"");V!==B.getModel()&&B.setModel(V)}},[r],v),Al(()=>{let B=L.current.getModifiedEditor();B.getOption(x.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],v),Al(()=>{var B,V;(V=(B=L.current)==null?void 0:B.getModel())==null||V.original.setValue(n||"")},[n],v),Al(()=>{let{original:B,modified:V}=L.current.getModel();x.current.editor.setModelLanguage(B,i||t||"text"),x.current.editor.setModelLanguage(V,s||t||"text")},[t,i,s],v),Al(()=>{var B;(B=x.current)==null||B.editor.setTheme(c)},[c],v),Al(()=>{var B;(B=L.current)==null||B.updateOptions(h)},[h],v);let A=$.useCallback(()=>{var K;if(!x.current)return;R.current(x.current);let B=o0(x.current,n||"",i||t||"text",o||""),V=o0(x.current,e||"",s||t||"text",r||"");(K=L.current)==null||K.setModel({original:B,modified:V})},[t,e,s,n,i,o,r]),W=$.useCallback(()=>{var B;!M.current&&E.current&&(L.current=x.current.editor.createDiffEditor(E.current,{automaticLayout:!0,...h}),A(),(B=x.current)==null||B.editor.setTheme(c),w(!0),M.current=!0)},[h,c,A]);$.useEffect(()=>{v&&I.current(L.current,x.current)},[v]),$.useEffect(()=>{!C&&!v&&W()},[C,v,W]);function P(){var V,K,z,j;let B=(V=L.current)==null?void 0:V.getModel();a||((K=B==null?void 0:B.original)==null||K.dispose()),l||((z=B==null?void 0:B.modified)==null||z.dispose()),(j=L.current)==null||j.dispose()}return hm.createElement(Yfe,{width:f,height:u,isEditorReady:v,loading:d,_ref:E,className:g,wrapperProps:p})}var pMe=gMe;$.memo(pMe);function mMe(n){let e=$.useRef();return $.useEffect(()=>{e.current=n},[n]),e.current}var _Me=mMe,NT=new Map;function bMe({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:s,path:o,theme:r="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:u=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:b=lk,onMount:v=lk,onChange:w,onValidate:C=lk}){let[S,L]=$.useState(!1),[x,E]=$.useState(!0),I=$.useRef(null),R=$.useRef(null),M=$.useRef(null),A=$.useRef(v),W=$.useRef(b),P=$.useRef(),B=$.useRef(i),V=_Me(o),K=$.useRef(!1),z=$.useRef(!1);Zfe(()=>{let Y=vG.init();return Y.then(te=>(I.current=te)&&E(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>R.current?Q():Y.cancel()}),Al(()=>{var te,ce,Ce,xe;let Y=o0(I.current,n||i||"",e||s||"",o||t||"");Y!==((te=R.current)==null?void 0:te.getModel())&&(h&&NT.set(V,(ce=R.current)==null?void 0:ce.saveViewState()),(Ce=R.current)==null||Ce.setModel(Y),h&&((xe=R.current)==null||xe.restoreViewState(NT.get(o))))},[o],S),Al(()=>{var Y;(Y=R.current)==null||Y.updateOptions(c)},[c],S),Al(()=>{!R.current||i===void 0||(R.current.getOption(I.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(z.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),z.current=!1))},[i],S),Al(()=>{var te,ce;let Y=(te=R.current)==null?void 0:te.getModel();Y&&s&&((ce=I.current)==null||ce.editor.setModelLanguage(Y,s))},[s],S),Al(()=>{var Y;a!==void 0&&((Y=R.current)==null||Y.revealLine(a))},[a],S),Al(()=>{var Y;(Y=I.current)==null||Y.editor.setTheme(r)},[r],S);let j=$.useCallback(()=>{var Y;if(!(!M.current||!I.current)&&!K.current){W.current(I.current);let te=o||t,ce=o0(I.current,i||n||"",e||s||"",te||"");R.current=(Y=I.current)==null?void 0:Y.editor.create(M.current,{model:ce,automaticLayout:!0,...c},d),h&&R.current.restoreViewState(NT.get(te)),I.current.editor.setTheme(r),a!==void 0&&R.current.revealLine(a),L(!0),K.current=!0}},[n,e,t,i,s,o,c,d,h,r,a]);$.useEffect(()=>{S&&A.current(R.current,I.current)},[S]),$.useEffect(()=>{!x&&!S&&j()},[x,S,j]),B.current=i,$.useEffect(()=>{var Y,te;S&&w&&((Y=P.current)==null||Y.dispose(),P.current=(te=R.current)==null?void 0:te.onDidChangeModelContent(ce=>{z.current||w(R.current.getValue(),ce)}))},[S,w]),$.useEffect(()=>{if(S){let Y=I.current.editor.onDidChangeMarkers(te=>{var Ce;let ce=(Ce=R.current.getModel())==null?void 0:Ce.uri;if(ce&&te.find(xe=>xe.path===ce.path)){let xe=I.current.editor.getModelMarkers({resource:ce});C==null||C(xe)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[S,C]);function Q(){var Y,te;(Y=P.current)==null||Y.dispose(),u?h&&NT.set(o,R.current.saveViewState()):(te=R.current.getModel())==null||te.dispose(),R.current.dispose()}return hm.createElement(Yfe,{width:f,height:g,isEditorReady:S,loading:l,_ref:M,className:p,wrapperProps:m})}var vMe=bMe,wMe=$.memo(vMe),CMe=wMe;function yMe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Bi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function wG(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function GB(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function Bte(n){let e=0;for(let t=0;t0}function bg(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function or(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function N5(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function l7(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function DT(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function YB(n,e){for(const t of e)n.push(t)}function LMe(n,e){const t=[];for(const i of n){const s=e(i);s!==void 0&&t.push(s)}return t}function yG(n){return Array.isArray(n)?n:[n]}function kMe(n,e,t){const i=ege(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Cm||(Cm={}));function lo(n,e){return(t,i)=>e(n(t),n(i))}function EMe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!Cm.isNeitherLessOrGreaterThan(s))return s}return Cm.neitherLessOrGreaterThan}}const pa=(n,e)=>n-e,tge=(n,e)=>pa(n?1:0,e?1:0);function ige(n){return(e,t)=>-n(e,t)}function IMe(n){return(e,t)=>e===void 0?t===void 0?Cm.neitherLessOrGreaterThan:Cm.lessThan:t===void 0?Cm.greaterThan:n(e,t)}class vg{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const D0=class D0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new D0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new D0(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||Cm.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};D0.empty=new D0(e=>{});let Lv=D0;class YM{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((s,o)=>t(e[s],e[o]));return new YM(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;te+t,0)}class NMe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?sS.isErrorNoTelemetry(e)?new sS(e.message+` + `},Ate=FRe(VRe)(Vfe),zRe={config:WRe},jRe=function(){for(var e=arguments.length,t=new Array(e),i=0;i{i.current=!1}:n,e)}var Dl=cMe;function lk(){}function n0(n,e,t,i){return dMe(n,i)||hMe(n,e,t,i)}function dMe(n,e){return n.editor.getModel(Kfe(n,e))}function hMe(n,e,t,i){return n.editor.createModel(e,t,i?Kfe(n,i):void 0)}function Kfe(n,e){return n.Uri.parse(e)}function uMe({original:n,modified:e,language:t,originalLanguage:i,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:r,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:h={},height:u="100%",width:f="100%",className:g,wrapperProps:p={},beforeMount:m=lk,onMount:b=lk}){let[v,w]=$.useState(!1),[C,S]=$.useState(!0),L=$.useRef(null),x=$.useRef(null),I=$.useRef(null),E=$.useRef(b),R=$.useRef(m),M=$.useRef(!1);qfe(()=>{let B=bG.init();return B.then(V=>(x.current=V)&&S(!1)).catch(V=>(V==null?void 0:V.type)!=="cancelation"&&console.error("Monaco initialization: error:",V)),()=>L.current?P():B.cancel()}),Dl(()=>{if(L.current&&x.current){let B=L.current.getOriginalEditor(),V=n0(x.current,n||"",i||t||"text",o||"");V!==B.getModel()&&B.setModel(V)}},[o],v),Dl(()=>{if(L.current&&x.current){let B=L.current.getModifiedEditor(),V=n0(x.current,e||"",s||t||"text",r||"");V!==B.getModel()&&B.setModel(V)}},[r],v),Dl(()=>{let B=L.current.getModifiedEditor();B.getOption(x.current.editor.EditorOption.readOnly)?B.setValue(e||""):e!==B.getValue()&&(B.executeEdits("",[{range:B.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),B.pushUndoStop())},[e],v),Dl(()=>{var B,V;(V=(B=L.current)==null?void 0:B.getModel())==null||V.original.setValue(n||"")},[n],v),Dl(()=>{let{original:B,modified:V}=L.current.getModel();x.current.editor.setModelLanguage(B,i||t||"text"),x.current.editor.setModelLanguage(V,s||t||"text")},[t,i,s],v),Dl(()=>{var B;(B=x.current)==null||B.editor.setTheme(c)},[c],v),Dl(()=>{var B;(B=L.current)==null||B.updateOptions(h)},[h],v);let A=$.useCallback(()=>{var K;if(!x.current)return;R.current(x.current);let B=n0(x.current,n||"",i||t||"text",o||""),V=n0(x.current,e||"",s||t||"text",r||"");(K=L.current)==null||K.setModel({original:B,modified:V})},[t,e,s,n,i,o,r]),W=$.useCallback(()=>{var B;!M.current&&I.current&&(L.current=x.current.editor.createDiffEditor(I.current,{automaticLayout:!0,...h}),A(),(B=x.current)==null||B.editor.setTheme(c),w(!0),M.current=!0)},[h,c,A]);$.useEffect(()=>{v&&E.current(L.current,x.current)},[v]),$.useEffect(()=>{!C&&!v&&W()},[C,v,W]);function P(){var V,K,z,j;let B=(V=L.current)==null?void 0:V.getModel();a||((K=B==null?void 0:B.original)==null||K.dispose()),l||((z=B==null?void 0:B.modified)==null||z.dispose()),(j=L.current)==null||j.dispose()}return dm.createElement(Ufe,{width:f,height:u,isEditorReady:v,loading:d,_ref:I,className:g,wrapperProps:p})}var fMe=uMe;$.memo(fMe);function gMe(n){let e=$.useRef();return $.useEffect(()=>{e.current=n},[n]),e.current}var pMe=gMe,DT=new Map;function mMe({defaultValue:n,defaultLanguage:e,defaultPath:t,value:i,language:s,path:o,theme:r="light",line:a,loading:l="Loading...",options:c={},overrideServices:d={},saveViewState:h=!0,keepCurrentModel:u=!1,width:f="100%",height:g="100%",className:p,wrapperProps:m={},beforeMount:b=lk,onMount:v=lk,onChange:w,onValidate:C=lk}){let[S,L]=$.useState(!1),[x,I]=$.useState(!0),E=$.useRef(null),R=$.useRef(null),M=$.useRef(null),A=$.useRef(v),W=$.useRef(b),P=$.useRef(),B=$.useRef(i),V=pMe(o),K=$.useRef(!1),z=$.useRef(!1);qfe(()=>{let Y=bG.init();return Y.then(te=>(E.current=te)&&I(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>R.current?X():Y.cancel()}),Dl(()=>{var te,ce,Ce,xe;let Y=n0(E.current,n||i||"",e||s||"",o||t||"");Y!==((te=R.current)==null?void 0:te.getModel())&&(h&&DT.set(V,(ce=R.current)==null?void 0:ce.saveViewState()),(Ce=R.current)==null||Ce.setModel(Y),h&&((xe=R.current)==null||xe.restoreViewState(DT.get(o))))},[o],S),Dl(()=>{var Y;(Y=R.current)==null||Y.updateOptions(c)},[c],S),Dl(()=>{!R.current||i===void 0||(R.current.getOption(E.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(z.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),z.current=!1))},[i],S),Dl(()=>{var te,ce;let Y=(te=R.current)==null?void 0:te.getModel();Y&&s&&((ce=E.current)==null||ce.editor.setModelLanguage(Y,s))},[s],S),Dl(()=>{var Y;a!==void 0&&((Y=R.current)==null||Y.revealLine(a))},[a],S),Dl(()=>{var Y;(Y=E.current)==null||Y.editor.setTheme(r)},[r],S);let j=$.useCallback(()=>{var Y;if(!(!M.current||!E.current)&&!K.current){W.current(E.current);let te=o||t,ce=n0(E.current,i||n||"",e||s||"",te||"");R.current=(Y=E.current)==null?void 0:Y.editor.create(M.current,{model:ce,automaticLayout:!0,...c},d),h&&R.current.restoreViewState(DT.get(te)),E.current.editor.setTheme(r),a!==void 0&&R.current.revealLine(a),L(!0),K.current=!0}},[n,e,t,i,s,o,c,d,h,r,a]);$.useEffect(()=>{S&&A.current(R.current,E.current)},[S]),$.useEffect(()=>{!x&&!S&&j()},[x,S,j]),B.current=i,$.useEffect(()=>{var Y,te;S&&w&&((Y=P.current)==null||Y.dispose(),P.current=(te=R.current)==null?void 0:te.onDidChangeModelContent(ce=>{z.current||w(R.current.getValue(),ce)}))},[S,w]),$.useEffect(()=>{if(S){let Y=E.current.editor.onDidChangeMarkers(te=>{var Ce;let ce=(Ce=R.current.getModel())==null?void 0:Ce.uri;if(ce&&te.find(xe=>xe.path===ce.path)){let xe=E.current.editor.getModelMarkers({resource:ce});C==null||C(xe)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[S,C]);function X(){var Y,te;(Y=P.current)==null||Y.dispose(),u?h&&DT.set(o,R.current.saveViewState()):(te=R.current.getModel())==null||te.dispose(),R.current.dispose()}return dm.createElement(Ufe,{width:f,height:g,isEditorReady:S,loading:l,_ref:M,className:p,wrapperProps:m})}var _Me=mMe,bMe=$.memo(_Me),vMe=bMe;function wMe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Fi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function vG(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function KB(n,e,t){if(n=n|0,n>=e.length)throw new TypeError("invalid index");const i=e[Math.floor(e.length*Math.random())],s=[],o=[],r=[];for(const a of e){const l=t(a,i);l<0?s.push(a):l>0?o.push(a):r.push(a)}return n!!e)}function Ote(n){let e=0;for(let t=0;t0}function bg(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function ar(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function N5(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function l7(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function TT(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function GB(n,e){for(const t of e)n.push(t)}function SMe(n,e){const t=[];for(const i of n){const s=e(i);s!==void 0&&t.push(s)}return t}function CG(n){return Array.isArray(n)?n:[n]}function xMe(n,e,t){const i=Zfe(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(wm||(wm={}));function co(n,e){return(t,i)=>e(n(t),n(i))}function LMe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!wm.isNeitherLessOrGreaterThan(s))return s}return wm.neitherLessOrGreaterThan}}const ma=(n,e)=>n-e,Xfe=(n,e)=>ma(n?1:0,e?1:0);function Qfe(n){return(e,t)=>-n(e,t)}function kMe(n){return(e,t)=>e===void 0?t===void 0?wm.neitherLessOrGreaterThan:wm.lessThan:t===void 0?wm.greaterThan:n(e,t)}class vg{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}const E0=class E0{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new E0(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new E0(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||wm.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}};E0.empty=new E0(e=>{});let yv=E0;class YM{constructor(e){this._indexMap=e}static createSortPermutation(e,t){const i=Array.from(e.keys()).sort((s,o)=>t(e[s],e[o]));return new YM(i)}apply(e){return e.map((t,i)=>e[this._indexMap[i]])}inverse(){const e=this._indexMap.slice();for(let t=0;te+t,0)}class IMe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?iS.isErrorNoTelemetry(e)?new iS(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const SG=new NMe;function XM(n){SG.onUnexpectedError(n)}function Je(n){fl(n)||SG.onUnexpectedError(n)}function Bn(n){fl(n)||SG.onUnexpectedExternalError(n)}function ZB(n){if(n instanceof Error){const{name:e,message:t,cause:i}=n,s=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:s,noTelemetry:sS.isErrorNoTelemetry(n),cause:i?ZB(i):void 0,code:n.code}}return n}const QM="Canceled";function fl(n){return n instanceof ic?!0:n instanceof Error&&n.name===QM&&n.message===QM}class ic extends Error{constructor(){super(QM),this.name=this.message}}function DMe(){const n=new Error(QM);return n.name=n.message,n}function Zl(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function JM(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class TMe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class sS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof sS)return e;const t=new sS;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class ze extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ze.prototype)}}function c7(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function iD(n,e="Unreachable"){throw new Error(e)}function QE(n,e="unexpected state"){if(!n)throw typeof e=="string"?new ze(`Assertion Failed: ${e}`):e}function Wte(n,e="Soft Assertion Failed"){n||Je(new ze(e))}function Qm(n){if(!n()){debugger;n(),Je(new ze("Assertion Failed"))}}function nD(n,e){let t=0;for(;t"u"}function Ts(n){return!Hl(n)}function Hl(n){return ko(n)||n===null}function Ot(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function Kp(n){return QE(n!=null,"Argument is `undefined` or `null`."),n}function G1(n){return typeof n=="function"}function AMe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?jh(i):i}),e}function OMe(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(nge.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!MMe(s)&&e.push(s)}}return n}const nge=Object.prototype.hasOwnProperty;function sge(n,e){return JB(n,e,new Set)}function JB(n,e,t){if(Hl(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(JB(o,e,t));return s}if(ns(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)nge.call(n,o)&&(s[o]=JB(n[o],e,t));return t.delete(n),s}return n}function D5(n,e,t=!0){return ns(n)?(ns(e)&&Object.keys(e).forEach(i=>{i in n?t&&(ns(n[i])&&ns(e[i])?D5(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function ma(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t=0;function eA(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),FMe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function _(n,e,...t){return eA(typeof n=="number"?rge(n,e):e,t)}function rge(n,e){var i;const t=(i=oge())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function ie(n,e,...t){let i;typeof n=="number"?i=rge(n,e):i=e;const s=eA(i,t);return{value:s,original:e===i?s:eA(e,t)}}const sv="en";let JE=!1,eI=!1,ck=!1,age=!1,LG=!1,kG=!1,lge=!1,TT,yR=sv,Hte=sv,BMe,hd;const ng=globalThis;let Bo;var Mce;typeof ng.vscode<"u"&&typeof ng.vscode.process<"u"?Bo=ng.vscode.process:typeof process<"u"&&typeof((Mce=process==null?void 0:process.versions)==null?void 0:Mce.node)=="string"&&(Bo=process);var Ace;const WMe=typeof((Ace=Bo==null?void 0:Bo.versions)==null?void 0:Ace.electron)=="string",HMe=WMe&&(Bo==null?void 0:Bo.type)==="renderer";var Pce;if(typeof Bo=="object"){JE=Bo.platform==="win32",eI=Bo.platform==="darwin",ck=Bo.platform==="linux",ck&&Bo.env.SNAP&&Bo.env.SNAP_REVISION,Bo.env.CI||Bo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||Bo.env.GITHUB_WORKSPACE,TT=sv,yR=sv;const n=Bo.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);TT=e.userLocale,Hte=e.osLocale,yR=e.resolvedLanguage||sv,BMe=(Pce=e.languagePack)==null?void 0:Pce.translationsConfigFile}catch{}age=!0}else typeof navigator=="object"&&!HMe?(hd=navigator.userAgent,JE=hd.indexOf("Windows")>=0,eI=hd.indexOf("Macintosh")>=0,kG=(hd.indexOf("Macintosh")>=0||hd.indexOf("iPad")>=0||hd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ck=hd.indexOf("Linux")>=0,lge=(hd==null?void 0:hd.indexOf("Mobi"))>=0,LG=!0,yR=xG()||sv,TT=navigator.language.toLowerCase(),Hte=TT):console.error("Unable to resolve platform.");let SR=0;eI?SR=1:JE?SR=3:ck&&(SR=2);const $s=JE,wt=eI,jr=ck,Yd=age,Du=LG,VMe=LG&&typeof ng.importScripts=="function",zMe=VMe?ng.origin:void 0,nc=kG,cge=lge,d7=SR,bu=hd,jMe=yR,$Me=typeof ng.postMessage=="function"&&!ng.importScripts,sD=(()=>{if($Me){const n=[];ng.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),ng.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),ha=eI||kG?2:JE?1:3;let Vte=!0,zte=!1;function dge(){if(!zte){zte=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Vte=new Uint16Array(n.buffer)[0]===513}return Vte}const EG=!!(bu&&bu.indexOf("Chrome")>=0),UMe=!!(bu&&bu.indexOf("Firefox")>=0),qMe=!!(!EG&&bu&&bu.indexOf("Safari")>=0),hge=!!(bu&&bu.indexOf("Edg/")>=0),KMe=!!(bu&&bu.indexOf("Android")>=0);function Y1(n,e){const t=this;let i=!1,s;return function(){return i||(i=!0,s=n.apply(t,arguments)),s}}var Nt;(function(n){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(x){yield x}n.single=s;function o(x){return e(x)?x:s(x)}n.wrap=o;function r(x){return x||t}n.from=r;function*a(x){for(let E=x.length-1;E>=0;E--)yield x[E]}n.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}n.first=c;function d(x,E){let I=0;for(const R of x)if(E(R,I++))return!0;return!1}n.some=d;function h(x,E){let I=0;for(const R of x)if(!E(R,I++))return!1;return!0}n.every=h;function u(x,E){for(const I of x)if(E(I))return I}n.find=u;function*f(x,E){for(const I of x)E(I)&&(yield I)}n.filter=f;function*g(x,E){let I=0;for(const R of x)yield E(R,I++)}n.map=g;function*p(x,E){let I=0;for(const R of x)yield*E(R,I++)}n.flatMap=p;function*m(...x){for(const E of x)XB(E)?yield*E:yield E}n.concat=m;function b(x,E,I){let R=I;for(const M of x)R=E(R,M);return R}n.reduce=b;function v(x){let E=0;for(const I of x)E++;return E}n.length=v;function*w(x,E,I=x.length){for(E<-x.length&&(E=0),E<0&&(E+=x.length),I<0?I+=x.length:I>x.length&&(I=x.length);E1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Hc(...n){return Re(()=>Jt(n))}class GMe{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Re(n){return new GMe(n)}const f4=class f4{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Jt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===G.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?f4.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};f4.DISABLE_DISPOSED_WARNING=!1;let ne=f4;const _Q=class _Q{constructor(){this._store=new ne,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};_Q.None=Object.freeze({dispose(){}});let G=_Q;class Kt{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class YMe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class ZMe{constructor(e){this.object=e}dispose(){}}class T5{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Jt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))==null||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}var Yf;let fs=(Yf=class{constructor(e){this.element=e,this.next=Yf.Undefined,this.prev=Yf.Undefined}},Yf.Undefined=new Yf(void 0),Yf);class Uo{constructor(){this._first=fs.Undefined,this._last=fs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===fs.Undefined}clear(){let e=this._first;for(;e!==fs.Undefined;){const t=e.next;e.prev=fs.Undefined,e.next=fs.Undefined,e=t}this._first=fs.Undefined,this._last=fs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new fs(e);if(this._first===fs.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==fs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==fs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==fs.Undefined&&e.next!==fs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===fs.Undefined&&e.next===fs.Undefined?(this._first=fs.Undefined,this._last=fs.Undefined):e.next===fs.Undefined?(this._last=this._last.prev,this._last.next=fs.Undefined):e.prev===fs.Undefined&&(this._first=this._first.next,this._first.prev=fs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==fs.Undefined;)yield e.element,e=e.next}}const XMe=globalThis.performance.now.bind(globalThis.performance);class xs{static create(e){return new xs(e)}constructor(e){this._now=e===!1?Date.now:XMe,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ve;(function(n){n.None=()=>G.None;function e(A,W){return u(A,()=>{},0,void 0,!0,void 0,W)}n.defer=e;function t(A){return(W,P=null,B)=>{let V=!1,K;return K=A(z=>{if(!V)return K?K.dispose():V=!0,W.call(P,z)},null,B),V&&K.dispose(),K}}n.once=t;function i(A,W){return n.once(n.filter(A,W))}n.onceIf=i;function s(A,W,P){return d((B,V=null,K)=>A(z=>B.call(V,W(z)),null,K),P)}n.map=s;function o(A,W,P){return d((B,V=null,K)=>A(z=>{W(z),B.call(V,z)},null,K),P)}n.forEach=o;function r(A,W,P){return d((B,V=null,K)=>A(z=>W(z)&&B.call(V,z),null,K),P)}n.filter=r;function a(A){return A}n.signal=a;function l(...A){return(W,P=null,B)=>{const V=Hc(...A.map(K=>K(z=>W.call(P,z))));return h(V,B)}}n.any=l;function c(A,W,P,B){let V=P;return s(A,K=>(V=W(V,K),V),B)}n.reduce=c;function d(A,W){let P;const B={onWillAddFirstListener(){P=A(V.fire,V)},onDidRemoveLastListener(){P==null||P.dispose()}},V=new q(B);return W==null||W.add(V),V.event}function h(A,W){return W instanceof Array?W.push(A):W&&W.add(A),A}function u(A,W,P=100,B=!1,V=!1,K,z){let j,Q,Y,te=0,ce;const Ce={leakWarningThreshold:K,onWillAddFirstListener(){j=A(je=>{te++,Q=W(Q,je),B&&!Y&&(xe.fire(Q),Q=void 0),ce=()=>{const ke=Q;Q=void 0,Y=void 0,(!B||te>1)&&xe.fire(ke),te=0},typeof P=="number"?(Y&&clearTimeout(Y),Y=setTimeout(ce,P)):Y===void 0&&(Y=null,queueMicrotask(ce))})},onWillRemoveListener(){V&&te>0&&(ce==null||ce())},onDidRemoveLastListener(){ce=void 0,j.dispose()}},xe=new q(Ce);return z==null||z.add(xe),xe.event}n.debounce=u;function f(A,W=0,P){return n.debounce(A,(B,V)=>B?(B.push(V),B):[V],W,void 0,!0,void 0,P)}n.accumulate=f;function g(A,W=(B,V)=>B===V,P){let B=!0,V;return r(A,K=>{const z=B||!W(K,V);return B=!1,V=K,z},P)}n.latch=g;function p(A,W,P){return[n.filter(A,W,P),n.filter(A,B=>!W(B),P)]}n.split=p;function m(A,W=!1,P=[],B){let V=P.slice(),K=A(Q=>{V?V.push(Q):j.fire(Q)});B&&B.add(K);const z=()=>{V==null||V.forEach(Q=>j.fire(Q)),V=null},j=new q({onWillAddFirstListener(){K||(K=A(Q=>j.fire(Q)),B&&B.add(K))},onDidAddFirstListener(){V&&(W?setTimeout(z):z())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return B&&B.add(j),j.event}n.buffer=m;function b(A,W){return(B,V,K)=>{const z=W(new w);return A(function(j){const Q=z.evaluate(j);Q!==v&&B.call(V,Q)},void 0,K)}}n.chain=b;const v=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(P=>(W(P),P)),this}filter(W){return this.steps.push(P=>W(P)?P:v),this}reduce(W,P){let B=P;return this.steps.push(V=>(B=W(B,V),B)),this}latch(W=(P,B)=>P===B){let P=!0,B;return this.steps.push(V=>{const K=P||!W(V,B);return P=!1,B=V,K?V:v}),this}evaluate(W){for(const P of this.steps)if(W=P(W),W===v)break;return W}}function C(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.on(W,B),K=()=>A.removeListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromNodeEventEmitter=C;function S(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.addEventListener(W,B),K=()=>A.removeEventListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromDOMEventEmitter=S;function L(A,W){let P;const B=new Promise((V,K)=>{const z=t(A)(V,null,W);P=()=>z.dispose()});return B.cancel=P,B}n.toPromise=L;function x(A,W){return A(P=>W.fire(P))}n.forward=x;function E(A,W,P){return W(P),A(B=>W(B))}n.runAndSubscribe=E;class I{constructor(W,P){this._observable=W,this._counter=0,this._hasChanged=!1;const B={onWillAddFirstListener:()=>{W.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new q(B),P&&P.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,P){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(A,W){return new I(A,W).emitter.event}n.fromObservable=R;function M(A){return(W,P,B)=>{let V=0,K=!1;const z={beginUpdate(){V++},endUpdate(){V--,V===0&&(A.reportChanges(),K&&(K=!1,W.call(P)))},handlePossibleChange(){},handleChange(){K=!0}};A.addObserver(z),A.reportChanges();const j={dispose(){A.removeObserver(z)}};return B instanceof ne?B.add(j):Array.isArray(B)&&B.push(j),j}}n.fromObservableLight=M})(ve||(ve={}));const T0=class T0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${T0._idPool++}`,T0.all.add(this)}start(e){this._stopWatch=new xs,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};T0.all=new Set,T0._idPool=0;let eW=T0,QMe=-1;const g4=class g4{constructor(e,t,i=(g4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const yG=new IMe;function XM(n){yG.onUnexpectedError(n)}function Je(n){fl(n)||yG.onUnexpectedError(n)}function On(n){fl(n)||yG.onUnexpectedExternalError(n)}function YB(n){if(n instanceof Error){const{name:e,message:t,cause:i}=n,s=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:s,noTelemetry:iS.isErrorNoTelemetry(n),cause:i?YB(i):void 0,code:n.code}}return n}const QM="Canceled";function fl(n){return n instanceof Ql?!0:n instanceof Error&&n.name===QM&&n.message===QM}class Ql extends Error{constructor(){super(QM),this.name=this.message}}function EMe(){const n=new Error(QM);return n.name=n.message,n}function ql(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function JM(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class NMe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class iS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof iS)return e;const t=new iS;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Ve extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Ve.prototype)}}function c7(n,e){if(!n)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function iD(n,e="Unreachable"){throw new Error(e)}function QI(n,e="unexpected state"){if(!n)throw typeof e=="string"?new Ve(`Assertion Failed: ${e}`):e}function Fte(n,e="Soft Assertion Failed"){n||Je(new Ve(e))}function Xm(n){if(!n()){debugger;n(),Je(new Ve("Assertion Failed"))}}function nD(n,e){let t=0;for(;t"u"}function Ts(n){return!Ol(n)}function Ol(n){return Lo(n)||n===null}function Ft(n,e){if(!n)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function qp(n){return QI(n!=null,"Argument is `undefined` or `null`."),n}function U1(n){return typeof n=="function"}function RMe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?$h(i):i}),e}function AMe(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(Jfe.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!TMe(s)&&e.push(s)}}return n}const Jfe=Object.prototype.hasOwnProperty;function ege(n,e){return QB(n,e,new Set)}function QB(n,e,t){if(Ol(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(QB(o,e,t));return s}if(os(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)Jfe.call(n,o)&&(s[o]=QB(n[o],e,t));return t.delete(n),s}return n}function D5(n,e,t=!0){return os(n)?(os(e)&&Object.keys(e).forEach(i=>{i in n?t&&(os(n[i])&&os(e[i])?D5(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function _a(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t=0;function eA(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),PMe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function _(n,e,...t){return eA(typeof n=="number"?ige(n,e):e,t)}function ige(n,e){var i;const t=(i=tge())==null?void 0:i[n];if(typeof t!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${n} !!!`)}return t}function ie(n,e,...t){let i;typeof n=="number"?i=ige(n,e):i=e;const s=eA(i,t);return{value:s,original:e===i?s:eA(e,t)}}const tv="en";let JI=!1,eE=!1,ck=!1,nge=!1,xG=!1,LG=!1,sge=!1,RT,SR=tv,Bte=tv,OMe,fd;const ng=globalThis;let Wo;var Dce;typeof ng.vscode<"u"&&typeof ng.vscode.process<"u"?Wo=ng.vscode.process:typeof process<"u"&&typeof((Dce=process==null?void 0:process.versions)==null?void 0:Dce.node)=="string"&&(Wo=process);var Tce;const FMe=typeof((Tce=Wo==null?void 0:Wo.versions)==null?void 0:Tce.electron)=="string",BMe=FMe&&(Wo==null?void 0:Wo.type)==="renderer";var Rce;if(typeof Wo=="object"){JI=Wo.platform==="win32",eE=Wo.platform==="darwin",ck=Wo.platform==="linux",ck&&Wo.env.SNAP&&Wo.env.SNAP_REVISION,Wo.env.CI||Wo.env.BUILD_ARTIFACTSTAGINGDIRECTORY||Wo.env.GITHUB_WORKSPACE,RT=tv,SR=tv;const n=Wo.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n);RT=e.userLocale,Bte=e.osLocale,SR=e.resolvedLanguage||tv,OMe=(Rce=e.languagePack)==null?void 0:Rce.translationsConfigFile}catch{}nge=!0}else typeof navigator=="object"&&!BMe?(fd=navigator.userAgent,JI=fd.indexOf("Windows")>=0,eE=fd.indexOf("Macintosh")>=0,LG=(fd.indexOf("Macintosh")>=0||fd.indexOf("iPad")>=0||fd.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ck=fd.indexOf("Linux")>=0,sge=(fd==null?void 0:fd.indexOf("Mobi"))>=0,xG=!0,SR=SG()||tv,RT=navigator.language.toLowerCase(),Bte=RT):console.error("Unable to resolve platform.");let xR=0;eE?xR=1:JI?xR=3:ck&&(xR=2);const $s=JI,yt=eE,Ur=ck,Xd=nge,Tu=xG,WMe=xG&&typeof ng.importScripts=="function",HMe=WMe?ng.origin:void 0,Jl=LG,oge=sge,d7=xR,vu=fd,VMe=SR,zMe=typeof ng.postMessage=="function"&&!ng.importScripts,sD=(()=>{if(zMe){const n=[];ng.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),ng.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),ua=eE||LG?2:JI?1:3;let Wte=!0,Hte=!1;function rge(){if(!Hte){Hte=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,Wte=new Uint16Array(n.buffer)[0]===513}return Wte}const kG=!!(vu&&vu.indexOf("Chrome")>=0),jMe=!!(vu&&vu.indexOf("Firefox")>=0),$Me=!!(!kG&&vu&&vu.indexOf("Safari")>=0),age=!!(vu&&vu.indexOf("Edg/")>=0),UMe=!!(vu&&vu.indexOf("Android")>=0);function q1(n,e){const t=this;let i=!1,s;return function(){return i||(i=!0,s=n.apply(t,arguments)),s}}var Dt;(function(n){function e(x){return!!x&&typeof x=="object"&&typeof x[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(x){yield x}n.single=s;function o(x){return e(x)?x:s(x)}n.wrap=o;function r(x){return x||t}n.from=r;function*a(x){for(let I=x.length-1;I>=0;I--)yield x[I]}n.reverse=a;function l(x){return!x||x[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(x){return x[Symbol.iterator]().next().value}n.first=c;function d(x,I){let E=0;for(const R of x)if(I(R,E++))return!0;return!1}n.some=d;function h(x,I){let E=0;for(const R of x)if(!I(R,E++))return!1;return!0}n.every=h;function u(x,I){for(const E of x)if(I(E))return E}n.find=u;function*f(x,I){for(const E of x)I(E)&&(yield E)}n.filter=f;function*g(x,I){let E=0;for(const R of x)yield I(R,E++)}n.map=g;function*p(x,I){let E=0;for(const R of x)yield*I(R,E++)}n.flatMap=p;function*m(...x){for(const I of x)ZB(I)?yield*I:yield I}n.concat=m;function b(x,I,E){let R=E;for(const M of x)R=I(R,M);return R}n.reduce=b;function v(x){let I=0;for(const E of x)I++;return I}n.length=v;function*w(x,I,E=x.length){for(I<-x.length&&(I=0),I<0&&(I+=x.length),E<0?E+=x.length:E>x.length&&(E=x.length);I1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function Vc(...n){return Re(()=>ei(n))}class qMe{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,this._fn()}}}function Re(n){return new qMe(n)}const f4=class f4{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ei(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e||e===G.None)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?f4.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}};f4.DISABLE_DISPOSED_WARNING=!1;let ne=f4;const mQ=class mQ{constructor(){this._store=new ne,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};mQ.None=Object.freeze({dispose(){}});let G=mQ;class Gt{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}}class KMe{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}}class GMe{constructor(e){this.object=e}dispose(){}}class T5{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{ei(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))==null||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))==null||t.dispose(),this._store.delete(e)}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}}var Yf;let gs=(Yf=class{constructor(e){this.element=e,this.next=Yf.Undefined,this.prev=Yf.Undefined}},Yf.Undefined=new Yf(void 0),Yf);class qo{constructor(){this._first=gs.Undefined,this._last=gs.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===gs.Undefined}clear(){let e=this._first;for(;e!==gs.Undefined;){const t=e.next;e.prev=gs.Undefined,e.next=gs.Undefined,e=t}this._first=gs.Undefined,this._last=gs.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new gs(e);if(this._first===gs.Undefined)this._first=i,this._last=i;else if(t){const o=this._last;this._last=i,i.prev=o,o.next=i}else{const o=this._first;this._first=i,i.next=o,o.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==gs.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==gs.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==gs.Undefined&&e.next!==gs.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===gs.Undefined&&e.next===gs.Undefined?(this._first=gs.Undefined,this._last=gs.Undefined):e.next===gs.Undefined?(this._last=this._last.prev,this._last.next=gs.Undefined):e.prev===gs.Undefined&&(this._first=this._first.next,this._first.prev=gs.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==gs.Undefined;)yield e.element,e=e.next}}const YMe=globalThis.performance.now.bind(globalThis.performance);class Ls{static create(e){return new Ls(e)}constructor(e){this._now=e===!1?Date.now:YMe,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ve;(function(n){n.None=()=>G.None;function e(A,W){return u(A,()=>{},0,void 0,!0,void 0,W)}n.defer=e;function t(A){return(W,P=null,B)=>{let V=!1,K;return K=A(z=>{if(!V)return K?K.dispose():V=!0,W.call(P,z)},null,B),V&&K.dispose(),K}}n.once=t;function i(A,W){return n.once(n.filter(A,W))}n.onceIf=i;function s(A,W,P){return d((B,V=null,K)=>A(z=>B.call(V,W(z)),null,K),P)}n.map=s;function o(A,W,P){return d((B,V=null,K)=>A(z=>{W(z),B.call(V,z)},null,K),P)}n.forEach=o;function r(A,W,P){return d((B,V=null,K)=>A(z=>W(z)&&B.call(V,z),null,K),P)}n.filter=r;function a(A){return A}n.signal=a;function l(...A){return(W,P=null,B)=>{const V=Vc(...A.map(K=>K(z=>W.call(P,z))));return h(V,B)}}n.any=l;function c(A,W,P,B){let V=P;return s(A,K=>(V=W(V,K),V),B)}n.reduce=c;function d(A,W){let P;const B={onWillAddFirstListener(){P=A(V.fire,V)},onDidRemoveLastListener(){P==null||P.dispose()}},V=new q(B);return W==null||W.add(V),V.event}function h(A,W){return W instanceof Array?W.push(A):W&&W.add(A),A}function u(A,W,P=100,B=!1,V=!1,K,z){let j,X,Y,te=0,ce;const Ce={leakWarningThreshold:K,onWillAddFirstListener(){j=A(Be=>{te++,X=W(X,Be),B&&!Y&&(xe.fire(X),X=void 0),ce=()=>{const Ee=X;X=void 0,Y=void 0,(!B||te>1)&&xe.fire(Ee),te=0},typeof P=="number"?(Y&&clearTimeout(Y),Y=setTimeout(ce,P)):Y===void 0&&(Y=null,queueMicrotask(ce))})},onWillRemoveListener(){V&&te>0&&(ce==null||ce())},onDidRemoveLastListener(){ce=void 0,j.dispose()}},xe=new q(Ce);return z==null||z.add(xe),xe.event}n.debounce=u;function f(A,W=0,P){return n.debounce(A,(B,V)=>B?(B.push(V),B):[V],W,void 0,!0,void 0,P)}n.accumulate=f;function g(A,W=(B,V)=>B===V,P){let B=!0,V;return r(A,K=>{const z=B||!W(K,V);return B=!1,V=K,z},P)}n.latch=g;function p(A,W,P){return[n.filter(A,W,P),n.filter(A,B=>!W(B),P)]}n.split=p;function m(A,W=!1,P=[],B){let V=P.slice(),K=A(X=>{V?V.push(X):j.fire(X)});B&&B.add(K);const z=()=>{V==null||V.forEach(X=>j.fire(X)),V=null},j=new q({onWillAddFirstListener(){K||(K=A(X=>j.fire(X)),B&&B.add(K))},onDidAddFirstListener(){V&&(W?setTimeout(z):z())},onDidRemoveLastListener(){K&&K.dispose(),K=null}});return B&&B.add(j),j.event}n.buffer=m;function b(A,W){return(B,V,K)=>{const z=W(new w);return A(function(j){const X=z.evaluate(j);X!==v&&B.call(V,X)},void 0,K)}}n.chain=b;const v=Symbol("HaltChainable");class w{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(P=>(W(P),P)),this}filter(W){return this.steps.push(P=>W(P)?P:v),this}reduce(W,P){let B=P;return this.steps.push(V=>(B=W(B,V),B)),this}latch(W=(P,B)=>P===B){let P=!0,B;return this.steps.push(V=>{const K=P||!W(V,B);return P=!1,B=V,K?V:v}),this}evaluate(W){for(const P of this.steps)if(W=P(W),W===v)break;return W}}function C(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.on(W,B),K=()=>A.removeListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromNodeEventEmitter=C;function S(A,W,P=B=>B){const B=(...j)=>z.fire(P(...j)),V=()=>A.addEventListener(W,B),K=()=>A.removeEventListener(W,B),z=new q({onWillAddFirstListener:V,onDidRemoveLastListener:K});return z.event}n.fromDOMEventEmitter=S;function L(A,W){let P;const B=new Promise((V,K)=>{const z=t(A)(V,null,W);P=()=>z.dispose()});return B.cancel=P,B}n.toPromise=L;function x(A,W){return A(P=>W.fire(P))}n.forward=x;function I(A,W,P){return W(P),A(B=>W(B))}n.runAndSubscribe=I;class E{constructor(W,P){this._observable=W,this._counter=0,this._hasChanged=!1;const B={onWillAddFirstListener:()=>{W.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new q(B),P&&P.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,P){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(A,W){return new E(A,W).emitter.event}n.fromObservable=R;function M(A){return(W,P,B)=>{let V=0,K=!1;const z={beginUpdate(){V++},endUpdate(){V--,V===0&&(A.reportChanges(),K&&(K=!1,W.call(P)))},handlePossibleChange(){},handleChange(){K=!0}};A.addObserver(z),A.reportChanges();const j={dispose(){A.removeObserver(z)}};return B instanceof ne?B.add(j):Array.isArray(B)&&B.push(j),j}}n.fromObservableLight=M})(ve||(ve={}));const N0=class N0{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${N0._idPool++}`,N0.all.add(this)}start(e){this._stopWatch=new Ls,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};N0.all=new Set,N0._idPool=0;let JB=N0,ZMe=-1;const g4=class g4{constructor(e,t,i=(g4._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=t,this.name=i,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(const[i,s]of this._stacks)(!e||t{var a,l,c,d,h,u,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);const p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new eAe(`${g}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Je)(m),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));const s=new h7(e);let o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=IG.create(),o=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof h7?(this._deliveryQueue??(this._deliveryQueue=new uge),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=s,(h=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||h.call(d,this)),(f=(u=this._options)==null?void 0:u.onDidAddListener)==null||f.call(u,this),this._size++;const r=Re(()=>{o==null||o(),this._removeListener(s)});return i instanceof ne?i.add(r):Array.isArray(i)&&i.push(r),r}),this._event}_removeListener(e){var o,r,a,l;if((r=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||r.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*tAe<=t.length){let c=0;for(let d=0;d0}};const iAe=()=>new uge;class uge{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Z1 extends q{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Uo,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class fge extends Z1{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class nAe extends q{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class sAe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new q({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Re(Y1(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class oD{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,o,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(o,a)):s.call(o,a);return}const c=l;if(!c){s.call(o,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),s.call(o,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(s=>s()),i}}class Bx{constructor(){this.listening=!1,this.inputEvent=ve.None,this.inputEventListener=G.None,this.emitter=new q({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Vl=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},oAe=wt?1.5:1.35,u7=8;class X1{static _create(e,t,i,s,o,r,a,l,c){r===0?r=oAe*i:r/?";function dAe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iA)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const NG=dAe();function DG(n){let e=NG;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const mge=new Uo;mge.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function tI(n,e,t,i,s){if(e=DG(e),s||(s=Nt.first(mge)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),tI(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const h=hAe(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function hAe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Lh=8;class _ge{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class bge{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class $i{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}class dk{constructor(e,t){this.newValue=e,this.didChange=t}}function R5(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new dk(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Bi(n,e);return new dk(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=R5(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new dk(n,t)}class b_{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return R5(e,t)}validate(e){return this.defaultValue}}class qS{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}function Fe(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class bt extends qS{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return Fe(e,this.defaultValue)}}function xf(n,e,t,i){if(typeof n=="string"&&(n=parseInt(n,10)),typeof n!="number"||isNaN(n))return e;let s=n;return s=Math.max(t,s),s=Math.min(i,s),s|0}class oi extends qS{static clampedInt(e,t,i,s){return xf(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return oi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function uAe(n,e,t,i){if(typeof n>"u")return e;const s=Br.float(n,e);return Br.clamp(s,t,i)}class Br extends qS{static clamp(e,t,i){return ei?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,s,o,r,a){typeof o<"u"&&(o.type="number",o.default=i,o.minimum=r,o.maximum=a),super(e,t,i,o),this.validationFn=s,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(Br.float(e,this.defaultValue))}}class Vo extends qS{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Vo.string(e,this.defaultValue)}}function Di(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class zi extends qS{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s.slice(0),o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Di(e,this.defaultValue,this._allowedValues)}}class Wx extends $i{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function fAe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class gAe extends $i{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_(201,"Use platform APIs to detect when a Screen Reader is attached."),_(202,"Optimize for usage with a Screen Reader."),_(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:_(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class pAe extends $i{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Fe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Fe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function mAe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var ms;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(ms||(ms={}));function jte(n){switch(n){case"line":return ms.Line;case"block":return ms.Block;case"underline":return ms.Underline;case"line-thin":return ms.LineThin;case"block-outline":return ms.BlockOutline;case"underline-thin":return ms.UnderlineThin}}class _Ae extends b_{constructor(){super(162,"")}compute(e,t,i){const s=["monaco-editor"];return t.get(48)&&s.push(t.get(48)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(82)==="default"?s.push("mouse-default"):t.get(82)==="copy"&&s.push("mouse-copy"),t.get(127)&&s.push("showUnused"),t.get(157)&&s.push("showDeprecated"),s.join(" ")}}class bAe extends bt{constructor(){super(45,"emptySelectionClipboard",!0,{description:_(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class vAe extends $i{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_(209,"Never seed search string from the editor selection."),_(210,"Always seed search string from the editor selection, including word at cursor position."),_(211,"Only seed search string from the editor selection.")],description:_(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_(213,"Never turn on Find in Selection automatically (default)."),_(214,"Always turn on Find in Selection automatically."),_(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:wt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(220,"Do not store search history from the find widget."),_(221,"Store search history across the active workspace")],description:_(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(223,"Do not store history from the replace widget."),_(224,"Store replace history across the active workspace")],description:_(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:_(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Fe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Fe(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Di(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Di(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Fe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Fe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Fe(t.loop,this.defaultValue.loop),history:Di(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Di(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}const bf=class bf extends $i{constructor(){super(60,"fontLigatures",bf.OFF,{anyOf:[{type:"boolean",description:_(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?bf.OFF:e==="true"?bf.ON:e:e?bf.ON:bf.OFF}};bf.OFF='"liga" off, "calt" off',bf.ON='"liga" on, "calt" on';let Cg=bf;const vf=class vf extends $i{constructor(){super(63,"fontVariations",vf.OFF,{anyOf:[{type:"boolean",description:_(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:_(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:_(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?vf.OFF:e==="true"?vf.TRANSLATE:e:e?vf.TRANSLATE:vf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};vf.OFF=gge,vf.TRANSLATE=pge;let iW=vf;class wAe extends b_{constructor(){super(59,new tA({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class CAe extends b_{constructor(){super(161,ms.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class yAe extends b_{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class SAe extends b_{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class xAe extends qS{constructor(){super(61,"fontSize",Hr.fontSize,{type:"number",minimum:6,maximum:100,default:Hr.fontSize,description:_(233,"Controls the font size in pixels.")})}validate(e){const t=Br.float(e,this.defaultValue);return t===0?Hr.fontSize:Br.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const Mh=class Mh extends $i{constructor(){super(62,"fontWeight",Hr.fontWeight,{anyOf:[{type:"number",minimum:Mh.MINIMUM_VALUE,maximum:Mh.MAXIMUM_VALUE,errorMessage:_(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Mh.SUGGESTION_VALUES}],default:Hr.fontWeight,description:_(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(oi.clampedInt(e,Hr.fontWeight,Mh.MINIMUM_VALUE,Mh.MAXIMUM_VALUE))}};Mh.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Mh.MINIMUM_VALUE=1,Mh.MAXIMUM_VALUE=1e3;let nW=Mh;class LAe extends $i{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_(236,"Show Peek view of the results (default)"),_(237,"Go to the primary result and show a Peek view"),_(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:_(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:_(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:_(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:_(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:_(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:_(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:_(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:_(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:_(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:_(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Di(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Di(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Di(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Di(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Di(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Di(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Di(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Vo.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Vo.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Vo.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Vo.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Vo.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:Vo.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class kAe extends $i{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:_(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:_(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:_(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),delay:oi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Fe(t.sticky,this.defaultValue.sticky),hidingDelay:oi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Fe(t.above,this.defaultValue.above)}}}class J0 extends b_{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return J0.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,w=e.isViewportWrapping,C=h?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,E=!1,I=C*u,R=u/o,M=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:z,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:Q,desiredRatio:Y,minimapLineCount:te}=J0.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(b/te>1)x=!0,E=!0,u=1,I=1,R=u/o;else{let Ce=!1,xe=u+1;if(g==="fit"){const je=Math.ceil((j+b+Q)*I);w&&a&&v<=t.stableFitRemainingWidth?(Ce=!0,xe=t.stableFitMaxMinimapScale):Ce=je>S}if(g==="fill"||Ce){x=!0;const je=u;I=Math.min(l*o,Math.max(1,Math.floor(1/Y))),w&&a&&v<=t.stableFitRemainingWidth&&(xe=t.stableFitMaxMinimapScale),u=Math.min(xe,Math.max(1,Math.floor(I/C))),u>je&&(M=Math.min(2,u/je)),R=u/o/M,S=Math.ceil(Math.max(z,j+b+Q)*I),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const A=Math.floor(f*R),W=Math.min(A,Math.max(0,Math.floor((v-m-2)*R/(c+R)))+Lh);let P=Math.floor(o*W);const B=P/o;P=Math.floor(P*M);const V=h?1:2,K=p==="left"?0:i-W-m;return{renderMinimap:V,minimapLeft:K,minimapWidth:W,minimapHeightIsEditorHeight:x,minimapIsSampling:E,minimapScale:u,minimapLineHeight:I,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),b=e.get(76).renderType!==0,v=e.get(77),w=e.get(119),C=e.get(96),S=e.get(81),L=e.get(117),x=L.verticalScrollbarSize,E=L.verticalHasArrows,I=L.arrowSize,R=L.horizontalScrollbarSize,M=e.get(52),A=e.get(126)!=="never";let W=e.get(74);M&&A&&(W+=16);let P=0;if(b){const Le=Math.max(r,v);P=Math.round(Le*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let V=0,K=V+B,z=K+P,j=z+W;const Q=i-B-P-W;let Y=!1,te=!1,ce=-1;e.get(2)===2&&u==="inherit"&&p?(Y=!0,te=!0):f==="on"||f==="bounded"?te=!0:f==="wordWrapColumn"&&(ce=g);const Ce=J0._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Q,isViewportWrapping:te},t.memory||new bge);Ce.renderMinimap!==0&&Ce.minimapLeft===0&&(V+=Ce.minimapWidth,K+=Ce.minimapWidth,z+=Ce.minimapWidth,j+=Ce.minimapWidth);const xe=Q-Ce.minimapWidth,je=Math.max(1,Math.floor((xe-x-2)/a)),ke=E?I:0;return te&&(ce=Math.max(1,je),f==="bounded"&&(ce=Math.min(ce,g))),{width:i,height:s,glyphMarginLeft:V,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:P,decorationsLeft:z,decorationsWidth:W,contentLeft:j,contentWidth:xe,minimap:Ce,viewportColumn:je,isWordWrapMinified:Y,isViewportWrapping:te,wrappingColumn:ce,verticalScrollbarWidth:x,horizontalScrollbarHeight:R,overviewRuler:{top:ke,width:x,height:s-2*ke,right:0}}}}class EAe extends $i{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[_(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:_(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Di(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Dc;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Dc||(Dc={}));class IAe extends $i{constructor(){const e={enabled:Dc.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[Dc.Off,Dc.OnCode,Dc.On],default:e.enabled,enumDescriptions:[_(258,"Disable the code action menu."),_(259,"Show the code action menu when the cursor is on lines with code."),_(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:_(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Di(e.enabled,this.defaultValue.enabled,[Dc.Off,Dc.OnCode,Dc.On])}}}class NAe extends $i{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:_(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:_(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:_(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:_(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),maxLineCount:oi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Di(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Fe(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class DAe extends $i{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:_(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[_(267,"Inlay hints are enabled"),_(268,"Inlay hints are showing by default and hide when holding {0}",wt?"Ctrl+Option":"Ctrl+Alt"),_(269,"Inlay hints are hidden by default and show when holding {0}",wt?"Ctrl+Option":"Ctrl+Alt"),_(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:_(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:_(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Di(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:oi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Vo.string(t.fontFamily,this.defaultValue.fontFamily),padding:Fe(t.padding,this.defaultValue.padding),maximumLength:oi.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class TAe extends $i{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):oi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?oi.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class RAe extends Br{constructor(){super(75,"lineHeight",Hr.lineHeight,e=>Br.clamp(e,0,150),{markdownDescription:_(275,`Controls the line height. +`))}}class XMe extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}}class QMe extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}}class h7{constructor(e){this.value=e}}const JMe=2;let q=class{constructor(e){var t,i,s,o;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new eW((e==null?void 0:e.onListenerError)??Je,((i=this._options)==null?void 0:i.leakWarningThreshold)??ZMe):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new JB(this._options._profName):void 0,this._deliveryQueue=(o=this._options)==null?void 0:o.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||i.call(t),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,t,i)=>{var a,l,c,d,h,u,f;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){const g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);const p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],m=new QMe(`${g}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((a=this._options)==null?void 0:a.onListenerError)||Je)(m),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));const s=new h7(e);let o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=IG.create(),o=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof h7?(this._deliveryQueue??(this._deliveryQueue=new lge),this._listeners=[this._listeners,s]):this._listeners.push(s):((c=(l=this._options)==null?void 0:l.onWillAddFirstListener)==null||c.call(l,this),this._listeners=s,(h=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||h.call(d,this)),(f=(u=this._options)==null?void 0:u.onDidAddListener)==null||f.call(u,this),this._size++;const r=Re(()=>{o==null||o(),this._removeListener(s)});return i instanceof ne?i.add(r):Array.isArray(i)&&i.push(r),r}),this._event}_removeListener(e){var o,r,a,l;if((r=(o=this._options)==null?void 0:o.onWillRemoveListener)==null||r.call(o,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(l=(a=this._options)==null?void 0:a.onDidRemoveLastListener)==null||l.call(a,this),this._size=0;return}const t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;const s=this._deliveryQueue.current===this;if(this._size*JMe<=t.length){let c=0;for(let d=0;d0}};const eAe=()=>new lge;class lge{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class K1 extends q{constructor(e){super(e),this._isPaused=0,this._eventQueue=new qo,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class cge extends K1{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class tAe extends q{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class iAe{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new q({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Re(q1(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){var t;(t=e.listener)==null||t.dispose(),e.listener=null}dispose(){var e;this.emitter.dispose();for(const t of this.events)(e=t.listener)==null||e.dispose();this.events=[]}}class oD{constructor(){this.data=[]}wrapEvent(e,t,i){return(s,o,r)=>e(a=>{const l=this.data[this.data.length-1];if(!t){l?l.buffers.push(()=>s.call(o,a)):s.call(o,a);return}const c=l;if(!c){s.call(o,t(i,a));return}c.items??(c.items=[]),c.items.push(a),c.buffers.length===0&&l.buffers.push(()=>{c.reducedResult??(c.reducedResult=i?c.items.reduce(t,i):c.items.reduce(t)),s.call(o,c.reducedResult)})},void 0,r)}bufferEvents(e){const t={buffers:new Array};this.data.push(t);const i=e();return this.data.pop(),t.buffers.forEach(s=>s()),i}}class Bx{constructor(){this.listening=!1,this.inputEvent=ve.None,this.inputEventListener=G.None,this.emitter=new q({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const Fl=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(n){n=Math.min(Math.max(-5,n),20),this._zoomLevel!==n&&(this._zoomLevel=n,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},nAe=yt?1.5:1.35,u7=8;class G1{static _create(e,t,i,s,o,r,a,l,c){r===0?r=nAe*i:r/?";function lAe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of iA)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const EG=lAe();function NG(n){let e=EG;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const uge=new qo;uge.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function tE(n,e,t,i,s){if(e=NG(e),s||(s=Dt.first(uge)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),tE(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const h=cAe(e,t,r,a);if(!h&&l||(l=h,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function cAe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const kh=8;class fge{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class gge{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class ji{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}class dk{constructor(e,t){this.newValue=e,this.didChange=t}}function R5(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new dk(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Fi(n,e);return new dk(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=R5(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new dk(n,t)}class __{constructor(e,t){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=t}applyUpdate(e,t){return R5(e,t)}validate(e){return this.defaultValue}}class $S{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return R5(e,t)}compute(e,t,i){return i}}function Fe(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class vt extends $S{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return Fe(e,this.defaultValue)}}function Lf(n,e,t,i){if(typeof n=="string"&&(n=parseInt(n,10)),typeof n!="number"||isNaN(n))return e;let s=n;return s=Math.max(t,s),s=Math.min(i,s),s|0}class oi extends $S{static clampedInt(e,t,i,s){return Lf(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return oi.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function dAe(n,e,t,i){if(typeof n>"u")return e;const s=Hr.float(n,e);return Hr.clamp(s,t,i)}class Hr extends $S{static clamp(e,t,i){return ei?i:e}static float(e,t){return typeof e=="string"&&(e=parseFloat(e)),typeof e!="number"||isNaN(e)?t:e}constructor(e,t,i,s,o,r,a){typeof o<"u"&&(o.type="number",o.default=i,o.minimum=r,o.maximum=a),super(e,t,i,o),this.validationFn=s,this.minimum=r,this.maximum=a}validate(e){return this.validationFn(Hr.float(e,this.defaultValue))}}class zo extends $S{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return zo.string(e,this.defaultValue)}}function Ei(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class Vi extends $S{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s.slice(0),o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Ei(e,this.defaultValue,this._allowedValues)}}class Wx extends ji{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function hAe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class uAe extends ji{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[_(201,"Use platform APIs to detect when a Screen Reader is attached."),_(202,"Optimize for usage with a Screen Reader."),_(203,"Assume a screen reader is not attached.")],default:"auto",tags:["accessibility"],description:_(204,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class fAe extends ji{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(29,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:_(205,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:_(206,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:Fe(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:Fe(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function gAe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var _s;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(_s||(_s={}));function Vte(n){switch(n){case"line":return _s.Line;case"block":return _s.Block;case"underline":return _s.Underline;case"line-thin":return _s.LineThin;case"block-outline":return _s.BlockOutline;case"underline-thin":return _s.UnderlineThin}}class pAe extends __{constructor(){super(162,"")}compute(e,t,i){const s=["monaco-editor"];return t.get(48)&&s.push(t.get(48)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(82)==="default"?s.push("mouse-default"):t.get(82)==="copy"&&s.push("mouse-copy"),t.get(127)&&s.push("showUnused"),t.get(157)&&s.push("showDeprecated"),s.join(" ")}}class mAe extends vt{constructor(){super(45,"emptySelectionClipboard",!0,{description:_(207,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class _Ae extends ji{constructor(){const e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,history:"workspace",replaceHistory:"workspace"};super(50,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:_(208,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[_(209,"Never seed search string from the editor selection."),_(210,"Always seed search string from the editor selection, including word at cursor position."),_(211,"Only seed search string from the editor selection.")],description:_(212,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[_(213,"Never turn on Find in Selection automatically (default)."),_(214,"Always turn on Find in Selection automatically."),_(215,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:_(216,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:_(217,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:yt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:_(218,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:_(219,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")},"editor.find.history":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(220,"Do not store search history from the find widget."),_(221,"Store search history across the active workspace")],description:_(222,"Controls how the find widget history should be stored")},"editor.find.replaceHistory":{type:"string",enum:["never","workspace"],default:"workspace",enumDescriptions:[_(223,"Do not store history from the replace widget."),_(224,"Store replace history across the active workspace")],description:_(225,"Controls how the replace widget history should be stored")},"editor.find.findOnType":{type:"boolean",default:e.findOnType,description:_(226,"Controls whether the Find Widget should search as you type.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:Fe(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:Fe(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection=="boolean"?t.seedSearchStringFromSelection?"always":"never":Ei(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof t.autoFindInSelection=="boolean"?t.autoFindInSelection?"always":"never":Ei(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:Fe(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:Fe(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:Fe(t.loop,this.defaultValue.loop),history:Ei(t.history,this.defaultValue.history,["never","workspace"]),replaceHistory:Ei(t.replaceHistory,this.defaultValue.replaceHistory,["never","workspace"])}}}const bf=class bf extends ji{constructor(){super(60,"fontLigatures",bf.OFF,{anyOf:[{type:"boolean",description:_(227,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:_(228,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:_(229,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"||e.length===0?bf.OFF:e==="true"?bf.ON:e:e?bf.ON:bf.OFF}};bf.OFF='"liga" off, "calt" off',bf.ON='"liga" on, "calt" on';let Cg=bf;const vf=class vf extends ji{constructor(){super(63,"fontVariations",vf.OFF,{anyOf:[{type:"boolean",description:_(230,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:_(231,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:_(232,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?vf.OFF:e==="true"?vf.TRANSLATE:e:e?vf.TRANSLATE:vf.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}};vf.OFF=dge,vf.TRANSLATE=hge;let tW=vf;class bAe extends __{constructor(){super(59,new tA({pixelRatio:0,fontFamily:"",fontWeight:"",fontSize:0,fontFeatureSettings:"",fontVariationSettings:"",lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,i){return e.fontInfo}}class vAe extends __{constructor(){super(161,_s.Line)}compute(e,t,i){return e.inputMode==="overtype"?t.get(92):t.get(34)}}class wAe extends __{constructor(){super(170,!1)}compute(e,t){return e.editContextSupported&&t.get(44)}}class CAe extends __{constructor(){super(172,!1)}compute(e,t){return e.accessibilitySupport===2?t.get(7):t.get(6)}}class yAe extends $S{constructor(){super(61,"fontSize",zr.fontSize,{type:"number",minimum:6,maximum:100,default:zr.fontSize,description:_(233,"Controls the font size in pixels.")})}validate(e){const t=Hr.float(e,this.defaultValue);return t===0?zr.fontSize:Hr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}const Ah=class Ah extends ji{constructor(){super(62,"fontWeight",zr.fontWeight,{anyOf:[{type:"number",minimum:Ah.MINIMUM_VALUE,maximum:Ah.MAXIMUM_VALUE,errorMessage:_(234,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Ah.SUGGESTION_VALUES}],default:zr.fontWeight,description:_(235,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(oi.clampedInt(e,zr.fontWeight,Ah.MINIMUM_VALUE,Ah.MAXIMUM_VALUE))}};Ah.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],Ah.MINIMUM_VALUE=1,Ah.MAXIMUM_VALUE=1e3;let iW=Ah;class SAe extends ji{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",multipleTests:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:"",alternativeTestsCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[_(236,"Show Peek view of the results (default)"),_(237,"Go to the primary result and show a Peek view"),_(238,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(67,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:_(239,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":{description:_(240,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:_(241,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleDeclarations":{description:_(242,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleImplementations":{description:_(243,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist."),...t},"editor.gotoLocation.multipleReferences":{description:_(244,"Controls the behavior the 'Go to References'-command when multiple target locations exist."),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:_(245,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:_(246,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:_(247,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:_(248,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:_(249,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{multiple:Ei(t.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:Ei(t.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:Ei(t.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:Ei(t.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:Ei(t.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:Ei(t.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),multipleTests:Ei(t.multipleTests,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:zo.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:zo.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:zo.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:zo.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:zo.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:zo.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}}class xAe extends ji{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(69,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:_(250,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:_(251,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:_(252,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,markdownDescription:_(253,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:_(254,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),delay:oi.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:Fe(t.sticky,this.defaultValue.sticky),hidingDelay:oi.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:Fe(t.above,this.defaultValue.above)}}}class X0 extends __{constructor(){super(165,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(e,t,i){return X0.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,h=e.minimap.renderCharacters;let u=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,b=e.viewLineCount,v=e.remainingWidth,w=e.isViewportWrapping,C=h?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,I=!1,E=C*u,R=u/o,M=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:z,extraLinesBeforeFirstLine:j,extraLinesBeyondLastLine:X,desiredRatio:Y,minimapLineCount:te}=X0.computeContainedMinimapLineCount({viewLineCount:b,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(b/te>1)x=!0,I=!0,u=1,E=1,R=u/o;else{let Ce=!1,xe=u+1;if(g==="fit"){const Be=Math.ceil((j+b+X)*E);w&&a&&v<=t.stableFitRemainingWidth?(Ce=!0,xe=t.stableFitMaxMinimapScale):Ce=Be>S}if(g==="fill"||Ce){x=!0;const Be=u;E=Math.min(l*o,Math.max(1,Math.floor(1/Y))),w&&a&&v<=t.stableFitRemainingWidth&&(xe=t.stableFitMaxMinimapScale),u=Math.min(xe,Math.max(1,Math.floor(E/C))),u>Be&&(M=Math.min(2,u/Be)),R=u/o/M,S=Math.ceil(Math.max(z,j+b+X)*E),w?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=v,t.stableFitMaxMinimapScale=u):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const A=Math.floor(f*R),W=Math.min(A,Math.max(0,Math.floor((v-m-2)*R/(c+R)))+kh);let P=Math.floor(o*W);const B=P/o;P=Math.floor(P*M);const V=h?1:2,K=p==="left"?0:i-W-m;return{renderMinimap:V,minimapLeft:K,minimapWidth:W,minimapHeightIsEditorHeight:x,minimapIsSampling:I,minimapScale:u,minimapLineHeight:E,minimapCanvasInnerWidth:P,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:B,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,h=e.get(154),u=h==="inherit"?e.get(153):h,f=u==="inherit"?e.get(149):u,g=e.get(152),p=t.isDominatedByLongLines,m=e.get(66),b=e.get(76).renderType!==0,v=e.get(77),w=e.get(119),C=e.get(96),S=e.get(81),L=e.get(117),x=L.verticalScrollbarSize,I=L.verticalHasArrows,E=L.arrowSize,R=L.horizontalScrollbarSize,M=e.get(52),A=e.get(126)!=="never";let W=e.get(74);M&&A&&(W+=16);let P=0;if(b){const Le=Math.max(r,v);P=Math.round(Le*l)}let B=0;m&&(B=o*t.glyphMarginDecorationLaneCount);let V=0,K=V+B,z=K+P,j=z+W;const X=i-B-P-W;let Y=!1,te=!1,ce=-1;e.get(2)===2&&u==="inherit"&&p?(Y=!0,te=!0):f==="on"||f==="bounded"?te=!0:f==="wordWrapColumn"&&(ce=g);const Ce=X0._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:w,paddingTop:C.top,paddingBottom:C.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:X,isViewportWrapping:te},t.memory||new gge);Ce.renderMinimap!==0&&Ce.minimapLeft===0&&(V+=Ce.minimapWidth,K+=Ce.minimapWidth,z+=Ce.minimapWidth,j+=Ce.minimapWidth);const xe=X-Ce.minimapWidth,Be=Math.max(1,Math.floor((xe-x-2)/a)),Ee=I?E:0;return te&&(ce=Math.max(1,Be),f==="bounded"&&(ce=Math.min(ce,g))),{width:i,height:s,glyphMarginLeft:V,glyphMarginWidth:B,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:K,lineNumbersWidth:P,decorationsLeft:z,decorationsWidth:W,contentLeft:j,contentWidth:xe,minimap:Ce,viewportColumn:Be,isWordWrapMinified:Y,isViewportWrapping:te,wrappingColumn:ce,verticalScrollbarWidth:x,horizontalScrollbarHeight:R,overviewRuler:{top:Ee,width:x,height:s-2*Ee,right:0}}}}class LAe extends ji{constructor(){super(156,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[_(255,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),_(256,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:_(257,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Ei(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}var Tc;(function(n){n.Off="off",n.OnCode="onCode",n.On="on"})(Tc||(Tc={}));class kAe extends ji{constructor(){const e={enabled:Tc.OnCode};super(73,"lightbulb",e,{"editor.lightbulb.enabled":{type:"string",enum:[Tc.Off,Tc.OnCode,Tc.On],default:e.enabled,enumDescriptions:[_(258,"Disable the code action menu."),_(259,"Show the code action menu when the cursor is on lines with code."),_(260,"Show the code action menu when the cursor is on lines with code or on empty lines.")],description:_(261,"Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:Ei(e.enabled,this.defaultValue.enabled,[Tc.Off,Tc.OnCode,Tc.On])}}}class IAe extends ji{constructor(){const e={enabled:!0,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(131,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:_(262,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:20,description:_(263,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:_(264,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:_(265,"Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:Fe(t.enabled,this.defaultValue.enabled),maxLineCount:oi.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:Ei(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:Fe(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class EAe extends ji{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1,maximumLength:43};super(159,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:_(266,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[_(267,"Inlay hints are enabled"),_(268,"Inlay hints are showing by default and hide when holding {0}",yt?"Ctrl+Option":"Ctrl+Alt"),_(269,"Inlay hints are hidden by default and show when holding {0}",yt?"Ctrl+Option":"Ctrl+Alt"),_(270,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:_(271,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:_(272,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:_(273,"Enables the padding around the inlay hints in the editor.")},"editor.inlayHints.maximumLength":{type:"number",default:e.maximumLength,markdownDescription:_(274,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Ei(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:oi.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:zo.string(t.fontFamily,this.defaultValue.fontFamily),padding:Fe(t.padding,this.defaultValue.padding),maximumLength:oi.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,Number.MAX_SAFE_INTEGER)}}}class NAe extends ji{constructor(){super(74,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):oi.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?oi.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class DAe extends Hr{constructor(){super(75,"lineHeight",zr.lineHeight,e=>Hr.clamp(e,0,150),{markdownDescription:_(275,`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,i){return e.fontInfo.lineHeight}}class MAe extends $i{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:"none",renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?-?)\\s*(?
${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),i=e.header?"th":"td";return(e.align?`<${i} align="${e.align}">`:`<${i}>`)+t+` -`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:i}){const s=this.parser.parseInline(i),o=_oe(e);if(o===null)return s;e=o;let r='
",r}image({href:e,title:t,text:i}){const s=_oe(e);if(s===null)return i;e=s;let o=`${i}{const c=a[l].flat(1/0);i=i.concat(this.walkTokens(c,t))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{const s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),i.renderer){const o=this.defaults.renderer||new UI(this.defaults);for(const r in i.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=i.renderer[a],c=o[a];o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h||""}}s.renderer=o}if(i.tokenizer){const o=this.defaults.tokenizer||new hP(this.defaults);for(const r in i.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=i.tokenizer[a],c=o[a];o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h}}s.tokenizer=o}if(i.hooks){const o=this.defaults.hooks||new Mk;for(const r in i.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,l=i.hooks[a],c=o[a];Mk.passThroughHooks.has(r)?o[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(o,d)).then(u=>c.call(o,u));const h=l.call(o,d);return c.call(o,h)}:o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h}}s.hooks=o}if(i.walkTokens){const o=this.defaults.walkTokens,r=i.walkTokens;s.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ru.lex(e,t??this.defaults)}parser(e,t){return au.parse(e,t??this.defaults)}parseMarkdown(e,t){return(s,o)=>{const r={...o},a={...this.defaults,...r},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(s):s).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(s=a.hooks.preprocess(s));let c=e(s,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=t(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const s="

An error occurred:

"+Ol(i.message+"",!0)+"
";return t?Promise.resolve(s):s}if(t)return Promise.reject(i);throw i}}}const dw=new Nbe;function _n(n,e){return dw.parse(n,e)}_n.options=_n.setOptions=function(n){return dw.setOptions(n),_n.defaults=dw.defaults,vbe(_n.defaults),_n};_n.getDefaults=yZ;_n.defaults=Vw;_n.use=function(...n){return dw.use(...n),_n.defaults=dw.defaults,vbe(_n.defaults),_n};_n.walkTokens=function(n,e){return dw.walkTokens(n,e)};_n.parseInline=dw.parseInline;_n.Parser=au;_n.parser=au.parse;_n.Renderer=UI;_n.TextRenderer=IZ;_n.Lexer=ru;_n.lexer=ru.lex;_n.Tokenizer=hP;_n.Hooks=Mk;_n.parse=_n;_n.options;_n.setOptions;_n.use;_n.walkTokens;_n.parseInline;const N$e=_n;au.parse;const qI=ru.lex;function D$e(n){return JSON.stringify(n,T$e)}function lz(n){let e=JSON.parse(n);return e=cz(e),e}function T$e(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function cz(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return He.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof ym||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t2?i-2:0),o=2;o1?t-1:0),s=1;s1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:$R;Coe&&Coe(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const o=t(s);o!==s&&(R$e(e)||(e[i]=o),s=o)}n[s]=!0}return n}function H$e(n){for(let e=0;e/gm),U$e=Gc(/\$\{[\w\W]*/gm),q$e=Gc(/^data-[\-\w.\u00B7-\uFFFF]+$/),K$e=Gc(/^aria-[\-\w]+$/),Rbe=Gc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G$e=Gc(/^(?:\w+script|data):/i),Y$e=Gc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Mbe=Gc(/^html$/i),Z$e=Gc(/^[a-z][.\w]*(-[.\w]+)+$/i);var Eoe=Object.freeze({__proto__:null,ARIA_ATTR:K$e,ATTR_WHITESPACE:Y$e,CUSTOM_ELEMENT:Z$e,DATA_ATTR:q$e,DOCTYPE_NAME:Mbe,ERB_EXPR:$$e,IS_ALLOWED_URI:Rbe,IS_SCRIPT_OR_DATA:G$e,MUSTACHE_EXPR:j$e,TMPLIT_EXPR:U$e});const sL={element:1,text:3,progressingInstruction:7,comment:8,document:9},X$e=function(){return typeof window>"u"?null:window},Q$e=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Ioe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Abe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X$e();const e=Ct=>Abe(Ct);if(e.version="3.2.7",e.removed=[],!n||!n.document||n.document.nodeType!==sL.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=n,g=l.prototype,p=nL(g,"cloneNode"),m=nL(g,"remove"),b=nL(g,"nextSibling"),v=nL(g,"childNodes"),w=nL(g,"parentNode");if(typeof r=="function"){const Ct=t.createElement("template");Ct.content&&Ct.content.ownerDocument&&(t=Ct.content.ownerDocument)}let C,S="";const{implementation:L,createNodeIterator:x,createDocumentFragment:E,getElementsByTagName:I}=t,{importNode:R}=i;let M=Ioe();e.isSupported=typeof Dbe=="function"&&typeof w=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:W,TMPLIT_EXPR:P,DATA_ATTR:B,ARIA_ATTR:V,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:j}=Eoe;let{IS_ALLOWED_URI:Q}=Eoe,Y=null;const te=bi({},[...Soe,...b9,...v9,...w9,...xoe]);let ce=null;const Ce=bi({},[...Loe,...C9,...koe,...f2]);let xe=Object.seal(Tbe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),je=null,ke=null,Le=!0,Ve=!0,ct=!1,dt=!0,Be=!1,tt=!0,Tt=!1,Si=!1,Vt=!1,In=!1,Nn=!1,Os=!1,Da=!0,Mo=!1;const _l="user-content-";let Ta=!0,xr=!1,go={},ei=null;const gn=bi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let bl=null;const Lr=bi({},["audio","video","img","source","image","track"]);let td=null;const vl=bi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ch="http://www.w3.org/1998/Math/MathML",Ks="http://www.w3.org/2000/svg",hs="http://www.w3.org/1999/xhtml";let qn=hs,kr=!1,tn=null;const us=bi({},[ch,Ks,hs],m9);let Xr=bi({},["mi","mo","mn","ms","mtext"]),Dn=bi({},["annotation-xml"]);const Yg=bi({},["title","style","font","a","script"]);let _c=null;const X=["application/xhtml+xml","text/html"],wl="text/html";let Cn=null,Ii=null;const Qr=t.createElement("form"),Qe=function(ae){return ae instanceof RegExp||ae instanceof Function},dh=function(){let ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ii&&Ii===ae)){if((!ae||typeof ae!="object")&&(ae={}),ae=af(ae),_c=X.indexOf(ae.PARSER_MEDIA_TYPE)===-1?wl:ae.PARSER_MEDIA_TYPE,Cn=_c==="application/xhtml+xml"?m9:$R,Y=gd(ae,"ALLOWED_TAGS")?bi({},ae.ALLOWED_TAGS,Cn):te,ce=gd(ae,"ALLOWED_ATTR")?bi({},ae.ALLOWED_ATTR,Cn):Ce,tn=gd(ae,"ALLOWED_NAMESPACES")?bi({},ae.ALLOWED_NAMESPACES,m9):us,td=gd(ae,"ADD_URI_SAFE_ATTR")?bi(af(vl),ae.ADD_URI_SAFE_ATTR,Cn):vl,bl=gd(ae,"ADD_DATA_URI_TAGS")?bi(af(Lr),ae.ADD_DATA_URI_TAGS,Cn):Lr,ei=gd(ae,"FORBID_CONTENTS")?bi({},ae.FORBID_CONTENTS,Cn):gn,je=gd(ae,"FORBID_TAGS")?bi({},ae.FORBID_TAGS,Cn):af({}),ke=gd(ae,"FORBID_ATTR")?bi({},ae.FORBID_ATTR,Cn):af({}),go=gd(ae,"USE_PROFILES")?ae.USE_PROFILES:!1,Le=ae.ALLOW_ARIA_ATTR!==!1,Ve=ae.ALLOW_DATA_ATTR!==!1,ct=ae.ALLOW_UNKNOWN_PROTOCOLS||!1,dt=ae.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Be=ae.SAFE_FOR_TEMPLATES||!1,tt=ae.SAFE_FOR_XML!==!1,Tt=ae.WHOLE_DOCUMENT||!1,In=ae.RETURN_DOM||!1,Nn=ae.RETURN_DOM_FRAGMENT||!1,Os=ae.RETURN_TRUSTED_TYPE||!1,Vt=ae.FORCE_BODY||!1,Da=ae.SANITIZE_DOM!==!1,Mo=ae.SANITIZE_NAMED_PROPS||!1,Ta=ae.KEEP_CONTENT!==!1,xr=ae.IN_PLACE||!1,Q=ae.ALLOWED_URI_REGEXP||Rbe,qn=ae.NAMESPACE||hs,Xr=ae.MATHML_TEXT_INTEGRATION_POINTS||Xr,Dn=ae.HTML_INTEGRATION_POINTS||Dn,xe=ae.CUSTOM_ELEMENT_HANDLING||{},ae.CUSTOM_ELEMENT_HANDLING&&Qe(ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=ae.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&Qe(ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=ae.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ae.CUSTOM_ELEMENT_HANDLING&&typeof ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=ae.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Be&&(Ve=!1),Nn&&(In=!0),go&&(Y=bi({},xoe),ce=[],go.html===!0&&(bi(Y,Soe),bi(ce,Loe)),go.svg===!0&&(bi(Y,b9),bi(ce,C9),bi(ce,f2)),go.svgFilters===!0&&(bi(Y,v9),bi(ce,C9),bi(ce,f2)),go.mathMl===!0&&(bi(Y,w9),bi(ce,koe),bi(ce,f2))),ae.ADD_TAGS&&(Y===te&&(Y=af(Y)),bi(Y,ae.ADD_TAGS,Cn)),ae.ADD_ATTR&&(ce===Ce&&(ce=af(ce)),bi(ce,ae.ADD_ATTR,Cn)),ae.ADD_URI_SAFE_ATTR&&bi(td,ae.ADD_URI_SAFE_ATTR,Cn),ae.FORBID_CONTENTS&&(ei===gn&&(ei=af(ei)),bi(ei,ae.FORBID_CONTENTS,Cn)),Ta&&(Y["#text"]=!0),Tt&&bi(Y,["html","head","body"]),Y.table&&(bi(Y,["tbody"]),delete je.tbody),ae.TRUSTED_TYPES_POLICY){if(typeof ae.TRUSTED_TYPES_POLICY.createHTML!="function")throw iL('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ae.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw iL('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=ae.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=Q$e(f,s)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));ya&&ya(ae),Ii=ae}},fi=bi({},[...b9,...v9,...V$e]),gi=bi({},[...w9,...z$e]),Ra=function(ae){let Ee=w(ae);(!Ee||!Ee.tagName)&&(Ee={namespaceURI:qn,tagName:"template"});const rt=$R(ae.tagName),Et=$R(Ee.tagName);return tn[ae.namespaceURI]?ae.namespaceURI===Ks?Ee.namespaceURI===hs?rt==="svg":Ee.namespaceURI===ch?rt==="svg"&&(Et==="annotation-xml"||Xr[Et]):!!fi[rt]:ae.namespaceURI===ch?Ee.namespaceURI===hs?rt==="math":Ee.namespaceURI===Ks?rt==="math"&&Dn[Et]:!!gi[rt]:ae.namespaceURI===hs?Ee.namespaceURI===Ks&&!Dn[Et]||Ee.namespaceURI===ch&&!Xr[Et]?!1:!gi[rt]&&(Yg[rt]||!fi[rt]):!!(_c==="application/xhtml+xml"&&tn[ae.namespaceURI]):!1},Jo=function(ae){eL(e.removed,{element:ae});try{w(ae).removeChild(ae)}catch{m(ae)}},po=function(ae,Ee){try{eL(e.removed,{attribute:Ee.getAttributeNode(ae),from:Ee})}catch{eL(e.removed,{attribute:null,from:Ee})}if(Ee.removeAttribute(ae),ae==="is")if(In||Nn)try{Jo(Ee)}catch{}else try{Ee.setAttribute(ae,"")}catch{}},er=function(ae){let Ee=null,rt=null;if(Vt)ae=""+ae;else{const li=_9(ae,/^[\r\n\t ]+/);rt=li&&li[0]}_c==="application/xhtml+xml"&&qn===hs&&(ae=''+ae+"");const Et=C?C.createHTML(ae):ae;if(qn===hs)try{Ee=new u().parseFromString(Et,_c)}catch{}if(!Ee||!Ee.documentElement){Ee=L.createDocument(qn,"template",null);try{Ee.documentElement.innerHTML=kr?S:Et}catch{}}const Rn=Ee.body||Ee.documentElement;return ae&&rt&&Rn.insertBefore(t.createTextNode(rt),Rn.childNodes[0]||null),qn===hs?I.call(Ee,Tt?"html":"body")[0]:Tt?Ee.documentElement:Rn},id=function(ae){return x.call(ae.ownerDocument||ae,ae,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Tn=function(ae){return ae instanceof h&&(typeof ae.nodeName!="string"||typeof ae.textContent!="string"||typeof ae.removeChild!="function"||!(ae.attributes instanceof d)||typeof ae.removeAttribute!="function"||typeof ae.setAttribute!="function"||typeof ae.namespaceURI!="string"||typeof ae.insertBefore!="function"||typeof ae.hasChildNodes!="function")},Er=function(ae){return typeof a=="function"&&ae instanceof a};function mo(Ct,ae,Ee){u2(Ct,rt=>{rt.call(e,ae,Ee,Ii)})}const Wu=function(ae){let Ee=null;if(mo(M.beforeSanitizeElements,ae,null),Tn(ae))return Jo(ae),!0;const rt=Cn(ae.nodeName);if(mo(M.uponSanitizeElement,ae,{tagName:rt,allowedTags:Y}),tt&&ae.hasChildNodes()&&!Er(ae.firstElementChild)&&ia(/<[/\w!]/g,ae.innerHTML)&&ia(/<[/\w!]/g,ae.textContent)||ae.nodeType===sL.progressingInstruction||tt&&ae.nodeType===sL.comment&&ia(/<[/\w]/g,ae.data))return Jo(ae),!0;if(!Y[rt]||je[rt]){if(!je[rt]&&nd(rt)&&(xe.tagNameCheck instanceof RegExp&&ia(xe.tagNameCheck,rt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(rt)))return!1;if(Ta&&!ei[rt]){const Et=w(ae)||ae.parentNode,Rn=v(ae)||ae.childNodes;if(Rn&&Et){const li=Rn.length;for(let Ls=li-1;Ls>=0;--Ls){const ks=p(Rn[Ls],!0);ks.__removalCount=(ae.__removalCount||0)+1,Et.insertBefore(ks,b(ae))}}}return Jo(ae),!0}return ae instanceof l&&!Ra(ae)||(rt==="noscript"||rt==="noembed"||rt==="noframes")&&ia(/<\/no(script|embed|frames)/i,ae.innerHTML)?(Jo(ae),!0):(Be&&ae.nodeType===sL.text&&(Ee=ae.textContent,u2([A,W,P],Et=>{Ee=tL(Ee,Et," ")}),ae.textContent!==Ee&&(eL(e.removed,{element:ae.cloneNode()}),ae.textContent=Ee)),mo(M.afterSanitizeElements,ae,null),!1)},Hn=function(ae,Ee,rt){if(Da&&(Ee==="id"||Ee==="name")&&(rt in t||rt in Qr))return!1;if(!(Ve&&!ke[Ee]&&ia(B,Ee))){if(!(Le&&ia(V,Ee))){if(!ce[Ee]||ke[Ee]){if(!(nd(ae)&&(xe.tagNameCheck instanceof RegExp&&ia(xe.tagNameCheck,ae)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(ae))&&(xe.attributeNameCheck instanceof RegExp&&ia(xe.attributeNameCheck,Ee)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(Ee,ae))||Ee==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&ia(xe.tagNameCheck,rt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(rt))))return!1}else if(!td[Ee]){if(!ia(Q,tL(rt,z,""))){if(!((Ee==="src"||Ee==="xlink:href"||Ee==="href")&&ae!=="script"&&F$e(rt,"data:")===0&&bl[ae])){if(!(ct&&!ia(K,tL(rt,z,"")))){if(rt)return!1}}}}}}return!0},nd=function(ae){return ae!=="annotation-xml"&&_9(ae,j)},hh=function(ae){mo(M.beforeSanitizeAttributes,ae,null);const{attributes:Ee}=ae;if(!Ee||Tn(ae))return;const rt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0};let Et=Ee.length;for(;Et--;){const Rn=Ee[Et],{name:li,namespaceURI:Ls,value:ks}=Rn,Ir=Cn(li),Hu=ks;let Qn=li==="value"?Hu:B$e(Hu);if(rt.attrName=Ir,rt.attrValue=Qn,rt.keepAttr=!0,rt.forceKeepAttr=void 0,mo(M.uponSanitizeAttribute,ae,rt),Qn=rt.attrValue,Mo&&(Ir==="id"||Ir==="name")&&(po(li,ae),Qn=_l+Qn),tt&&ia(/((--!?|])>)|<\/(style|title|textarea)/i,Qn)){po(li,ae);continue}if(Ir==="attributename"&&_9(Qn,"href")){po(li,ae);continue}if(rt.forceKeepAttr)continue;if(!rt.keepAttr){po(li,ae);continue}if(!dt&&ia(/\/>/i,Qn)){po(li,ae);continue}Be&&u2([A,W,P],uh=>{Qn=tL(Qn,uh," ")});const Vu=Cn(ae.nodeName);if(!Hn(Vu,Ir,Qn)){po(li,ae);continue}if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Ls)switch(f.getAttributeType(Vu,Ir)){case"TrustedHTML":{Qn=C.createHTML(Qn);break}case"TrustedScriptURL":{Qn=C.createScriptURL(Qn);break}}if(Qn!==Hu)try{Ls?ae.setAttributeNS(Ls,li,Qn):ae.setAttribute(li,Qn),Tn(ae)?Jo(ae):yoe(e.removed)}catch{po(li,ae)}}mo(M.afterSanitizeAttributes,ae,null)},Zg=function Ct(ae){let Ee=null;const rt=id(ae);for(mo(M.beforeSanitizeShadowDOM,ae,null);Ee=rt.nextNode();)mo(M.uponSanitizeShadowNode,Ee,null),Wu(Ee),hh(Ee),Ee.content instanceof o&&Ct(Ee.content);mo(M.afterSanitizeShadowDOM,ae,null)};return e.sanitize=function(Ct){let ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ee=null,rt=null,Et=null,Rn=null;if(kr=!Ct,kr&&(Ct=""),typeof Ct!="string"&&!Er(Ct))if(typeof Ct.toString=="function"){if(Ct=Ct.toString(),typeof Ct!="string")throw iL("dirty is not a string, aborting")}else throw iL("toString is not a function");if(!e.isSupported)return Ct;if(Si||dh(ae),e.removed=[],typeof Ct=="string"&&(xr=!1),xr){if(Ct.nodeName){const ks=Cn(Ct.nodeName);if(!Y[ks]||je[ks])throw iL("root node is forbidden and cannot be sanitized in-place")}}else if(Ct instanceof a)Ee=er(""),rt=Ee.ownerDocument.importNode(Ct,!0),rt.nodeType===sL.element&&rt.nodeName==="BODY"||rt.nodeName==="HTML"?Ee=rt:Ee.appendChild(rt);else{if(!In&&!Be&&!Tt&&Ct.indexOf("<")===-1)return C&&Os?C.createHTML(Ct):Ct;if(Ee=er(Ct),!Ee)return In?null:Os?S:""}Ee&&Vt&&Jo(Ee.firstChild);const li=id(xr?Ct:Ee);for(;Et=li.nextNode();)Wu(Et),hh(Et),Et.content instanceof o&&Zg(Et.content);if(xr)return Ct;if(In){if(Nn)for(Rn=E.call(Ee.ownerDocument);Ee.firstChild;)Rn.appendChild(Ee.firstChild);else Rn=Ee;return(ce.shadowroot||ce.shadowrootmode)&&(Rn=R.call(i,Rn,!0)),Rn}let Ls=Tt?Ee.outerHTML:Ee.innerHTML;return Tt&&Y["!doctype"]&&Ee.ownerDocument&&Ee.ownerDocument.doctype&&Ee.ownerDocument.doctype.name&&ia(Mbe,Ee.ownerDocument.doctype.name)&&(Ls=" -`+Ls),Be&&u2([A,W,P],ks=>{Ls=tL(Ls,ks," ")}),C&&Os?C.createHTML(Ls):Ls},e.setConfig=function(){let Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};dh(Ct),Si=!0},e.clearConfig=function(){Ii=null,Si=!1},e.isValidAttribute=function(Ct,ae,Ee){Ii||dh({});const rt=Cn(Ct),Et=Cn(ae);return Hn(rt,Et,Ee)},e.addHook=function(Ct,ae){typeof ae=="function"&&eL(M[Ct],ae)},e.removeHook=function(Ct,ae){if(ae!==void 0){const Ee=P$e(M[Ct],ae);return Ee===-1?void 0:O$e(M[Ct],Ee,1)[0]}return yoe(M[Ct])},e.removeHooks=function(Ct){M[Ct]=[]},e.removeAllHooks=function(){M=Ioe()},e}var OC=Abe();const Pbe=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),Obe=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),y9="vscode-relative-path";function Noe(n,e){if(e.override==="*")return!0;try{const t=new URL(n,y9+"://");return!!(e.override.includes(t.protocol.replace(/:$/,""))||e.allowRelativePaths&&t.protocol===y9+":"&&!n.trim().toLowerCase().startsWith(y9))}catch{return!1}}function J$e(n,e){OC.addHook("afterSanitizeAttributes",t=>{for(const i of["href","src"])if(t.hasAttribute(i)){const s=t.getAttribute(i);i==="href"?!s.startsWith("#")&&!Noe(s,n)&&t.removeAttribute(i):Noe(s,e)||t.removeAttribute(i)}})}const eUe=Object.freeze({ALLOWED_TAGS:[...Pbe],ALLOWED_ATTR:[...Obe],ALLOW_UNKNOWN_PROTOCOLS:!0});function tUe(n,e){return Fbe(n,e,"trusted")}function Fbe(n,e,t){var i,s;try{const o={...eUe};e!=null&&e.allowedTags&&(e.allowedTags.override&&(o.ALLOWED_TAGS=[...e.allowedTags.override]),e.allowedTags.augment&&(o.ALLOWED_TAGS=[...o.ALLOWED_TAGS??[],...e.allowedTags.augment]));let r=[...Obe];e!=null&&e.allowedAttributes&&(e.allowedAttributes.override&&(r=[...e.allowedAttributes.override]),e.allowedAttributes.augment&&(r=[...r,...e.allowedAttributes.augment])),r=r.map(c=>typeof c=="string"?c.toLowerCase():{attributeName:c.attributeName.toLowerCase(),shouldKeep:c.shouldKeep});const a=new Set(r.map(c=>typeof c=="string"?c:c.attributeName)),l=new Map;for(const c of r)typeof c=="string"?l.delete(c):l.set(c.attributeName,c);return o.ALLOWED_ATTR=Array.from(a),J$e({override:((i=e==null?void 0:e.allowedLinkProtocols)==null?void 0:i.override)??[Ge.http,Ge.https],allowRelativePaths:(e==null?void 0:e.allowRelativeLinkPaths)??!1},{override:((s=e==null?void 0:e.allowedMediaProtocols)==null?void 0:s.override)??[Ge.http,Ge.https],allowRelativePaths:(e==null?void 0:e.allowRelativeMediaPaths)??!1}),e!=null&&e.replaceWithPlaintext&&OC.addHook("uponSanitizeElement",nUe),l.size&&OC.addHook("uponSanitizeAttribute",(c,d)=>{const h=l.get(d.attrName);if(h){const u=h.shouldKeep(c,d);typeof u=="string"?(d.keepAttr=!0,d.attrValue=u):d.keepAttr=u}else d.keepAttr=a.has(d.attrName)}),t==="dom"?OC.sanitize(n,{...o,RETURN_DOM_FRAGMENT:!0}):OC.sanitize(n,{...o,RETURN_TRUSTED_TYPE:!0})}finally{OC.removeAllHooks()}}const iUe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],nUe=(n,e,t)=>{var i,s;if(!e.allowedTags[e.tagName]&&e.tagName!=="body"){const o=Bbe(n);o&&(n.nodeType===Node.COMMENT_NODE?(i=n.parentElement)==null||i.insertBefore(o,n):(s=n.parentElement)==null||s.replaceChild(o,n))}};function Bbe(n){if(!n.ownerDocument)return;let e,t;if(n.nodeType===Node.COMMENT_NODE)e=``;else if(n instanceof Element){const r=n.tagName.toLowerCase(),a=iUe.includes(r),l=n.attributes.length?" "+Array.from(n.attributes).map(c=>`${c.name}="${c.value}"`).join(" "):"";e=`<${r}${l}>`,a||(t=``)}else return;const i=document.createDocumentFragment(),s=n.ownerDocument.createTextNode(e);for(i.appendChild(s);n.firstChild;)i.appendChild(n.firstChild);const o=t?n.ownerDocument.createTextNode(t):void 0;return o&&i.appendChild(o),i}function Wbe(n,e,t){const i=Fbe(e,t,"dom");ys(n,i)}const sUe=new RegExp(`(\\\\)?\\$\\((${Ue.iconNameExpression}(?:${Ue.iconModifierExpression})?)\\)`,"g");function Lm(n){const e=new Array;let t,i=0,s=0;for(;(t=sUe.exec(n))!==null;){s=t.index||0,i{let i=[],s=[];return n&&({href:n,dimensions:i}=Zje(n),s.push(`src="${d2(n)}"`)),t&&s.push(`alt="${d2(t)}"`),e&&s.push(`title="${d2(e)}"`),i.length&&(s=s.concat(i)),""},paragraph({tokens:n}){return`

${this.parser.parseInline(n)}

`},link({href:n,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof n!="string"?"":(n===i&&(i=p9(i)),e=typeof e=="string"?d2(p9(e)):"",n=p9(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${i}`)}});function oUe(n){return function(e){const{tokens:t}=e,i=t[0];if((i==null?void 0:i.type)!=="paragraph")return n.call(this,e);const s=i.tokens;if(!s||s.length===0)return n.call(this,e);const o=s[0];if((o==null?void 0:o.type)!=="text")return n.call(this,e);const r=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=o.raw.match(r);if(!a)return n.call(this,e);o.raw=o.raw.replace(r,""),o.text=o.text.replace(r,"");const l={note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"},c=a[1],d=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase(),h=c.toLowerCase(),u=eh({id:l[h]}).outerHTML,f=this.parser.parse(t);return`

${u}${d}${f.substring(3)}

-`}}function ED(n,e={},t){var g,p,m;const i=new ne;let s=!1;const o=new Nbe(...e.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=aUe(o,e,n),c=lUe(n);let d;if(e.fillInIncompleteTokens){const b={...o.defaults,...e.markedOptions,renderer:r},v=o.lexer(c,b),w=CUe(v);d=o.parser(w,b)}else d=o.parse(c,{...e==null?void 0:e.markedOptions,renderer:r,async:!1});n.supportThemeIcons&&(d=Lm(d).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const h=document.createElement("div"),u=Hbe(n,e.sanitizerConfig??{});Wbe(h,d,u),rUe(n,e,h);let f;if(t?(f=t,ys(t,...h.children)):f=h,a.length>0)Promise.all(a).then(b=>{var C;if(s)return;const v=new Map(b),w=f.querySelectorAll("div[data-code]");for(const S of w){const L=v.get(S.dataset.code??"");L&&ys(S,L)}(C=e.asyncRenderCallback)==null||C.call(e)});else if(l.length>0){const b=new Map(l),v=f.querySelectorAll("div[data-code]");for(const w of v){const C=b.get(w.dataset.code??"");C&&ys(w,C)}}if(e.asyncRenderCallback)for(const b of f.getElementsByTagName("img")){const v=i.add(J(b,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}if(e.actionHandler){const b=v=>{const w=new ao(Oe(f),v);!w.leftButton&&!w.middleButton||Doe(n,e,w)};i.add(J(f,"click",b)),i.add(J(f,"auxclick",b)),i.add(J(f,"keydown",v=>{const w=new ui(v);!w.equals(10)&&!w.equals(3)||Doe(n,e,w)}))}for(const b of[...f.getElementsByTagName("input")])if(((g=b.attributes.getNamedItem("type"))==null?void 0:g.value)==="checkbox")b.setAttribute("disabled","");else if((p=e.sanitizerConfig)!=null&&p.replaceWithPlaintext){const v=Bbe(b);v?(m=b.parentElement)==null||m.replaceChild(v,b):b.remove()}else b.remove();return{element:f,dispose:()=>{s=!0,i.dispose()}}}function rUe(n,e,t){var i;for(const s of t.querySelectorAll("img, audio, video, source")){const o=s.getAttribute("src");if(o){let r=o;try{n.baseUri&&(r=uz(He.from(n.baseUri),r))}catch{}if(s.setAttribute("src",Toe(n,r,!0)),(i=e.sanitizerConfig)!=null&&i.remoteImageIsAllowed){const a=He.parse(r);a.scheme!==Ge.file&&a.scheme!==Ge.data&&!e.sanitizerConfig.remoteImageIsAllowed(a)&&s.replaceWith(me("",void 0,s.outerHTML))}}}for(const s of t.querySelectorAll("a")){const o=s.getAttribute("href");if(s.setAttribute("href",""),!o||/^data:|javascript:/i.test(o)||/^command:/i.test(o)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(o))s.replaceWith(...s.childNodes);else{let r=Toe(n,o,!1);n.baseUri&&(r=uz(He.from(n.baseUri),o)),s.dataset.href=r}}}function aUe(n,e,t){const i=new n.Renderer(e.markedOptions);i.image=S9.image,i.link=S9.link,i.paragraph=S9.paragraph,t.supportAlertSyntax&&(i.blockquote=oUe(i.blockquote));const s=[],o=[];return e.codeBlockRendererSync?i.code=({text:r,lang:a,raw:l})=>{const c=rz.nextId(),d=e.codeBlockRendererSync(Roe(a),r,l);return o.push([c,d]),`
${Vc(r)}
`}:e.codeBlockRenderer&&(i.code=({text:r,lang:a})=>{const l=rz.nextId(),c=e.codeBlockRenderer(Roe(a),r);return s.push(c.then(d=>[l,d])),`
${Vc(r)}
`}),t.supportHtml||(i.html=({text:r})=>{var l;return(l=e.sanitizerConfig)!=null&&l.replaceWithPlaintext?Vc(r):(t.isTrusted?r.match(/^(]+>)|(<\/\s*span>)$/):void 0)?r:""}),{renderer:i,codeBlocks:s,syncCodeBlocks:o}}function lUe(n){let e=n.value;return e.length>1e5&&(e=`${e.substr(0,1e5)}…`),n.supportThemeIcons&&(e=Uje(e)),e}function Doe(n,e,t){var s;const i=t.target.closest("a[data-href]");if(hn(i))try{let o=i.dataset.href;o&&(n.baseUri&&(o=uz(He.from(n.baseUri),o)),(s=e.actionHandler)==null||s.call(e,o,n))}catch(o){Je(o)}finally{t.preventDefault()}}function cUe(n,e){let t;try{t=lz(decodeURIComponent(e))}catch{}return t?(t=sge(t,i=>{if(n.uris&&n.uris[i])return He.revive(n.uris[i])}),encodeURIComponent(JSON.stringify(t))):e}function Toe(n,e,t){const i=n.uris&&n.uris[e];let s=He.revive(i);return t?e.startsWith(Ge.data+":")?e:(s||(s=He.parse(e)),qge.uriToBrowserUri(s).toString(!0)):!s||He.parse(e).toString()===s.toString()?e:(s.query&&(s=s.with({query:cUe(n,s.query)})),s.toString())}function Roe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function uz(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?Lie(n,e).toString():Lie(X5(n),e).toString()}function dUe(n,e,t={}){const i=Hbe(e,t);return tUe(n,i)}const hUe=Object.freeze([...Pbe,"input"]),uUe=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(n,e)=>n.tagName==="SPAN"&&e.attrName==="style"?/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(e.attrValue):!1},{attributeName:"class",shouldKeep:(n,e)=>n.tagName==="SPAN"&&e.attrName==="class"?/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue):!1}]);function Hbe(n,e){var s,o,r;const t=n.isTrusted??!1,i=[Ge.http,Ge.https,Ge.mailto,Ge.file,Ge.vscodeFileResource,Ge.vscodeRemote,Ge.vscodeRemoteResource,Ge.vscodeNotebookCell];return t&&i.push(Ge.command),(s=e.allowedLinkSchemes)!=null&&s.augment&&i.push(...e.allowedLinkSchemes.augment),{allowedTags:{override:((o=e.allowedTags)==null?void 0:o.override)??hUe},allowedAttributes:{override:((r=e.allowedAttributes)==null?void 0:r.override)??uUe},allowedLinkProtocols:{override:i},allowRelativeLinkPaths:!!n.baseUri,allowedMediaProtocols:{override:[Ge.http,Ge.https,Ge.data,Ge.file,Ge.vscodeFileResource,Ge.vscodeRemote,Ge.vscodeRemoteResource]},allowRelativeMediaPaths:!!n.baseUri,replaceWithPlaintext:e.replaceWithPlaintext}}function fUe(n,e){if(typeof n=="string")return n;let t=n.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=N$e(t,{async:!1,renderer:pUe.value});return dUe(i,{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,s=>gUe.get(s)??s).trim()}const gUe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function Vbe(){const n=new UI;return n.code=({text:e})=>Vc(e),n.blockquote=({text:e})=>e+` +`}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:i}){const s=this.parser.parseInline(i),o=poe(e);if(o===null)return s;e=o;let r='",r}image({href:e,title:t,text:i}){const s=poe(e);if(s===null)return i;e=s;let o=`${i}{const c=a[l].flat(1/0);i=i.concat(this.walkTokens(c,t))}):a.tokens&&(i=i.concat(this.walkTokens(a.tokens,t)))}}return i}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(i=>{const s={...i};if(s.async=this.defaults.async||s.async||!1,i.extensions&&(i.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=r.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),s.extensions=t),i.renderer){const o=this.defaults.renderer||new UE(this.defaults);for(const r in i.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const a=r,l=i.renderer[a],c=o[a];o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h||""}}s.renderer=o}if(i.tokenizer){const o=this.defaults.tokenizer||new hP(this.defaults);for(const r in i.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const a=r,l=i.tokenizer[a],c=o[a];o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h}}s.tokenizer=o}if(i.hooks){const o=this.defaults.hooks||new Mk;for(const r in i.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(r==="options")continue;const a=r,l=i.hooks[a],c=o[a];Mk.passThroughHooks.has(r)?o[a]=d=>{if(this.defaults.async)return Promise.resolve(l.call(o,d)).then(u=>c.call(o,u));const h=l.call(o,d);return c.call(o,h)}:o[a]=(...d)=>{let h=l.apply(o,d);return h===!1&&(h=c.apply(o,d)),h}}s.hooks=o}if(i.walkTokens){const o=this.defaults.walkTokens,r=i.walkTokens;s.walkTokens=function(a){let l=[];return l.push(r.call(this,a)),o&&(l=l.concat(o.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return au.lex(e,t??this.defaults)}parser(e,t){return lu.parse(e,t??this.defaults)}parseMarkdown(e,t){return(s,o)=>{const r={...o},a={...this.defaults,...r},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&r.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(s):s).then(c=>e(c,a)).then(c=>a.hooks?a.hooks.processAllTokens(c):c).then(c=>a.walkTokens?Promise.all(this.walkTokens(c,a.walkTokens)).then(()=>c):c).then(c=>t(c,a)).then(c=>a.hooks?a.hooks.postprocess(c):c).catch(l);try{a.hooks&&(s=a.hooks.preprocess(s));let c=e(s,a);a.hooks&&(c=a.hooks.processAllTokens(c)),a.walkTokens&&this.walkTokens(c,a.walkTokens);let d=t(c,a);return a.hooks&&(d=a.hooks.postprocess(d)),d}catch(c){return l(c)}}}onError(e,t){return i=>{if(i.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const s="

An error occurred:

"+Rl(i.message+"",!0)+"
";return t?Promise.resolve(s):s}if(t)return Promise.reject(i);throw i}}}const aw=new Lbe;function _n(n,e){return aw.parse(n,e)}_n.options=_n.setOptions=function(n){return aw.setOptions(n),_n.defaults=aw.defaults,pbe(_n.defaults),_n};_n.getDefaults=CZ;_n.defaults=Bw;_n.use=function(...n){return aw.use(...n),_n.defaults=aw.defaults,pbe(_n.defaults),_n};_n.walkTokens=function(n,e){return aw.walkTokens(n,e)};_n.parseInline=aw.parseInline;_n.Parser=lu;_n.parser=lu.parse;_n.Renderer=UE;_n.TextRenderer=IZ;_n.Lexer=au;_n.lexer=au.lex;_n.Tokenizer=hP;_n.Hooks=Mk;_n.parse=_n;_n.options;_n.setOptions;_n.use;_n.walkTokens;_n.parseInline;const I$e=_n;lu.parse;const qE=au.lex;function E$e(n){return JSON.stringify(n,N$e)}function az(n){let e=JSON.parse(n);return e=lz(e),e}function N$e(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function lz(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return He.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof Cm||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t2?i-2:0),o=2;o1?t-1:0),s=1;s1?t-1:0),s=1;s2&&arguments[2]!==void 0?arguments[2]:UR;voe&&voe(n,null);let i=e.length;for(;i--;){let s=e[i];if(typeof s=="string"){const o=t(s);o!==s&&(D$e(e)||(e[i]=o),s=o)}n[s]=!0}return n}function B$e(n){for(let e=0;e/gm),j$e=Yc(/\$\{[\w\W]*/gm),$$e=Yc(/^data-[\-\w.\u00B7-\uFFFF]+$/),U$e=Yc(/^aria-[\-\w]+$/),Ebe=Yc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),q$e=Yc(/^(?:\w+script|data):/i),K$e=Yc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nbe=Yc(/^html$/i),G$e=Yc(/^[a-z][.\w]*(-[.\w]+)+$/i);var Loe=Object.freeze({__proto__:null,ARIA_ATTR:U$e,ATTR_WHITESPACE:K$e,CUSTOM_ELEMENT:G$e,DATA_ATTR:$$e,DOCTYPE_NAME:Nbe,ERB_EXPR:z$e,IS_ALLOWED_URI:Ebe,IS_SCRIPT_OR_DATA:q$e,MUSTACHE_EXPR:V$e,TMPLIT_EXPR:j$e});const sL={element:1,text:3,progressingInstruction:7,comment:8,document:9},Y$e=function(){return typeof window>"u"?null:window},Z$e=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},koe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Dbe(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Y$e();const e=Qe=>Dbe(Qe);if(e.version="3.2.7",e.removed=[],!n||!n.document||n.document.nodeType!==sL.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const i=t,s=i.currentScript,{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:h,DOMParser:u,trustedTypes:f}=n,g=l.prototype,p=nL(g,"cloneNode"),m=nL(g,"remove"),b=nL(g,"nextSibling"),v=nL(g,"childNodes"),w=nL(g,"parentNode");if(typeof r=="function"){const Qe=t.createElement("template");Qe.content&&Qe.content.ownerDocument&&(t=Qe.content.ownerDocument)}let C,S="";const{implementation:L,createNodeIterator:x,createDocumentFragment:I,getElementsByTagName:E}=t,{importNode:R}=i;let M=koe();e.isSupported=typeof kbe=="function"&&typeof w=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:A,ERB_EXPR:W,TMPLIT_EXPR:P,DATA_ATTR:B,ARIA_ATTR:V,IS_SCRIPT_OR_DATA:K,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:j}=Loe;let{IS_ALLOWED_URI:X}=Loe,Y=null;const te=_i({},[...Coe,...b9,...v9,...w9,...yoe]);let ce=null;const Ce=_i({},[...Soe,...C9,...xoe,...g2]);let xe=Object.seal(Ibe(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Be=null,Ee=null,Le=!0,ze=!0,Ct=!1,ct=!0,Ue=!1,tt=!0,_t=!1,yi=!1,Pt=!1,Cn=!1,Xn=!1,Ks=!1,kr=!0,Ir=!1;const fc="user-content-";let Er=!0,Ta=!1,po={},gn=null;const yn=_i({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let tn=null;const Ra=_i({},["audio","video","img","source","image","track"]);let gc=null;const _l=_i({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),id="http://www.w3.org/1998/Math/MathML",Os="http://www.w3.org/2000/svg",Jr="http://www.w3.org/1999/xhtml";let er=Jr,pc=!1,Mi=null;const Dn=_i({},[id,Os,Jr],m9);let ks=_i({},["mi","mo","mn","ms","mtext"]),Nr=_i({},["annotation-xml"]);const nd=_i({},["title","style","font","a","script"]);let Dr=null;const fs=["application/xhtml+xml","text/html"],Bn="text/html";let Sn=null,mc=null;const Q=t.createElement("form"),hh=function(re){return re instanceof RegExp||re instanceof Function},uh=function(){let re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(mc&&mc===re)){if((!re||typeof re!="object")&&(re={}),re=af(re),Dr=fs.indexOf(re.PARSER_MEDIA_TYPE)===-1?Bn:re.PARSER_MEDIA_TYPE,Sn=Dr==="application/xhtml+xml"?m9:UR,Y=md(re,"ALLOWED_TAGS")?_i({},re.ALLOWED_TAGS,Sn):te,ce=md(re,"ALLOWED_ATTR")?_i({},re.ALLOWED_ATTR,Sn):Ce,Mi=md(re,"ALLOWED_NAMESPACES")?_i({},re.ALLOWED_NAMESPACES,m9):Dn,gc=md(re,"ADD_URI_SAFE_ATTR")?_i(af(_l),re.ADD_URI_SAFE_ATTR,Sn):_l,tn=md(re,"ADD_DATA_URI_TAGS")?_i(af(Ra),re.ADD_DATA_URI_TAGS,Sn):Ra,gn=md(re,"FORBID_CONTENTS")?_i({},re.FORBID_CONTENTS,Sn):yn,Be=md(re,"FORBID_TAGS")?_i({},re.FORBID_TAGS,Sn):af({}),Ee=md(re,"FORBID_ATTR")?_i({},re.FORBID_ATTR,Sn):af({}),po=md(re,"USE_PROFILES")?re.USE_PROFILES:!1,Le=re.ALLOW_ARIA_ATTR!==!1,ze=re.ALLOW_DATA_ATTR!==!1,Ct=re.ALLOW_UNKNOWN_PROTOCOLS||!1,ct=re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=re.SAFE_FOR_TEMPLATES||!1,tt=re.SAFE_FOR_XML!==!1,_t=re.WHOLE_DOCUMENT||!1,Cn=re.RETURN_DOM||!1,Xn=re.RETURN_DOM_FRAGMENT||!1,Ks=re.RETURN_TRUSTED_TYPE||!1,Pt=re.FORCE_BODY||!1,kr=re.SANITIZE_DOM!==!1,Ir=re.SANITIZE_NAMED_PROPS||!1,Er=re.KEEP_CONTENT!==!1,Ta=re.IN_PLACE||!1,X=re.ALLOWED_URI_REGEXP||Ebe,er=re.NAMESPACE||Jr,ks=re.MATHML_TEXT_INTEGRATION_POINTS||ks,Nr=re.HTML_INTEGRATION_POINTS||Nr,xe=re.CUSTOM_ELEMENT_HANDLING||{},re.CUSTOM_ELEMENT_HANDLING&&hh(re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),re.CUSTOM_ELEMENT_HANDLING&&hh(re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),re.CUSTOM_ELEMENT_HANDLING&&typeof re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(ze=!1),Xn&&(Cn=!0),po&&(Y=_i({},yoe),ce=[],po.html===!0&&(_i(Y,Coe),_i(ce,Soe)),po.svg===!0&&(_i(Y,b9),_i(ce,C9),_i(ce,g2)),po.svgFilters===!0&&(_i(Y,v9),_i(ce,C9),_i(ce,g2)),po.mathMl===!0&&(_i(Y,w9),_i(ce,xoe),_i(ce,g2))),re.ADD_TAGS&&(Y===te&&(Y=af(Y)),_i(Y,re.ADD_TAGS,Sn)),re.ADD_ATTR&&(ce===Ce&&(ce=af(ce)),_i(ce,re.ADD_ATTR,Sn)),re.ADD_URI_SAFE_ATTR&&_i(gc,re.ADD_URI_SAFE_ATTR,Sn),re.FORBID_CONTENTS&&(gn===yn&&(gn=af(gn)),_i(gn,re.FORBID_CONTENTS,Sn)),Er&&(Y["#text"]=!0),_t&&_i(Y,["html","head","body"]),Y.table&&(_i(Y,["tbody"]),delete Be.tbody),re.TRUSTED_TYPES_POLICY){if(typeof re.TRUSTED_TYPES_POLICY.createHTML!="function")throw iL('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw iL('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=re.TRUSTED_TYPES_POLICY,S=C.createHTML("")}else C===void 0&&(C=Z$e(f,s)),C!==null&&typeof S=="string"&&(S=C.createHTML(""));Sa&&Sa(re),mc=re}},Ki=_i({},[...b9,...v9,...W$e]),tr=_i({},[...w9,...H$e]),it=function(re){let ke=w(re);(!ke||!ke.tagName)&&(ke={namespaceURI:er,tagName:"template"});const dt=UR(re.tagName),Et=UR(ke.tagName);return Mi[re.namespaceURI]?re.namespaceURI===Os?ke.namespaceURI===Jr?dt==="svg":ke.namespaceURI===id?dt==="svg"&&(Et==="annotation-xml"||ks[Et]):!!Ki[dt]:re.namespaceURI===id?ke.namespaceURI===Jr?dt==="math":ke.namespaceURI===Os?dt==="math"&&Nr[Et]:!!tr[dt]:re.namespaceURI===Jr?ke.namespaceURI===Os&&!Nr[Et]||ke.namespaceURI===id&&!ks[Et]?!1:!tr[dt]&&(nd[dt]||!Ki[dt]):!!(Dr==="application/xhtml+xml"&&Mi[re.namespaceURI]):!1},ir=function(re){eL(e.removed,{element:re});try{w(re).removeChild(re)}catch{m(re)}},zt=function(re,ke){try{eL(e.removed,{attribute:ke.getAttributeNode(re),from:ke})}catch{eL(e.removed,{attribute:null,from:ke})}if(ke.removeAttribute(re),re==="is")if(Cn||Xn)try{ir(ke)}catch{}else try{ke.setAttribute(re,"")}catch{}},li=function(re){let ke=null,dt=null;if(Pt)re=""+re;else{const ci=_9(re,/^[\r\n\t ]+/);dt=ci&&ci[0]}Dr==="application/xhtml+xml"&&er===Jr&&(re=''+re+"");const Et=C?C.createHTML(re):re;if(er===Jr)try{ke=new u().parseFromString(Et,Dr)}catch{}if(!ke||!ke.documentElement){ke=L.createDocument(er,"template",null);try{ke.documentElement.innerHTML=pc?S:Et}catch{}}const $n=ke.body||ke.documentElement;return re&&dt&&$n.insertBefore(t.createTextNode(dt),$n.childNodes[0]||null),er===Jr?E.call(ke,_t?"html":"body")[0]:_t?ke.documentElement:$n},Ro=function(re){return x.call(re.ownerDocument||re,re,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Qn=function(re){return re instanceof h&&(typeof re.nodeName!="string"||typeof re.textContent!="string"||typeof re.removeChild!="function"||!(re.attributes instanceof d)||typeof re.removeAttribute!="function"||typeof re.setAttribute!="function"||typeof re.namespaceURI!="string"||typeof re.insertBefore!="function"||typeof re.hasChildNodes!="function")},Mo=function(re){return typeof a=="function"&&re instanceof a};function Jn(Qe,re,ke){f2(Qe,dt=>{dt.call(e,re,ke,mc)})}const Yg=function(re){let ke=null;if(Jn(M.beforeSanitizeElements,re,null),Qn(re))return ir(re),!0;const dt=Sn(re.nodeName);if(Jn(M.uponSanitizeElement,re,{tagName:dt,allowedTags:Y}),tt&&re.hasChildNodes()&&!Mo(re.firstElementChild)&&na(/<[/\w!]/g,re.innerHTML)&&na(/<[/\w!]/g,re.textContent)||re.nodeType===sL.progressingInstruction||tt&&re.nodeType===sL.comment&&na(/<[/\w]/g,re.data))return ir(re),!0;if(!Y[dt]||Be[dt]){if(!Be[dt]&&sd(dt)&&(xe.tagNameCheck instanceof RegExp&&na(xe.tagNameCheck,dt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(dt)))return!1;if(Er&&!gn[dt]){const Et=w(re)||re.parentNode,$n=v(re)||re.childNodes;if($n&&Et){const ci=$n.length;for(let Un=ci-1;Un>=0;--Un){const Gs=p($n[Un],!0);Gs.__removalCount=(re.__removalCount||0)+1,Et.insertBefore(Gs,b(re))}}}return ir(re),!0}return re instanceof l&&!it(re)||(dt==="noscript"||dt==="noembed"||dt==="noframes")&&na(/<\/no(script|embed|frames)/i,re.innerHTML)?(ir(re),!0):(Ue&&re.nodeType===sL.text&&(ke=re.textContent,f2([A,W,P],Et=>{ke=tL(ke,Et," ")}),re.textContent!==ke&&(eL(e.removed,{element:re.cloneNode()}),re.textContent=ke)),Jn(M.afterSanitizeElements,re,null),!1)},_c=function(re,ke,dt){if(kr&&(ke==="id"||ke==="name")&&(dt in t||dt in Q))return!1;if(!(ze&&!Ee[ke]&&na(B,ke))){if(!(Le&&na(V,ke))){if(!ce[ke]||Ee[ke]){if(!(sd(re)&&(xe.tagNameCheck instanceof RegExp&&na(xe.tagNameCheck,re)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(re))&&(xe.attributeNameCheck instanceof RegExp&&na(xe.attributeNameCheck,ke)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(ke,re))||ke==="is"&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&na(xe.tagNameCheck,dt)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(dt))))return!1}else if(!gc[ke]){if(!na(X,tL(dt,z,""))){if(!((ke==="src"||ke==="xlink:href"||ke==="href")&&re!=="script"&&P$e(dt,"data:")===0&&tn[re])){if(!(Ct&&!na(K,tL(dt,z,"")))){if(dt)return!1}}}}}}return!0},sd=function(re){return re!=="annotation-xml"&&_9(re,j)},fh=function(re){Jn(M.beforeSanitizeAttributes,re,null);const{attributes:ke}=re;if(!ke||Qn(re))return;const dt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ce,forceKeepAttr:void 0};let Et=ke.length;for(;Et--;){const $n=ke[Et],{name:ci,namespaceURI:Un,value:Gs}=$n,Ao=Sn(ci),Vu=Gs;let es=ci==="value"?Vu:O$e(Vu);if(dt.attrName=Ao,dt.attrValue=es,dt.keepAttr=!0,dt.forceKeepAttr=void 0,Jn(M.uponSanitizeAttribute,re,dt),es=dt.attrValue,Ir&&(Ao==="id"||Ao==="name")&&(zt(ci,re),es=fc+es),tt&&na(/((--!?|])>)|<\/(style|title|textarea)/i,es)){zt(ci,re);continue}if(Ao==="attributename"&&_9(es,"href")){zt(ci,re);continue}if(dt.forceKeepAttr)continue;if(!dt.keepAttr){zt(ci,re);continue}if(!ct&&na(/\/>/i,es)){zt(ci,re);continue}Ue&&f2([A,W,P],gh=>{es=tL(es,gh," ")});const od=Sn(re.nodeName);if(!_c(od,Ao,es)){zt(ci,re);continue}if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!Un)switch(f.getAttributeType(od,Ao)){case"TrustedHTML":{es=C.createHTML(es);break}case"TrustedScriptURL":{es=C.createScriptURL(es);break}}if(es!==Vu)try{Un?re.setAttributeNS(Un,ci,es):re.setAttribute(ci,es),Qn(re)?ir(re):woe(e.removed)}catch{zt(ci,re)}}Jn(M.afterSanitizeAttributes,re,null)},Hu=function Qe(re){let ke=null;const dt=Ro(re);for(Jn(M.beforeSanitizeShadowDOM,re,null);ke=dt.nextNode();)Jn(M.uponSanitizeShadowNode,ke,null),Yg(ke),fh(ke),ke.content instanceof o&&Qe(ke.content);Jn(M.afterSanitizeShadowDOM,re,null)};return e.sanitize=function(Qe){let re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ke=null,dt=null,Et=null,$n=null;if(pc=!Qe,pc&&(Qe=""),typeof Qe!="string"&&!Mo(Qe))if(typeof Qe.toString=="function"){if(Qe=Qe.toString(),typeof Qe!="string")throw iL("dirty is not a string, aborting")}else throw iL("toString is not a function");if(!e.isSupported)return Qe;if(yi||uh(re),e.removed=[],typeof Qe=="string"&&(Ta=!1),Ta){if(Qe.nodeName){const Gs=Sn(Qe.nodeName);if(!Y[Gs]||Be[Gs])throw iL("root node is forbidden and cannot be sanitized in-place")}}else if(Qe instanceof a)ke=li(""),dt=ke.ownerDocument.importNode(Qe,!0),dt.nodeType===sL.element&&dt.nodeName==="BODY"||dt.nodeName==="HTML"?ke=dt:ke.appendChild(dt);else{if(!Cn&&!Ue&&!_t&&Qe.indexOf("<")===-1)return C&&Ks?C.createHTML(Qe):Qe;if(ke=li(Qe),!ke)return Cn?null:Ks?S:""}ke&&Pt&&ir(ke.firstChild);const ci=Ro(Ta?Qe:ke);for(;Et=ci.nextNode();)Yg(Et),fh(Et),Et.content instanceof o&&Hu(Et.content);if(Ta)return Qe;if(Cn){if(Xn)for($n=I.call(ke.ownerDocument);ke.firstChild;)$n.appendChild(ke.firstChild);else $n=ke;return(ce.shadowroot||ce.shadowrootmode)&&($n=R.call(i,$n,!0)),$n}let Un=_t?ke.outerHTML:ke.innerHTML;return _t&&Y["!doctype"]&&ke.ownerDocument&&ke.ownerDocument.doctype&&ke.ownerDocument.doctype.name&&na(Nbe,ke.ownerDocument.doctype.name)&&(Un=" +`+Un),Ue&&f2([A,W,P],Gs=>{Un=tL(Un,Gs," ")}),C&&Ks?C.createHTML(Un):Un},e.setConfig=function(){let Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uh(Qe),yi=!0},e.clearConfig=function(){mc=null,yi=!1},e.isValidAttribute=function(Qe,re,ke){mc||uh({});const dt=Sn(Qe),Et=Sn(re);return _c(dt,Et,ke)},e.addHook=function(Qe,re){typeof re=="function"&&eL(M[Qe],re)},e.removeHook=function(Qe,re){if(re!==void 0){const ke=M$e(M[Qe],re);return ke===-1?void 0:A$e(M[Qe],ke,1)[0]}return woe(M[Qe])},e.removeHooks=function(Qe){M[Qe]=[]},e.removeAllHooks=function(){M=koe()},e}var TC=Dbe();const Tbe=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","s","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]),Rbe=Object.freeze(["href","target","src","alt","title","for","name","role","tabindex","x-dispatch","required","checked","placeholder","type","start","width","height","align"]),y9="vscode-relative-path";function Ioe(n,e){if(e.override==="*")return!0;try{const t=new URL(n,y9+"://");return!!(e.override.includes(t.protocol.replace(/:$/,""))||e.allowRelativePaths&&t.protocol===y9+":"&&!n.trim().toLowerCase().startsWith(y9))}catch{return!1}}function X$e(n,e){TC.addHook("afterSanitizeAttributes",t=>{for(const i of["href","src"])if(t.hasAttribute(i)){const s=t.getAttribute(i);i==="href"?!s.startsWith("#")&&!Ioe(s,n)&&t.removeAttribute(i):Ioe(s,e)||t.removeAttribute(i)}})}const Q$e=Object.freeze({ALLOWED_TAGS:[...Tbe],ALLOWED_ATTR:[...Rbe],ALLOW_UNKNOWN_PROTOCOLS:!0});function J$e(n,e){return Mbe(n,e,"trusted")}function Mbe(n,e,t){var i,s;try{const o={...Q$e};e!=null&&e.allowedTags&&(e.allowedTags.override&&(o.ALLOWED_TAGS=[...e.allowedTags.override]),e.allowedTags.augment&&(o.ALLOWED_TAGS=[...o.ALLOWED_TAGS??[],...e.allowedTags.augment]));let r=[...Rbe];e!=null&&e.allowedAttributes&&(e.allowedAttributes.override&&(r=[...e.allowedAttributes.override]),e.allowedAttributes.augment&&(r=[...r,...e.allowedAttributes.augment])),r=r.map(c=>typeof c=="string"?c.toLowerCase():{attributeName:c.attributeName.toLowerCase(),shouldKeep:c.shouldKeep});const a=new Set(r.map(c=>typeof c=="string"?c:c.attributeName)),l=new Map;for(const c of r)typeof c=="string"?l.delete(c):l.set(c.attributeName,c);return o.ALLOWED_ATTR=Array.from(a),X$e({override:((i=e==null?void 0:e.allowedLinkProtocols)==null?void 0:i.override)??[Ge.http,Ge.https],allowRelativePaths:(e==null?void 0:e.allowRelativeLinkPaths)??!1},{override:((s=e==null?void 0:e.allowedMediaProtocols)==null?void 0:s.override)??[Ge.http,Ge.https],allowRelativePaths:(e==null?void 0:e.allowRelativeMediaPaths)??!1}),e!=null&&e.replaceWithPlaintext&&TC.addHook("uponSanitizeElement",tUe),l.size&&TC.addHook("uponSanitizeAttribute",(c,d)=>{const h=l.get(d.attrName);if(h){const u=h.shouldKeep(c,d);typeof u=="string"?(d.keepAttr=!0,d.attrValue=u):d.keepAttr=u}else d.keepAttr=a.has(d.attrName)}),t==="dom"?TC.sanitize(n,{...o,RETURN_DOM_FRAGMENT:!0}):TC.sanitize(n,{...o,RETURN_TRUSTED_TYPE:!0})}finally{TC.removeAllHooks()}}const eUe=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],tUe=(n,e,t)=>{var i,s;if(!e.allowedTags[e.tagName]&&e.tagName!=="body"){const o=Abe(n);o&&(n.nodeType===Node.COMMENT_NODE?(i=n.parentElement)==null||i.insertBefore(o,n):(s=n.parentElement)==null||s.replaceChild(o,n))}};function Abe(n){if(!n.ownerDocument)return;let e,t;if(n.nodeType===Node.COMMENT_NODE)e=``;else if(n instanceof Element){const r=n.tagName.toLowerCase(),a=eUe.includes(r),l=n.attributes.length?" "+Array.from(n.attributes).map(c=>`${c.name}="${c.value}"`).join(" "):"";e=`<${r}${l}>`,a||(t=``)}else return;const i=document.createDocumentFragment(),s=n.ownerDocument.createTextNode(e);for(i.appendChild(s);n.firstChild;)i.appendChild(n.firstChild);const o=t?n.ownerDocument.createTextNode(t):void 0;return o&&i.appendChild(o),i}function Pbe(n,e,t){const i=Mbe(e,t,"dom");Ss(n,i)}const iUe=new RegExp(`(\\\\)?\\$\\((${$e.iconNameExpression}(?:${$e.iconModifierExpression})?)\\)`,"g");function xm(n){const e=new Array;let t,i=0,s=0;for(;(t=iUe.exec(n))!==null;){s=t.index||0,i{let i=[],s=[];return n&&({href:n,dimensions:i}=Gje(n),s.push(`src="${h2(n)}"`)),t&&s.push(`alt="${h2(t)}"`),e&&s.push(`title="${h2(e)}"`),i.length&&(s=s.concat(i)),""},paragraph({tokens:n}){return`

${this.parser.parseInline(n)}

`},link({href:n,title:e,tokens:t}){let i=this.parser.parseInline(t);return typeof n!="string"?"":(n===i&&(i=p9(i)),e=typeof e=="string"?h2(p9(e)):"",n=p9(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${i}`)}});function nUe(n){return function(e){const{tokens:t}=e,i=t[0];if((i==null?void 0:i.type)!=="paragraph")return n.call(this,e);const s=i.tokens;if(!s||s.length===0)return n.call(this,e);const o=s[0];if((o==null?void 0:o.type)!=="text")return n.call(this,e);const r=/^\s*\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*?\n*/i,a=o.raw.match(r);if(!a)return n.call(this,e);o.raw=o.raw.replace(r,""),o.text=o.text.replace(r,"");const l={note:"info",tip:"light-bulb",important:"comment",warning:"alert",caution:"stop"},c=a[1],d=c.charAt(0).toUpperCase()+c.slice(1).toLowerCase(),h=c.toLowerCase(),u=ih({id:l[h]}).outerHTML,f=this.parser.parse(t);return`

${u}${d}${f.substring(3)}

+`}}function ID(n,e={},t){var g,p,m;const i=new ne;let s=!1;const o=new Lbe(...e.markedExtensions??[]),{renderer:r,codeBlocks:a,syncCodeBlocks:l}=oUe(o,e,n),c=rUe(n);let d;if(e.fillInIncompleteTokens){const b={...o.defaults,...e.markedOptions,renderer:r},v=o.lexer(c,b),w=vUe(v);d=o.parser(w,b)}else d=o.parse(c,{...e==null?void 0:e.markedOptions,renderer:r,async:!1});n.supportThemeIcons&&(d=xm(d).map(v=>typeof v=="string"?v:v.outerHTML).join(""));const h=document.createElement("div"),u=Obe(n,e.sanitizerConfig??{});Pbe(h,d,u),sUe(n,e,h);let f;if(t?(f=t,Ss(t,...h.children)):f=h,a.length>0)Promise.all(a).then(b=>{var C;if(s)return;const v=new Map(b),w=f.querySelectorAll("div[data-code]");for(const S of w){const L=v.get(S.dataset.code??"");L&&Ss(S,L)}(C=e.asyncRenderCallback)==null||C.call(e)});else if(l.length>0){const b=new Map(l),v=f.querySelectorAll("div[data-code]");for(const w of v){const C=b.get(w.dataset.code??"");C&&Ss(w,C)}}if(e.asyncRenderCallback)for(const b of f.getElementsByTagName("img")){const v=i.add(J(b,"load",()=>{v.dispose(),e.asyncRenderCallback()}))}if(e.actionHandler){const b=v=>{const w=new lo(Pe(f),v);!w.leftButton&&!w.middleButton||Eoe(n,e,w)};i.add(J(f,"click",b)),i.add(J(f,"auxclick",b)),i.add(J(f,"keydown",v=>{const w=new ui(v);!w.equals(10)&&!w.equals(3)||Eoe(n,e,w)}))}for(const b of[...f.getElementsByTagName("input")])if(((g=b.attributes.getNamedItem("type"))==null?void 0:g.value)==="checkbox")b.setAttribute("disabled","");else if((p=e.sanitizerConfig)!=null&&p.replaceWithPlaintext){const v=Abe(b);v?(m=b.parentElement)==null||m.replaceChild(v,b):b.remove()}else b.remove();return{element:f,dispose:()=>{s=!0,i.dispose()}}}function sUe(n,e,t){var i;for(const s of t.querySelectorAll("img, audio, video, source")){const o=s.getAttribute("src");if(o){let r=o;try{n.baseUri&&(r=hz(He.from(n.baseUri),r))}catch{}if(s.setAttribute("src",Noe(n,r,!0)),(i=e.sanitizerConfig)!=null&&i.remoteImageIsAllowed){const a=He.parse(r);a.scheme!==Ge.file&&a.scheme!==Ge.data&&!e.sanitizerConfig.remoteImageIsAllowed(a)&&s.replaceWith(me("",void 0,s.outerHTML))}}}for(const s of t.querySelectorAll("a")){const o=s.getAttribute("href");if(s.setAttribute("href",""),!o||/^data:|javascript:/i.test(o)||/^command:/i.test(o)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(o))s.replaceWith(...s.childNodes);else{let r=Noe(n,o,!1);n.baseUri&&(r=hz(He.from(n.baseUri),o)),s.dataset.href=r}}}function oUe(n,e,t){const i=new n.Renderer(e.markedOptions);i.image=S9.image,i.link=S9.link,i.paragraph=S9.paragraph,t.supportAlertSyntax&&(i.blockquote=nUe(i.blockquote));const s=[],o=[];return e.codeBlockRendererSync?i.code=({text:r,lang:a,raw:l})=>{const c=oz.nextId(),d=e.codeBlockRendererSync(Doe(a),r,l);return o.push([c,d]),`
${zc(r)}
`}:e.codeBlockRenderer&&(i.code=({text:r,lang:a})=>{const l=oz.nextId(),c=e.codeBlockRenderer(Doe(a),r);return s.push(c.then(d=>[l,d])),`
${zc(r)}
`}),t.supportHtml||(i.html=({text:r})=>{var l;return(l=e.sanitizerConfig)!=null&&l.replaceWithPlaintext?zc(r):(t.isTrusted?r.match(/^(]+>)|(<\/\s*span>)$/):void 0)?r:""}),{renderer:i,codeBlocks:s,syncCodeBlocks:o}}function rUe(n){let e=n.value;return e.length>1e5&&(e=`${e.substr(0,1e5)}…`),n.supportThemeIcons&&(e=jje(e)),e}function Eoe(n,e,t){var s;const i=t.target.closest("a[data-href]");if(hn(i))try{let o=i.dataset.href;o&&(n.baseUri&&(o=hz(He.from(n.baseUri),o)),(s=e.actionHandler)==null||s.call(e,o,n))}catch(o){Je(o)}finally{t.preventDefault()}}function aUe(n,e){let t;try{t=az(decodeURIComponent(e))}catch{}return t?(t=ege(t,i=>{if(n.uris&&n.uris[i])return He.revive(n.uris[i])}),encodeURIComponent(JSON.stringify(t))):e}function Noe(n,e,t){const i=n.uris&&n.uris[e];let s=He.revive(i);return t?e.startsWith(Ge.data+":")?e:(s||(s=He.parse(e)),zge.uriToBrowserUri(s).toString(!0)):!s||He.parse(e).toString()===s.toString()?e:(s.query&&(s=s.with({query:aUe(n,s.query)})),s.toString())}function Doe(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function hz(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?Sie(n,e).toString():Sie(X5(n),e).toString()}function lUe(n,e,t={}){const i=Obe(e,t);return J$e(n,i)}const cUe=Object.freeze([...Tbe,"input"]),dUe=Object.freeze(["align","autoplay","alt","colspan","controls","draggable","height","href","loop","muted","playsinline","poster","rowspan","src","target","title","type","width","start","checked","disabled","value","data-code","data-href","data-severity",{attributeName:"style",shouldKeep:(n,e)=>n.tagName==="SPAN"&&e.attrName==="style"?/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z0-9]+)+\));)?(border-radius:[0-9]+px;)?$/.test(e.attrValue):!1},{attributeName:"class",shouldKeep:(n,e)=>n.tagName==="SPAN"&&e.attrName==="class"?/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(e.attrValue):!1}]);function Obe(n,e){var s,o,r;const t=n.isTrusted??!1,i=[Ge.http,Ge.https,Ge.mailto,Ge.file,Ge.vscodeFileResource,Ge.vscodeRemote,Ge.vscodeRemoteResource,Ge.vscodeNotebookCell];return t&&i.push(Ge.command),(s=e.allowedLinkSchemes)!=null&&s.augment&&i.push(...e.allowedLinkSchemes.augment),{allowedTags:{override:((o=e.allowedTags)==null?void 0:o.override)??cUe},allowedAttributes:{override:((r=e.allowedAttributes)==null?void 0:r.override)??dUe},allowedLinkProtocols:{override:i},allowRelativeLinkPaths:!!n.baseUri,allowedMediaProtocols:{override:[Ge.http,Ge.https,Ge.data,Ge.file,Ge.vscodeFileResource,Ge.vscodeRemote,Ge.vscodeRemoteResource]},allowRelativeMediaPaths:!!n.baseUri,replaceWithPlaintext:e.replaceWithPlaintext}}function hUe(n,e){if(typeof n=="string")return n;let t=n.value??"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=I$e(t,{async:!1,renderer:fUe.value});return lUe(i,{isTrusted:!1},{}).toString().replace(/&(#\d+|[a-zA-Z]+);/g,s=>uUe.get(s)??s).trim()}const uUe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]);function Fbe(){const n=new UE;return n.code=({text:e})=>zc(e),n.blockquote=({text:e})=>e+` `,n.html=e=>"",n.heading=function({tokens:e}){return this.parser.parseInline(e)+` `},n.hr=()=>"",n.list=function({items:e}){return e.map(t=>this.listitem(t)).join(` `)+` @@ -639,16 +634,16 @@ Please report this to https://github.com/markedjs/marked.`,e){const s="

An err `},n.table=function({header:e,rows:t}){return e.map(i=>this.tablecell(i)).join(" ")+` `+t.map(i=>i.map(s=>this.tablecell(s)).join(" ")).join(` `)+` -`},n.tablerow=({text:e})=>e,n.tablecell=function({tokens:e}){return this.parser.parseInline(e)},n.strong=({text:e})=>e,n.em=({text:e})=>e,n.codespan=({text:e})=>Vc(e),n.br=e=>` -`,n.del=({text:e})=>e,n.image=e=>"",n.text=({text:e})=>e,n.link=({text:e})=>e,n}const pUe=new oo(Vbe);new oo(()=>{const n=Vbe();return n.code=({text:e})=>` +`},n.tablerow=({text:e})=>e,n.tablecell=function({tokens:e}){return this.parser.parseInline(e)},n.strong=({text:e})=>e,n.em=({text:e})=>e,n.codespan=({text:e})=>zc(e),n.br=e=>` +`,n.del=({text:e})=>e,n.image=e=>"",n.text=({text:e})=>e,n.link=({text:e})=>e,n}const fUe=new ro(Fbe);new ro(()=>{const n=Fbe();return n.code=({text:e})=>` \`\`\` -${Vc(e)} +${zc(e)} \`\`\` -`,n});function KI(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function zbe(n){var e,t;if(n.tokens)for(let i=n.tokens.length-1;i>=0;i--){const s=n.tokens[i];if(s.type==="text"){const o=s.raw.split(` -`),r=o[o.length-1];if(r.includes("`"))return SUe(n);if(r.includes("**"))return NUe(n);if(r.match(/\*\w/))return xUe(n);if(r.match(/(^|\s)__\w/))return DUe(n);if(r.match(/(^|\s)_\w/))return LUe(n);if(mUe(r)||_Ue(r)&&n.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=n.tokens.slice(i+1);return((e=a[0])==null?void 0:e.type)==="link"&&((t=a[1])==null?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||r.match(/^[^"]* +"[^"]*$/)?EUe(n):kUe(n)}else if(r.match(/(^|\s)\[\w*[^\]]*$/))return IUe(n)}}}function mUe(n){return!!n.match(/(^|\s)\[.*\]\(\w*/)}function _Ue(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function bUe(n){var c;const e=n.items[n.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0,i=d=>{const h=d.items.at(-1),u=h==null?void 0:h.tokens.at(-1);return(u==null?void 0:u.type)==="heading"||(u==null?void 0:u.type)==="list"&&i(u)};let s;if((t==null?void 0:t.type)==="text"&&!("inRawBlock"in e))s=zbe(t);else if(i(n)){const d=qI(n.raw.trim()+"  ")[0];return d.type!=="list"?void 0:d}if(!s||s.type!=="paragraph")return;const o=KI(n.items.slice(0,-1)),r=(c=e.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:c[0];if(!r)return;const a=r+KI(e.tokens.slice(0,-1))+s.raw,l=qI(o+a)[0];if(l.type==="list")return l}function vUe(n,e){if(n.raw.match(/-\s*$/))return qI(e+"  ")}const wUe=3;function CUe(n){for(let e=0;e{e+=t.raw}),e}function Bbe(n){var e,t;if(n.tokens)for(let i=n.tokens.length-1;i>=0;i--){const s=n.tokens[i];if(s.type==="text"){const o=s.raw.split(` +`),r=o[o.length-1];if(r.includes("`"))return CUe(n);if(r.includes("**"))return IUe(n);if(r.match(/\*\w/))return yUe(n);if(r.match(/(^|\s)__\w/))return EUe(n);if(r.match(/(^|\s)_\w/))return SUe(n);if(gUe(r)||pUe(r)&&n.tokens.slice(0,i).some(a=>a.type==="text"&&a.raw.match(/\[[^\]]*$/))){const a=n.tokens.slice(i+1);return((e=a[0])==null?void 0:e.type)==="link"&&((t=a[1])==null?void 0:t.type)==="text"&&a[1].raw.match(/^ *"[^"]*$/)||r.match(/^[^"]* +"[^"]*$/)?LUe(n):xUe(n)}else if(r.match(/(^|\s)\[\w*[^\]]*$/))return kUe(n)}}}function gUe(n){return!!n.match(/(^|\s)\[.*\]\(\w*/)}function pUe(n){return!!n.match(/^[^\[]*\]\([^\)]*$/)}function mUe(n){var c;const e=n.items[n.items.length-1],t=e.tokens?e.tokens[e.tokens.length-1]:void 0,i=d=>{const h=d.items.at(-1),u=h==null?void 0:h.tokens.at(-1);return(u==null?void 0:u.type)==="heading"||(u==null?void 0:u.type)==="list"&&i(u)};let s;if((t==null?void 0:t.type)==="text"&&!("inRawBlock"in e))s=Bbe(t);else if(i(n)){const d=qE(n.raw.trim()+"  ")[0];return d.type!=="list"?void 0:d}if(!s||s.type!=="paragraph")return;const o=KE(n.items.slice(0,-1)),r=(c=e.raw.match(/^(\s*(-|\d+\.|\*) +)/))==null?void 0:c[0];if(!r)return;const a=r+KE(e.tokens.slice(0,-1))+s.raw,l=qE(o+a)[0];if(l.type==="list")return l}function _Ue(n,e){if(n.raw.match(/-\s*$/))return qE(e+"  ")}const bUe=3;function vUe(n){for(let e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const o=s?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return qI(a)}}const jg=mt("openerService");function RUe(n,e){return n.with({fragment:`${e.startLineNumber},${e.startColumn}${e.endLineNumber?`-${e.endLineNumber}${e.endColumn?`,${e.endColumn}`:""}`:""}`})}function MUe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var AUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},PUe=function(n,e){return function(t,i){e(t,i,n)}};const Jc=mt("markdownRendererService");let fz=class{constructor(e){this._openerService=e}render(e,t,i){const s={...t};s.actionHandler||(s.actionHandler=(r,a)=>jbe(this._openerService,r,a.isTrusted)),s.codeBlockRenderer||(s.codeBlockRenderer=(r,a)=>{var l;return((l=this._defaultCodeBlockRenderer)==null?void 0:l.renderCodeBlock(r,a,s??{}))??Promise.resolve(document.createElement("span"))});const o=ED(e,s,i);return o.element.classList.add("rendered-markdown"),o}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}};fz=AUe([PUe(0,jg)],fz);async function jbe(n,e,t,i){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:OUe(t),skipValidation:i})}catch(s){return Je(s),!1}}function OUe(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}xt(Jc,fz,1);var FUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},g2=function(n,e){return function(t,i){e(t,i,n)}};const wh=me;let gz=class extends Na{get _targetWindow(){return Oe(this._target.targetElements[0])}get _targetDocumentElement(){return Oe(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,o){var u,f,g,p,m,b,v,w,C,S,L;if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=s,this._accessibilityService=o,this._messageListeners=new ne,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new q),this._onRequestLayout=this._register(new q),this._linkHandler=e.linkHandler,this._target="targetElements"in e.target?e.target:new BUe(e.target),e.style)switch(e.style){case 1:{e.appearance??(e.appearance={}),(u=e.appearance).compact??(u.compact=!0),(f=e.appearance).showPointer??(f.showPointer=!0);break}case 2:{e.appearance??(e.appearance={}),(g=e.appearance).compact??(g.compact=!0);break}}this._hoverPointer=(p=e.appearance)!=null&&p.showPointer?wh("div.workbench-hover-pointer"):void 0,this._hover=this._register(new fZ(!((m=e.appearance)!=null&&m.skipFadeInAnimation))),this._hover.containerDomNode.classList.add("workbench-hover"),(b=e.appearance)!=null&&b.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),(v=e.position)!=null&&v.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const r=(w=e.appearance)==null?void 0:w.maxHeightRatio;r!==void 0&&r>0&&r<=1&&(this._maxHeightRatioRelativeToWindow=r),this._hoverPosition=((C=e.position)==null?void 0:C.hoverPosition)===void 0?3:wg(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,x=>x.stopPropagation()),this.onkeydown(this._hover.containerDomNode,x=>{x.equals(9)&&this.dispose()}),this._register(J(this._targetWindow,"blur",()=>this.dispose()));const a=wh("div.hover-row.markdown-hover"),l=wh("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(hn(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const x=e.content,{element:E}=this._register(this._markdownRenderer.render(x,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));l.appendChild(E)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const x=wh("div.hover-row.status-bar"),E=wh("div.actions");e.actions.forEach(I=>{const R=this._keybindingService.lookupKeybinding(I.commandId),M=R?R.getLabel():null;this._register(L3.render(E,{label:I.label,commandId:I.commandId,run:A=>{I.run(A),this.dispose()},iconClass:I.iconClass},M))}),x.appendChild(E),this._hover.containerDomNode.appendChild(x)}this._hoverContainer=wh("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:((S=e.persistence)==null?void 0:S.hideOnHover)===void 0?c=typeof e.content=="string"||cg(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):c=e.persistence.hideOnHover,(L=e.appearance)!=null&&L.showHoverHint){const x=wh("div.hover-row.status-bar"),E=wh("div.info");E.textContent=_(1699,"Hold {0} key to mouse over",wt?"Option":"Alt"),x.appendChild(E),this._hover.containerDomNode.appendChild(x)}const d=[...this._target.targetElements];c||d.push(this._hoverContainer);const h=this._register(new Moe(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const x=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Moe(x)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=V5(this._hoverContainer,wh("div")),s=ue(this._hoverContainer,wh("div"));i.tabIndex=0,s.tabIndex=0,this._register(J(s,"focus",o=>{e.focus(),o.preventDefault()})),this._register(J(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){var s;e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&nbe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:s.getAriaLabel());i&&Xd(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=spe(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:o,left:r}=t[0],a=s-r,l=o-i,c={top:i,right:s,bottom:o,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){var e,t;this._isDisposed||(this._onDispose.fire(),(t=(e=this._target).dispose)==null||t.call(e),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};gz=FUe([g2(1,Ht),g2(2,lt),g2(3,Jc),g2(4,Us)],gz);class Moe extends Na{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new Kt),this._onMouseOut=this._register(new q);for(const i of this._elements)this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new Ca(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class BUe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var _o;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(_o||(_o={}));function WUe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var sm;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(sm||(sm={}));function _0(n,e,t){const i=t.mode===sm.ALIGN?t.offset:t.offset+t.size,s=t.mode===sm.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const H0=class H0 extends G{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=G.None,this.toDisposeOnSetContainer=G.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=me(".context-view"),ar(this.view),this.setContainer(e,t),this._register(Re(()=>this.setContainer(null,1)))}setContainer(e,t){var s;this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,(s=this.shadowRootHostElement)==null||s.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=me(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=HUe,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(me("slot"))}else this.container.appendChild(this.view);const o=new ne;H0.BUBBLE_UP_EVENTS.forEach(r=>{o.add(xn(this.container,r,a=>{this.onDOMEvent(a,!1)}))}),H0.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(xn(this.container,r,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,i;this.isVisible()&&this.hide(),js(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",la(this.view),this.toDisposeOnClean=e.render(this.view)||G.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)==null||i.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(nc&&cD.pointerEvents)){this.hide();return}(t=(e=this.delegate)==null?void 0:e.layout)==null||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(hn(e)){const g=dn(e),p=spe(e);t={top:g.top*p,left:g.left*p,width:g.width*p,height:g.height*p}}else WUe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=ra(this.view),s=zf(this.view),o=this.delegate.anchorPosition??0,r=this.delegate.anchorAlignment??0,a=this.delegate.anchorAxisAlignment??0;let l,c;const d=ii();if(a===0){const g={offset:t.top-d.pageYOffset,size:t.height,position:o===0?0:1},p={offset:t.left,size:t.width,position:r===0?0:1,mode:sm.ALIGN};l=_0(d.innerHeight,s,g)+d.pageYOffset,_o.intersects({start:l,end:l+s},{start:g.offset,end:g.offset+g.size})&&(p.mode=sm.AVOID),c=_0(d.innerWidth,i,p)}else{const g={offset:t.left,size:t.width,position:r===0?0:1},p={offset:t.top,size:t.height,position:o===0?0:1,mode:sm.ALIGN};c=_0(d.innerWidth,i,g),_o.intersects({start:c,end:c+i},{start:g.offset,end:g.offset+g.size})&&(p.mode=sm.AVOID),l=_0(d.innerHeight,s,p)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=dn(this.container),u=this.container.scrollTop||0,f=this.container.scrollLeft||0;this.view.style.top=`${l-(this.useFixedPosition?dn(this.view).top:h.top)+u}px`,this.view.style.left=`${c-(this.useFixedPosition?dn(this.view).left:h.left)+f}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),ar(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Oe(e).document.activeElement):t&&!Cs(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};H0.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],H0.BUBBLE_DOWN_EVENTS=["click"];let pz=H0;const HUe=` +|${" --- |".repeat(i)}`;return qE(a)}}const jg=mt("openerService");function DUe(n,e){return n.with({fragment:`${e.startLineNumber},${e.startColumn}${e.endLineNumber?`-${e.endLineNumber}${e.endColumn?`,${e.endColumn}`:""}`:""}`})}function TUe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var RUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},MUe=function(n,e){return function(t,i){e(t,i,n)}};const ed=mt("markdownRendererService");let uz=class{constructor(e){this._openerService=e}render(e,t,i){const s={...t};s.actionHandler||(s.actionHandler=(r,a)=>Wbe(this._openerService,r,a.isTrusted)),s.codeBlockRenderer||(s.codeBlockRenderer=(r,a)=>{var l;return((l=this._defaultCodeBlockRenderer)==null?void 0:l.renderCodeBlock(r,a,s??{}))??Promise.resolve(document.createElement("span"))});const o=ID(e,s,i);return o.element.classList.add("rendered-markdown"),o}setDefaultCodeBlockRenderer(e){this._defaultCodeBlockRenderer=e}};uz=RUe([MUe(0,jg)],uz);async function Wbe(n,e,t,i){try{return await n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:AUe(t),skipValidation:i})}catch(s){return Je(s),!1}}function AUe(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}Lt(ed,uz,1);var PUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},p2=function(n,e){return function(t,i){e(t,i,n)}};const Ch=me;let fz=class extends Da{get _targetWindow(){return Pe(this._target.targetElements[0])}get _targetDocumentElement(){return Pe(this._target.targetElements[0]).document.documentElement}get isDisposed(){return this._isDisposed}get isMouseIn(){return this._lockMouseTracker.isMouseIn}get domNode(){return this._hover.containerDomNode}get onDispose(){return this._onDispose.event}get onRequestLayout(){return this._onRequestLayout.event}get anchor(){return this._hoverPosition===2?0:1}get x(){return this._x}get y(){return this._y}get isLocked(){return this._isLocked}set isLocked(e){this._isLocked!==e&&(this._isLocked=e,this._hoverContainer.classList.toggle("locked",this._isLocked))}constructor(e,t,i,s,o){var u,f,g,p,m,b,v,w,C,S,L;if(super(),this._keybindingService=t,this._configurationService=i,this._markdownRenderer=s,this._accessibilityService=o,this._messageListeners=new ne,this._isDisposed=!1,this._forcePosition=!1,this._x=0,this._y=0,this._isLocked=!1,this._enableFocusTraps=!1,this._addedFocusTrap=!1,this._maxHeightRatioRelativeToWindow=.5,this._onDispose=this._register(new q),this._onRequestLayout=this._register(new q),this._linkHandler=e.linkHandler,this._target="targetElements"in e.target?e.target:new OUe(e.target),e.style)switch(e.style){case 1:{e.appearance??(e.appearance={}),(u=e.appearance).compact??(u.compact=!0),(f=e.appearance).showPointer??(f.showPointer=!0);break}case 2:{e.appearance??(e.appearance={}),(g=e.appearance).compact??(g.compact=!0);break}}this._hoverPointer=(p=e.appearance)!=null&&p.showPointer?Ch("div.workbench-hover-pointer"):void 0,this._hover=this._register(new uZ(!((m=e.appearance)!=null&&m.skipFadeInAnimation))),this._hover.containerDomNode.classList.add("workbench-hover"),(b=e.appearance)!=null&&b.compact&&this._hover.containerDomNode.classList.add("workbench-hover","compact"),e.additionalClasses&&this._hover.containerDomNode.classList.add(...e.additionalClasses),(v=e.position)!=null&&v.forcePosition&&(this._forcePosition=!0),e.trapFocus&&(this._enableFocusTraps=!0);const r=(w=e.appearance)==null?void 0:w.maxHeightRatio;r!==void 0&&r>0&&r<=1&&(this._maxHeightRatioRelativeToWindow=r),this._hoverPosition=((C=e.position)==null?void 0:C.hoverPosition)===void 0?3:wg(e.position.hoverPosition)?e.position.hoverPosition:2,this.onmousedown(this._hover.containerDomNode,x=>x.stopPropagation()),this.onkeydown(this._hover.containerDomNode,x=>{x.equals(9)&&this.dispose()}),this._register(J(this._targetWindow,"blur",()=>this.dispose()));const a=Ch("div.hover-row.markdown-hover"),l=Ch("div.hover-contents");if(typeof e.content=="string")l.textContent=e.content,l.style.whiteSpace="pre-wrap";else if(hn(e.content))l.appendChild(e.content),l.classList.add("html-hover-contents");else{const x=e.content,{element:I}=this._register(this._markdownRenderer.render(x,{actionHandler:this._linkHandler,asyncRenderCallback:()=>{l.classList.add("code-hover-contents"),this.layout(),this._onRequestLayout.fire()}}));l.appendChild(I)}if(a.appendChild(l),this._hover.contentsDomNode.appendChild(a),e.actions&&e.actions.length>0){const x=Ch("div.hover-row.status-bar"),I=Ch("div.actions");e.actions.forEach(E=>{const R=this._keybindingService.lookupKeybinding(E.commandId),M=R?R.getLabel():null;this._register(L3.render(I,{label:E.label,commandId:E.commandId,run:A=>{E.run(A),this.dispose()},iconClass:E.iconClass},M))}),x.appendChild(I),this._hover.containerDomNode.appendChild(x)}this._hoverContainer=Ch("div.workbench-hover-container"),this._hoverPointer&&this._hoverContainer.appendChild(this._hoverPointer),this._hoverContainer.appendChild(this._hover.containerDomNode);let c;if(e.actions&&e.actions.length>0?c=!1:((S=e.persistence)==null?void 0:S.hideOnHover)===void 0?c=typeof e.content=="string"||cg(e.content)&&!e.content.value.includes("](")&&!e.content.value.includes(""):c=e.persistence.hideOnHover,(L=e.appearance)!=null&&L.showHoverHint){const x=Ch("div.hover-row.status-bar"),I=Ch("div.info");I.textContent=_(1699,"Hold {0} key to mouse over",yt?"Option":"Alt"),x.appendChild(I),this._hover.containerDomNode.appendChild(x)}const d=[...this._target.targetElements];c||d.push(this._hoverContainer);const h=this._register(new Toe(d));if(this._register(h.onMouseOut(()=>{this._isLocked||this.dispose()})),c){const x=[...this._target.targetElements,this._hoverContainer];this._lockMouseTracker=this._register(new Toe(x)),this._register(this._lockMouseTracker.onMouseOut(()=>{this._isLocked||this.dispose()}))}else this._lockMouseTracker=h}addFocusTrap(){if(!this._enableFocusTraps||this._addedFocusTrap)return;this._addedFocusTrap=!0;const e=this._hover.containerDomNode,t=this.findLastFocusableChild(this._hover.containerDomNode);if(t){const i=V5(this._hoverContainer,Ch("div")),s=he(this._hoverContainer,Ch("div"));i.tabIndex=0,s.tabIndex=0,this._register(J(s,"focus",o=>{e.focus(),o.preventDefault()})),this._register(J(i,"focus",o=>{t.focus(),o.preventDefault()}))}}findLastFocusableChild(e){if(e.hasChildNodes())for(let t=0;t=0)return o}const s=this.findLastFocusableChild(i);if(s)return s}}render(e){var s;e.appendChild(this._hoverContainer);const i=this._hoverContainer.contains(this._hoverContainer.ownerDocument.activeElement)&&J_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:s.getAriaLabel());i&&Jd(i),this.layout(),this.addFocusTrap()}layout(){this._hover.containerDomNode.classList.remove("right-aligned"),this._hover.contentsDomNode.style.maxHeight="";const e=d=>{const h=epe(d),u=d.getBoundingClientRect();return{top:u.top*h,bottom:u.bottom*h,right:u.right*h,left:u.left*h}},t=this._target.targetElements.map(d=>e(d)),{top:i,right:s,bottom:o,left:r}=t[0],a=s-r,l=o-i,c={top:i,right:s,bottom:o,left:r,width:a,height:l,center:{x:r+a/2,y:i+l/2}};if(this.adjustHorizontalHoverPosition(c),this.adjustVerticalHoverPosition(c),this.adjustHoverMaxHeight(c),this._hoverContainer.style.padding="",this._hoverContainer.style.margin="",this._hoverPointer){switch(this._hoverPosition){case 1:c.left+=3,c.right+=3,this._hoverContainer.style.paddingLeft="3px",this._hoverContainer.style.marginLeft="-3px";break;case 0:c.left-=3,c.right-=3,this._hoverContainer.style.paddingRight="3px",this._hoverContainer.style.marginRight="-3px";break;case 2:c.top+=3,c.bottom+=3,this._hoverContainer.style.paddingTop="3px",this._hoverContainer.style.marginTop="-3px";break;case 3:c.top-=3,c.bottom-=3,this._hoverContainer.style.paddingBottom="3px",this._hoverContainer.style.marginBottom="-3px";break}c.center.x=c.left+a/2,c.center.y=c.top+l/2}this.computeXCordinate(c),this.computeYCordinate(c),this._hoverPointer&&(this._hoverPointer.classList.remove("top"),this._hoverPointer.classList.remove("left"),this._hoverPointer.classList.remove("right"),this._hoverPointer.classList.remove("bottom"),this.setHoverPointerPosition(c)),this._hover.onContentsChanged()}computeXCordinate(e){const t=this._hover.containerDomNode.clientWidth+2;this._target.x!==void 0?this._x=this._target.x:this._hoverPosition===1?this._x=e.right:this._hoverPosition===0?this._x=e.left-t:(this._hoverPointer?this._x=e.center.x-this._hover.containerDomNode.clientWidth/2:this._x=e.left,this._x+t>=this._targetDocumentElement.clientWidth&&(this._hover.containerDomNode.classList.add("right-aligned"),this._x=Math.max(this._targetDocumentElement.clientWidth-t-2,this._targetDocumentElement.clientLeft))),this._xthis._targetWindow.innerHeight&&(this._y=e.bottom)}adjustHorizontalHoverPosition(e){if(this._target.x!==void 0)return;const t=this._hoverPointer?3:0;if(this._forcePosition){const i=t+2;this._hoverPosition===1?this._hover.containerDomNode.style.maxWidth=`${this._targetDocumentElement.clientWidth-e.right-i}px`:this._hoverPosition===0&&(this._hover.containerDomNode.style.maxWidth=`${e.left-i}px`);return}this._hoverPosition===1?this._targetDocumentElement.clientWidth-e.right=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=0:this._hoverPosition=2):this._hoverPosition===0&&(e.left=this._hover.containerDomNode.clientWidth+t?this._hoverPosition=1:this._hoverPosition=2),e.left-this._hover.containerDomNode.clientWidth-t<=this._targetDocumentElement.clientLeft&&(this._hoverPosition=1))}adjustVerticalHoverPosition(e){if(this._target.y!==void 0||this._forcePosition)return;const t=this._hoverPointer?3:0;this._hoverPosition===3?e.top-this._hover.containerDomNode.clientHeight-t<0&&(this._hoverPosition=2):this._hoverPosition===2&&e.bottom+this._hover.containerDomNode.offsetHeight+t>this._targetWindow.innerHeight&&(this._hoverPosition=3)}adjustHoverMaxHeight(e){let t=this._targetWindow.innerHeight*this._maxHeightRatioRelativeToWindow;if(this._forcePosition){const i=(this._hoverPointer?3:0)+2;this._hoverPosition===3?t=Math.min(t,e.top-i):this._hoverPosition===2&&(t=Math.min(t,this._targetWindow.innerHeight-e.bottom-i))}if(this._hover.containerDomNode.style.maxHeight=`${t}px`,this._hover.contentsDomNode.clientHeighte.height?this._hoverPointer.style.top=`${e.center.y-(this._y-t)-3}px`:this._hoverPointer.style.top=`${Math.round(t/2)-3}px`;break}case 3:case 2:{this._hoverPointer.classList.add(this._hoverPosition===3?"bottom":"top");const t=this._hover.containerDomNode.clientWidth;let i=Math.round(t/2)-3;const s=this._x+i;(se.right)&&(i=e.center.x-this._x-3),this._hoverPointer.style.left=`${i}px`;break}}}focus(){this._hover.containerDomNode.focus()}dispose(){var e,t;this._isDisposed||(this._onDispose.fire(),(t=(e=this._target).dispose)==null||t.call(e),this._hoverContainer.remove(),this._messageListeners.dispose(),super.dispose()),this._isDisposed=!0}};fz=PUe([p2(1,Vt),p2(2,lt),p2(3,ed),p2(4,Us)],fz);class Toe extends Da{get onMouseOut(){return this._onMouseOut.event}get isMouseIn(){return this._isMouseIn}constructor(e,t=200){super(),this._elements=e,this._eventDebounceDelay=t,this._isMouseIn=!0,this._mouseTimer=this._register(new Gt),this._onMouseOut=this._register(new q);for(const i of this._elements)this.onmouseover(i,()=>this._onTargetMouseOver()),this.onmouseleave(i,()=>this._onTargetMouseLeave())}_onTargetMouseOver(){this._isMouseIn=!0,this._mouseTimer.clear()}_onTargetMouseLeave(){this._isMouseIn=!1,this._mouseTimer.value=new ya(()=>this._fireIfMouseOutside(),this._eventDebounceDelay)}_fireIfMouseOutside(){this._isMouseIn||this._onMouseOut.fire()}}class OUe{constructor(e){this._element=e,this.targetElements=[this._element]}dispose(){}}var mo;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(mo||(mo={}));function FUe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var nm;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(nm||(nm={}));function p0(n,e,t){const i=t.mode===nm.ALIGN?t.offset:t.offset+t.size,s=t.mode===nm.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}const B0=class B0 extends G{constructor(e,t){super(),this.container=null,this.useFixedPosition=!1,this.useShadowDOM=!1,this.delegate=null,this.toDisposeOnClean=G.None,this.toDisposeOnSetContainer=G.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=me(".context-view"),cr(this.view),this.setContainer(e,t),this._register(Re(()=>this.setContainer(null,1)))}setContainer(e,t){var s;this.useFixedPosition=t!==1;const i=this.useShadowDOM;if(this.useShadowDOM=t===3,!(e===this.container&&i===this.useShadowDOM)&&(this.container&&(this.toDisposeOnSetContainer.dispose(),this.view.remove(),this.shadowRoot&&(this.shadowRoot=null,(s=this.shadowRootHostElement)==null||s.remove(),this.shadowRootHostElement=null),this.container=null),e)){if(this.container=e,this.useShadowDOM){this.shadowRootHostElement=me(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const r=document.createElement("style");r.textContent=BUe,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(me("slot"))}else this.container.appendChild(this.view);const o=new ne;B0.BUBBLE_UP_EVENTS.forEach(r=>{o.add(kn(this.container,r,a=>{this.onDOMEvent(a,!1)}))}),B0.BUBBLE_DOWN_EVENTS.forEach(r=>{o.add(kn(this.container,r,a=>{this.onDOMEvent(a,!0)},!0))}),this.toDisposeOnSetContainer=o}}show(e){var t,i;this.isVisible()&&this.hide(),js(this.view),this.view.className="context-view monaco-component",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex=`${2575+(e.layer??0)}`,this.view.style.position=this.useFixedPosition?"fixed":"absolute",ca(this.view),this.toDisposeOnClean=e.render(this.view)||G.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)==null||i.call(t)}getViewElement(){return this.view}layout(){var e,t;if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Jl&&cD.pointerEvents)){this.hide();return}(t=(e=this.delegate)==null?void 0:e.layout)==null||t.call(e),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(hn(e)){const g=dn(e),p=epe(e);t={top:g.top*p,left:g.left*p,width:g.width*p,height:g.height*p}}else FUe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=aa(this.view),s=zf(this.view),o=this.delegate.anchorPosition??0,r=this.delegate.anchorAlignment??0,a=this.delegate.anchorAxisAlignment??0;let l,c;const d=ii();if(a===0){const g={offset:t.top-d.pageYOffset,size:t.height,position:o===0?0:1},p={offset:t.left,size:t.width,position:r===0?0:1,mode:nm.ALIGN};l=p0(d.innerHeight,s,g)+d.pageYOffset,mo.intersects({start:l,end:l+s},{start:g.offset,end:g.offset+g.size})&&(p.mode=nm.AVOID),c=p0(d.innerWidth,i,p)}else{const g={offset:t.left,size:t.width,position:r===0?0:1},p={offset:t.top,size:t.height,position:o===0?0:1,mode:nm.ALIGN};c=p0(d.innerWidth,i,g),mo.intersects({start:c,end:c+i},{start:g.offset,end:g.offset+g.size})&&(p.mode=nm.AVOID),l=p0(d.innerHeight,s,p)+d.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const h=dn(this.container),u=this.container.scrollTop||0,f=this.container.scrollLeft||0;this.view.style.top=`${l-(this.useFixedPosition?dn(this.view).top:h.top)+u}px`,this.view.style.left=`${c-(this.useFixedPosition?dn(this.view).left:h.left)+f}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),cr(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,Pe(e).document.activeElement):t&&!ys(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}};B0.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],B0.BUBBLE_DOWN_EVENTS=["click"];let gz=B0;const BUe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -687,9 +682,9 @@ ${Vc(e)} :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var VUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zUe=function(n,e){return function(t,i){e(t,i,n)}};let fP=class extends G{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new pz(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(Oe(t))?s=1:i?s=3:s=2:s=1,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};fP=VUe([zUe(0,Mu)],fP);class jUe extends fP{getContextViewElement(){return this.contextView.getViewElement()}}function $be(n){const e=n;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class $Ue{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(ws(e)||hn(e)||e===void 0)s=e;else{this._cancellationTokenSource=new Wi;const o=this._cancellationTokenSource.token;let r;if($be(e)?G1(e.markdown)?r=e.markdown(o).then(a=>a??e.markdownNotSupportedFallback):r=e.markdown??e.markdownNotSupportedFallback:r=e.element(o),r instanceof Promise?(this._hoverWidget||this.show(_(1700,"Loading..."),t,i),s=await r):s=r,this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){var o;const s=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,actions:i==null?void 0:i.actions,linkHandler:i==null?void 0:i.linkHandler,trapFocus:i==null?void 0:i.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s,showHoverHint:(o=i==null?void 0:i.appearance)==null?void 0:o.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(r,t)}s==null||s.dispose()}hasContent(e){return e?cg(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)==null?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)==null||e.dispose(),(t=this._cancellationTokenSource)==null||t.dispose(!0),this._cancellationTokenSource=void 0}}var UUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yC=function(n,e){return function(t,i){e(t,i,n)}};let mz=class extends G{constructor(e,t,i,s,o,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=s,this._layoutService=o,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new fP(this._layoutService)),this._register(As.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:Wn(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,s){const o=this._createHover(e,i);if(o)return this._showHover(o,e,t),o}showDelayedHover(e,t){var s;if(e.id===void 0&&(e.id=Aoe(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if((s=this._currentHover)!=null&&s.isLocked)return;if(dp(this._currentHoverOptions)===dp(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===(t==null?void 0:t.groupId))return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&dp(this._currentHoverOptions)===dp(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);if(!i){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t==null?void 0:t.groupId,vu(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i}setupDelayedHover(e,t,i){const s=()=>({...typeof t=="function"?t():t,target:e});return this._setupDelayedHover(e,s,i)}setupDelayedHoverAtMouse(e,t,i){const s=o=>({...typeof t=="function"?t():t,target:{targetElements:[e],x:o!==void 0?o.x+10:void 0}});return this._setupDelayedHover(e,s,i)}_setupDelayedHover(e,t,i){const s=new ne;return s.add(J(e,_e.MOUSE_OVER,o=>{this.showDelayedHover(t(o),{groupId:i==null?void 0:i.groupId})})),i!=null&&i.setupKeyboardEvents&&s.add(J(e,_e.KEY_DOWN,o=>{const r=new ui(o);(r.equals(10)||r.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:o=>{this.showInstantHover(t(),o)}}),s.add(Re(()=>this._delayedHovers.delete(e))),s}_createHover(e,t){var a,l,c,d;if(this._currentDelayedHover=void 0,e.content===""||(a=this._currentHover)!=null&&a.isLocked||(e.id===void 0&&(e.id=Aoe(e.content)),dp(this._currentHoverOptions)===dp(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),s=os();t||(i&&s?s.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=s):this._lastFocusedElementBeforeOpen=void 0);const o=new ne,r=this._instantiationService.createInstance(gz,e);if((l=e.persistence)!=null&&l.sticky&&(r.isLocked=!0),(c=e.position)!=null&&c.hoverPosition&&!wg(e.position.hoverPosition)&&(e.target={targetElements:hn(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),r.onDispose(()=>{var u,f;((u=this._currentHover)==null?void 0:u.domNode)&&rpe(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)==null||f.focus()),dp(this._currentHoverOptions)===dp(e)&&this.doHideHover(),o.dispose()},void 0,o),!e.container){const h=hn(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Oe(h))}if(r.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),(d=e.persistence)!=null&&d.sticky)o.add(J(Oe(e.container).document,_e.MOUSE_DOWN,h=>{Cs(h.target,r.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const u of e.target.targetElements)o.add(J(u,_e.CLICK,()=>this.hideHover()));else o.add(J(e.target,_e.CLICK,()=>this.hideHover()));const h=os();if(h){const u=Oe(h).document;o.add(J(h,_e.KEY_DOWN,f=>{var g;return this._keyDown(f,r,!!((g=e.persistence)!=null&&g.hideOnKeyDown))})),o.add(J(u,_e.KEY_DOWN,f=>{var g;return this._keyDown(f,r,!!((g=e.persistence)!=null&&g.hideOnKeyDown))})),o.add(J(h,_e.KEY_UP,f=>this._keyUp(f,r))),o.add(J(u,_e.KEY_UP,f=>this._keyUp(f,r)))}}if("IntersectionObserver"in ri){const h=new IntersectionObserver(f=>this._intersectionChange(f,r),{threshold:0}),u="targetElements"in e.target?e.target.targetElements[0]:e.target;h.observe(u),o.add(Re(()=>h.disconnect()))}return this._currentHover=r,r}_showHover(e,t,i){this._contextViewHandler.showContextView(new KUe(e,i),t.container)}hideHover(e){var t;!e&&((t=this._currentHover)!=null&&t.isLocked)||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=os();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,i){var r,a;if(e.key==="Alt"){t.isLocked=!0;return}const s=new ui(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||i&&(!((r=this._currentHoverOptions)!=null&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(a=this._lastFocusedElementBeforeOpen)==null||a.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)==null||i.focus()))}setupManagedHover(e,t,i,s){if(e.showNativeHover)return qUe(t,i);t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(f,g)=>{var m;const p=r!==void 0;f&&(r==null||r.dispose(),r=void 0),g&&(o==null||o.dispose(),o=void 0),p&&((m=e.onDidHideHover)==null||m.call(e),r=void 0)},l=(f,g,p,m)=>new Ca(async()=>{(!r||r.isDisposed)&&(r=new $Ue(e,p||t,f>0),await r.update(typeof i=="function"?i():i,g,{...s,trapFocus:m}))},f),c=new ne;let d=!1;c.add(J(t,_e.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0)),c.add(J(t,_e.MOUSE_UP,()=>{d=!1},!0)),c.add(J(t,_e.MOUSE_LEAVE,f=>{d=!1,a(!1,f.fromElement===t)},!0)),c.add(J(t,_e.MOUSE_OVER,f=>{if(o)return;const g=new ne,p={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const m=b=>{p.x=b.x+10,x9(b,t)||a(!0,!0)};g.add(J(t,_e.MOUSE_MOVE,m,!0))}o=g,x9(f,t)&&g.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,p))},!0));const h=f=>{if(d||o||!x9(f,t))return;const g={targetElements:[t],dispose:()=>{}},p=new ne,m=()=>a(!0,!0);p.add(J(t,_e.BLUR,m,!0)),p.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,g)),o=p};$d(t)||c.add(J(t,_e.FOCUS,h,!0));const u={show:f=>{a(!1,!0),l(0,f,void 0,f)},hide:()=>{a(!0,!0)},update:async(f,g)=>{i=f,await(r==null?void 0:r.update(i,void 0,g))},dispose:()=>{this._managedHovers.delete(t),c.dispose(),a(!0,!0)}};return this._managedHovers.set(t,u),u}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};mz=UUe([yC(0,Ae),yC(1,lt),yC(2,gl),yC(3,Ht),yC(4,Mu),yC(5,Us)],mz);function dp(n){if(n!==void 0)return(n==null?void 0:n.id)??n}function Aoe(n){if(!hn(n))return typeof n=="string"?n.toString():n.value}function Poe(n){const e=typeof n=="function"?n():n;if(ws(e))return wZ(e);if($be(e))return e.markdownNotSupportedFallback}function qUe(n,e){function t(i){i?n.setAttribute("title",i):n.removeAttribute("title")}return t(Poe(e)),{update:i=>t(Poe(i)),show:()=>{},hide:()=>{},dispose:()=>t(void 0)}}class KUe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function x9(n,e){return hn(n.target)&&GUe(n.target,e)===e}function GUe(n,e){for(e=e??Oe(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}xt(Cr,mz,1);gc((n,e)=>{const t=n.getColor(CY);t&&(e.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const YUe={ctrlCmd:!1,alt:!1};var GI;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(GI||(GI={}));var Sd;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Sd||(Sd={}));var Ni;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Ni||(Ni={}));var gP;(function(n){n[n.Title=1]="Title",n[n.Inline=2]="Inline",n[n.Input=3]="Input"})(gP||(gP={}));const Do=mt("quickInputService");var my;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(my||(my={}));var Fb;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Fb||(Fb={}));const V4=class V4 extends G{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Z1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Fb.None,this.cache=new Map,this.flushDelayer=this._register(new jge(V4.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)==null||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)==null||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Fb.Closed)return;let i=!1;Hl(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return Hl(i)?t:i}getBoolean(e,t){const i=this.get(e);return Hl(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Hl(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===Fb.Closed)return;if(Hl(t))return this.delete(e,i);const s=ns(t)||Array.isArray(t)?D$e(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Fb.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())==null||t()})}async flush(e){if(!(this.state===Fb.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===my.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}};V4.DEFAULT_FLUSH_DELAY=100;let Ak=V4;class L9{constructor(){this.onDidChangeItemsExternal=ve.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)==null||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)==null||i.forEach(s=>this.items.delete(s))}}const UR="__$__targetStorageMarker",Qo=mt("storageService");var km;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(km||(km={}));function ZUe(n){const e=n.get(UR);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const z4=class z4 extends G{constructor(e={flushInterval:z4.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Z1),this._onDidChangeTarget=this._register(new Z1),this._onWillSaveState=this._register(new q),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new Kt),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new ai(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return ve.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=$G(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===UR){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(Hl(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))==null||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))==null||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var r,a;const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,(r=this.getStorage(t))==null||r.set(UR,JSON.stringify(o),s)):typeof o[e]=="number"&&(delete o[e],(a=this.getStorage(t))==null||a.set(UR,JSON.stringify(o),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?ZUe(t):Object.create(null)}async flush(e=km.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),s=this.getStorage(1);switch(e){case km.NONE:await aI.settled([(t==null?void 0:t.whenFlushed())??Promise.resolve(),(i==null?void 0:i.whenFlushed())??Promise.resolve(),(s==null?void 0:s.whenFlushed())??Promise.resolve()]);break;case km.SHUTDOWN:await aI.settled([(t==null?void 0:t.flush(0))??Promise.resolve(),(i==null?void 0:i.flush(0))??Promise.resolve(),(s==null?void 0:s.flush(0))??Promise.resolve()]);break}}};z4.DEFAULT_FLUSH_INTERVAL=60*1e3;let _z=z4;class XUe extends _z{constructor(){super(),this.applicationStorage=this._register(new Ak(new L9,{hint:my.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Ak(new L9,{hint:my.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Ak(new L9,{hint:my.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}var QUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ooe=function(n,e){return function(t,i){e(t,i,n)}};const I3=mt("IInlineCompletionsService"),Ube=new Se("inlineCompletions.snoozed",!1,_(79,"Whether inline completions are currently snoozed"));let bz=class extends G{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new q),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new Ca);const i=Ube.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new ze(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(e===0){this.cancelSnooze();return}const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new ze("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),s=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:s,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};bz=QUe([Ooe(0,Xe),Ooe(1,Ro)],bz);xt(I3,bz,1);const JUe="editor.action.inlineSuggest.snooze",eqe="editor.action.inlineSuggest.cancelSnooze",Foe="inlineCompletions.lastSnoozeDuration",j4=class j4 extends Ps{constructor(){super({id:j4.ID,title:ie(81,"Snooze Inline Suggestions"),precondition:le.true(),f1:!0})}async run(e,...t){const i=e.get(Do),s=e.get(I3),o=e.get(Qo);let r;t.length>0&&typeof t[0]=="number"&&(r=t[0]*6e4),r||(r=await this.getDurationFromUser(i,o)),r&&s.setSnoozeDuration(r)}async getDurationFromUser(e,t){const i=t.getNumber(Foe,0,3e5),s=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],o=await e.pick(s,{placeHolder:_(80,"Select snooze duration for Inline Suggestions"),activeItem:s.find(r=>r.value===i)});if(o)return t.store(Foe,o.value,0,0),o.value}};j4.ID=JUe;let vz=j4;const $4=class $4 extends Ps{constructor(){super({id:$4.ID,title:ie(82,"Cancel Snooze Inline Suggestions"),precondition:Ube,f1:!0})}async run(e){e.get(I3).cancelSnooze()}};$4.ID=eqe;let wz=$4;const ID=mt("IWorkspaceEditService");class NZ{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(Em.is(t))return Em.lift(t);if(_y.is(t))return _y.lift(t);throw new Error("Unsupported edit")})}}class Em extends NZ{static is(e){return e instanceof Em?!0:ns(e)&&He.isUri(e.resource)&&ns(e.textEdit)}static lift(e){return e instanceof Em?e:new Em(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class _y extends NZ{static is(e){return e instanceof _y?!0:ns(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof _y?e:new _y(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const Ys={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},N3=Object.freeze({id:"editor",order:5,type:"object",title:_(147,"Editor"),scope:6}),pP={...N3,properties:{"editor.tabSize":{type:"number",default:io.tabSize,minimum:1,maximum:100,markdownDescription:_(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:_(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:io.insertSpaces,markdownDescription:_(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:io.detectIndentation,markdownDescription:_(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:io.trimAutoWhitespace,description:_(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:io.largeFileOptimizations,description:_(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[_(154,"Turn off Word Based Suggestions."),_(155,"Only suggest words from the active document."),_(156,"Suggest words from all open documents of the same language."),_(157,"Suggest words from all open documents.")],description:_(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[_(159,"Semantic highlighting enabled for all color themes."),_(160,"Semantic highlighting disabled for all color themes."),_(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:_(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:_(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:_(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:_(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:_(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:_(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:_(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:_(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:_(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:_(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:_(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:_(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:_(174,"The opening bracket character or string sequence.")},{type:"string",description:_(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:_(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:_(177,"The opening bracket character or string sequence.")},{type:"string",description:_(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Ys.maxComputationTime,description:_(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Ys.maxFileSize,description:_(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Ys.renderSideBySide,description:_(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Ys.renderSideBySideInlineBreakpoint,description:_(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Ys.useInlineViewWhenSpaceIsLimited,description:_(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Ys.renderMarginRevertIcon,description:_(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Ys.renderGutterMenu,description:_(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Ys.ignoreTrimWhitespace,description:_(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Ys.renderIndicators,description:_(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Ys.diffCodeLens,description:_(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Ys.diffWordWrap,markdownEnumDescriptions:[_(189,"Lines will never wrap."),_(190,"Lines will wrap at the viewport width."),_(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Ys.diffAlgorithm,markdownEnumDescriptions:[_(192,"Uses the legacy diffing algorithm."),_(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Ys.hideUnchangedRegions.enabled,markdownDescription:_(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Ys.hideUnchangedRegions.revealLineCount,markdownDescription:_(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Ys.hideUnchangedRegions.minimumLineCount,markdownDescription:_(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Ys.hideUnchangedRegions.contextLineCount,markdownDescription:_(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Ys.experimental.showMoves,markdownDescription:_(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Ys.experimental.showEmptyDecorations,description:_(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Ys.experimental.useTrueInlineView,description:_(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function tqe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of r0){const e=n.schema;if(typeof e<"u")if(tqe(e))pP.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(pP.properties[t]=e[t])}let p2=null;function qbe(){return p2===null&&(p2=Object.create(null),Object.keys(pP.properties).forEach(n=>{p2[n]=!0})),p2}function iqe(n){return qbe()[`editor.${n}`]||!1}function nqe(n){return qbe()[`diffEditor.${n}`]||!1}const sqe=Ji.as(ah.Configuration);sqe.registerConfiguration(pP);class ln{static insert(e,t){return{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function m2(n){return Object.isFrozen(n)?n:OMe(n)}class Vs{static createEmptyModel(e){return new Vs({},[],[],void 0,e)}constructor(e,t,i,s,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof Vs)return t;const i=new oqe("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Tie(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return m2(i.rawConfiguration.getValue(e))},get override(){return t?m2(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return m2(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new Vs(o,a,[],void 0,i.logService).getValue(e);l!==void 0&&s.push({identifiers:r,value:l})}return s.length?m2(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Tie(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=jh(this.contents),i=jh(this.overrides),s=[...this.keys],o=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const r of e)if(o.push(...r.raw?Array.isArray(r.raw)?r.raw:[r.raw]:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[l]=i.filter(c=>Bi(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=bg(l.keys)):i.push(jh(a))}for(const a of r.keys)s.indexOf(a)===-1&&s.push(a)}return new Vs(t,s,i,!o.length||o.every(r=>r instanceof Vs)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of bg([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=jh(o),this.mergeContents(o,r)):o=r),i[s]=o}return new Vs(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&ns(e[i])&&ns(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=jh(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=jh(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),MFe(this.contents,e),s_.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Bi(i.identifiers,vA(e))),1))}updateValue(e,t,i){if(Rpe(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),s_.test(e)){const s=vA(e),o={identifiers:s,keys:Object.keys(this.contents[e]),contents:DH(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>Bi(a.identifiers,s));r!==-1?this.overrides[r]=o:this.overrides.push(o)}}}class oqe{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Vs.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Vs(i,s,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=Ji.as(ah.Configuration),s=i.getConfigurationProperties(),o=i.getExcludedConfigurationProperties(),r=this.filter(e,s,o,!0,t);e=r.raw;const a=DH(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(e),c=this.toOverrides(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,s,o){var c;let r=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(o!=null&&o.skipUnregistered)&&!((c=o==null?void 0:o.exclude)!=null&&c.length))return{raw:e,restricted:[],hasExcludedProperties:r};const a={},l=[];for(const d in e)if(s_.test(d)&&s){const h=this.filter(e[d],t,i,!1,o);a[d]=h.raw,r=r||h.hasExcludedProperties,l.push(...h.restricted)}else{const h=t[d];h!=null&&h.restricted&&l.push(d),this.shouldInclude(d,h,i,o)?a[d]=e[d]:r=!0}return{raw:a,restricted:l,hasExcludedProperties:r}}shouldInclude(e,t,i,s){var a,l;if((a=s.exclude)!=null&&a.includes(e))return!1;if((l=s.include)!=null&&l.includes(e))return!0;if(s.skipRestricted&&(t!=null&&t.restricted)||s.skipUnregistered&&!t)return!1;const o=t??i[e],r=o?typeof o.scope<"u"?o.scope:4:void 0;return r===void 0||s.scopes===void 0?!0:s.scopes.includes(r)}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(s_.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:vA(s),keys:Object.keys(o),contents:DH(o,t)})}return i}}class rqe{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class D3{constructor(e,t,i,s,o,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new kn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=Vs.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new rqe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Vs(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){s=s.merge();for(const o of this._policyConfiguration.keys)s.setValue(o,this._policyConfiguration.getValue(o))}return s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((d,h)=>(d.set(He.revive(h[0]),this.parseConfigurationModel(h[1],t)),d),new kn);return new D3(i,s,o,r,a,l,c,Vs.createEmptyModel(t),new kn,t)}static parseConfigurationModel(e,t){return new Vs(e.contents,e.keys,e.overrides,e.raw,t)}}class aqe{constructor(e,t,i,s,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=o,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=D3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var a;const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const o=s+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(a=this.previous)==null?void 0:a.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!ma(l,c)}return!0}}const mP={kind:0},lqe={kind:1};function cqe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class Pk{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Pk.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||s.length===0)return null;if(s.length===1&&!i)return s[0];for(let o=s.length-1;o>=0;o--){const r=s[o];if(t.contextMatchesRules(r.when))return r}return i?null:s[s.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),mP;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const s=t[i];if(Pk._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Boe(n){return n?`${n.serialize()}`:"no when condition"}function Woe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const dqe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class hqe extends G{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ve.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new q),this._currentChords=[],this._currentChordChecker=new jG,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=b0.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Ca,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const s=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(s)return s.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),mP;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),mP;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw JM("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(_(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(_(1702,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),gu.enabled&&gu.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],gu.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=b0.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=b0.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new b0(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,r,o);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1703,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1704,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(s=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}dqe.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const U4=class U4{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};U4.EMPTY=new U4(null);let b0=U4;class Hoe{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?Cz(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=Cz(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function Cz(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return uqe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:fqe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return gqe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new YPe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class YI extends mqe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Df.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Df.toString(e.keyCode)}_getElectronAccelerator(e){return Df.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Df.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return YI.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Df.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=RG[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Lg)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Lg(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=Cz(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new YI(i,t)]:[]}}const hw=mt("labelService"),Kbe=mt("progressService"),CQ=class CQ{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};CQ.None=Object.freeze({report(){}});let Wd=CQ;const Tg=mt("editorProgressService");class _qe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new by(new wqe(e,t))}static forStrings(){return new by(new _qe)}static forConfigKeys(){return new by(new bqe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new _2,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new _2,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new _2,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new _2,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=gf.unwrap(s.value);s.value=gf.wrap(t),s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],h=o[a+1][0];if(d===1&&h===1)o[a][1]=l.rotateLeft();else if(d===-1&&h===-1)o[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return gf.unwrap((t=this._getNode(e))==null?void 0:t.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)s.push([-1,o]),o=o.left;else if(r<0)s.push([1,o]),o=o.right;else if(i.hasNext())i.next(),s.push([0,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=[[1,o]],a=this._min(o.right,r);if(a.key){o.key=a.key,o.value=a.value,o.segment=a.segment;const l=a.right;if(r.length>1){const[d,h]=r[r.length-1];switch(d){case-1:h.left=l;break;case 0:QE(!1);case 1:QE(!1)}}else o.right=l;const c=this._balanceByStack(r);if(s.length>0){const[d,h]=s[s.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const r=o.left??o.right;if(s.length>0){const[a,l]=s[s.length-1];switch(a){case-1:l.left=r;break;case 0:l.mid=r;break;case 1:l.right=r;break}}else this._root=r}this._root=this._balanceByStack(s)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const s=i.balanceFactor();if(s>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):s<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=gf.unwrap(i.value)||s,i=i.mid;else break}return i&&gf.unwrap(i.value)||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?gf.unwrap(s.value):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,gf.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const Rg=mt("contextService");function yz(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&He.isUri(e.uri)}function Cqe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!yz(n)&&!xqe(n)}const yqe={id:"empty-window"};function Sqe(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:sg(n)}:yqe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function xqe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&He.isUri(e.configPath)}class Lqe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const Sz="code-workspace";_(2050,"Code Workspace");const Gbe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function kqe(n){return n.id===Gbe}var xz;(function(n){n.inspectTokensAction=_(786,"Developer: Inspect Tokens")})(xz||(xz={}));var _P;(function(n){n.gotoLineActionLabel=_(787,"Go to Line/Column...")})(_P||(_P={}));var Lz;(function(n){n.helpQuickAccessActionLabel=_(788,"Show all Quick Access Providers")})(Lz||(Lz={}));var bP;(function(n){n.quickCommandActionLabel=_(789,"Command Palette"),n.quickCommandHelp=_(790,"Show And Run Commands")})(bP||(bP={}));var ZI;(function(n){n.quickOutlineActionLabel=_(791,"Go to Symbol..."),n.quickOutlineByCategoryActionLabel=_(792,"Go to Symbol by Category...")})(ZI||(ZI={}));var kz;(function(n){n.editorViewAccessibleLabel=_(793,"Editor content")})(kz||(kz={}));var Ez;(function(n){n.toggleHighContrast=_(794,"Toggle High Contrast Theme")})(Ez||(Ez={}));var Iz;(function(n){n.bulkEditServiceSummary=_(795,"Made {0} edits in {1} files")})(Iz||(Iz={}));const Ybe=mt("workspaceTrustManagementService");let LS=[],TZ=[],Zbe=[];function b2(n,e=!1){Eqe(n,!1,e)}function Eqe(n,e,t){const i=Iqe(n,e);LS.push(i),i.userConfigured?Zbe.push(i):TZ.push(i),t&&!i.userConfigured&&LS.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function Iqe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?ebe(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(jn.sep)>=0:!1}}function Nqe(){LS=LS.filter(n=>n.userConfigured),TZ=[]}function Dqe(n,e){return Tqe(n,e).map(t=>t.id)}function Tqe(n,e){let t;if(n)switch(n.scheme){case Ge.file:t=n.fsPath;break;case Ge.data:{t=n_.parseMetaData(n).get(n_.META_DATA_LABEL);break}case Ge.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:mn.unknown}];t=t.toLowerCase();const i=sg(t),s=Voe(t,i,Zbe);if(s)return[s,{id:al,mime:mn.text}];const o=Voe(t,i,TZ);if(o)return[o,{id:al,mime:mn.text}];if(e){const r=Rqe(e);if(r)return[r,{id:al,mime:mn.text}]}return[{id:"unknown",mime:mn.unknown}]}function Voe(n,e,t){var r;let i,s,o;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){i=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const c=l.filepatternOnPath?n:e;(r=l.filepatternLowercase)!=null&&r.call(l,c)&&(s=l)}l.extension&&(!o||l.extension.length>o.extension.length)&&e.endsWith(l.extensionLowercase)&&(o=l)}if(i)return i;if(s)return s;if(o)return o}function Rqe(n){if(HG(n)&&(n=n.substr(1)),n.length>0)for(let e=LS.length-1;e>=0;e--){const t=LS[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const v2=Object.prototype.hasOwnProperty,zoe="vs.editor.nullLanguage";class Mqe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(zoe,0),this._register(al,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||zoe}}const uE=class uE extends G{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,uE.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Mqe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(uS.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){uE.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Nqe();const e=[].concat(uS.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),Ji.as(ah.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;v2.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)b2({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)b2({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)b2({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);Age(l)||b2({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?v2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return v2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&v2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Dqe(e,t)}};uE.instanceCount=0;let Nz=uE;const fE=class fE extends G{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new q),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new q),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new q({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,fE.instanceCount++,this._registry=this._register(new Nz(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){fE.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new joe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new joe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=al),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),rn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};fE.instanceCount=0;let Dz=fE;class joe{constructor(e,t){this._value=Ut(this,e,()=>t()),this.onDidChange=ve.fromObservable(this._value)}get languageId(){return this._value.get()}}function dg(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=dg(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function $oe(n){const e=n.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==n&&console.warn(`CSS ident value ${n} modified to ${e} to be safe for CSS`),e}function hp(n){return`'${n.replaceAll(/'/g,"\\000027")}'`}function Su(n){return n?na`url('${CSS.escape(qge.uriToBrowserUri(n).toString(!0))}')`:"url('')"}function w2(n,e=!1){const t=CSS.escape(n);return!e&&t!==n&&console.warn(`CSS class name ${n} modified to ${t} to be safe for CSS`),t}function na(n,...e){return n.reduce((t,i,s)=>{const o=e[s]||"";return t+i+o},"")}class k9{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=` -`){return this._parts.join(e)}}const uw={RESOURCES:"ResourceURLs",TEXT:mn.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},Aqe=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let R3=Aqe;const Pqe=new oo(()=>R3("mouse",!1)),Oqe=new oo(()=>R3("element",!1));function Fqe(n){R3=n}function Au(n){return n==="element"?Oqe.value:Pqe.value}function Xbe(){return R3("element",!0)}let Qbe={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>G.None,setupDelayedHoverAtMouse:()=>G.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Bqe(n){Qbe=n}function ed(){return Qbe}class Wqe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class Y_ extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Uoe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class zqe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=Uoe({start:0,end:e},this.groups),r=Uoe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:Tz(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Vqe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}function $qe(n,e,t,i=[]){if(!n.dataTransfer)return;const s=me(".monaco-drag-image");s.textContent=t,s.classList.add(...i),(a=>{for(;a&&!a.classList.contains("monaco-workbench");)a=a.parentElement;return a||e.ownerDocument.body})(e).appendChild(s),n.dataTransfer.setDragImage(s,-10,-10),setTimeout(()=>s.remove(),0)}var $g=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Z_={CurrentDragAndDropData:void 0},Ch={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class ND{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class Uqe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class qqe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const q4=class q4{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:C7(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=Ch){var r,a;if(this.virtualDelegate=t,this.domId=`list_id_${++q4.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new sc(50),this.splicing=!1,this.dragOverAnimationStopDisposable=G.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=G.None,this.onDragLeaveTimeout=G.None,this.currentSelectionDisposable=G.None,this.disposables=new ne,this._onDidChangeContentHeight=new q,this._onDidChangeContentWidth=new q,this.onDidChangeContentHeight=ve.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const l of i)this.renderers.set(l.templateId,l);if(this.cache=this.disposables.add(new jqe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??Ch.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new Gqe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??Ch.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(No.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new rx({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:l=>Ur(Oe(this.domNode),l)})),this.scrollableElement=this.disposables.add(new m3(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??Ch.alwaysConsumeMouseWheel,horizontal:1,vertical:s.verticalScrollMode??Ch.verticalScrollMode,useShadows:s.useShadows??Ch.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(J(this.rowsContainer,Li.Change,l=>this.onTouchChange(l))),this.disposables.add(J(this.scrollableElement.getDomNode(),"scroll",l=>{const c=l.target,d=c.scrollTop;c.scrollTop=0,s.scrollToActiveElement&&this.setScrollTop(this.scrollTop+d)})),this.disposables.add(J(this.domNode,"dragover",l=>this.onDragOver(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"drop",l=>this.onDrop(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"dragleave",l=>this.onDragLeave(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"dragend",l=>this.onDragEnd(l))),s.userSelection){if(s.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(J(this.domNode,"mousedown",l=>this.onPotentialSelectionStart(l)))}this.setRowLineHeight=s.setRowLineHeight??Ch.setRowLineHeight,this.setRowHeight=s.setRowHeight??Ch.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??Ch.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(Ch.dnd),this.layout((r=s.initialSize)==null?void 0:r.height,(a=s.initialSize)==null?void 0:a.width),s.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(J(e,"focus",()=>{const t=os();this.activeElement!==t&&t!==null&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),o=e.getBoundingClientRect().top-i.top;o<0&&this.setScrollTop(this.scrollTop+o)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new zqe(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=_o.intersect(s,o),a=new Map;for(let S=r.end-1;S>=r.start;S--){const L=this.items[S];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let x=a.get(L.templateId);x||(x=[],a.set(L.templateId,x));const E=this.renderers.get(L.templateId);E&&E.disposeElement&&E.disposeElement(L.element,S,L.row.templateData,{height:L.size}),x.unshift(L.row)}L.row=null,L.stale=!0}const l={start:e+t,end:this.items.length},c=_o.intersect(l,s),d=_o.relativeComplement(l,s),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:G.None,checkedDisposable:G.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=GM(this.items,e,t,h));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=Tz(c,f),m=_o.intersect(g,p);for(let S=m.start;STz(S,f)),C=[{start:e,end:e+i.length},...v].map(S=>_o.intersect(g,S)).reverse();for(const S of C)for(let L=S.end-1;L>=S.start;L--){const x=this.items[L],E=a.get(x.templateId),I=E==null?void 0:E.pop();this.insertItemInDOM(L,I)}for(const S of a.values())for(const L of S)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Ur(Oe(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:XOe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:C7(this.domNode)})}render(e,t,i,s,o,r=!1,a=!1){const l=this.getRenderRange(t,i),c=_o.relativeComplement(l,e).reverse(),d=_o.relativeComplement(e,l);if(r){const h=_o.intersect(e,l);for(let u=h.start;u{for(const h of d)for(let u=h.start;u=h.start;u--)this.insertItemInDOM(u)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var c,d;const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const h=this.cache.alloc(i.templateId);i.row=h.row,i.stale||(i.stale=h.isReusingConnectedDomNode)}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const o=this.accessibilityProvider.isChecked(i.element),r=h=>h==="mixed"?"mixed":String(!!h);if(typeof o=="boolean"||o==="mixed")i.row.domNode.setAttribute("aria-checked",r(o));else if(o){const h=u=>i.row.domNode.setAttribute("aria-checked",r(u));h(o.value),i.checkedDisposable=o.onDidChange(()=>h(o.value))}if(i.stale||!i.row.domNode.parentElement){const h=((d=(c=this.items.at(e+1))==null?void 0:c.row)==null?void 0:d.domNode)??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==h)&&this.rowsContainer.insertBefore(i.row.domNode,h),i.stale=!1}this.updateItemInDOM(i,e);const a=this.renderers.get(i.templateId);if(!a)throw new Error(`No renderer found for template id ${i.templateId}`);a==null||a.renderElement(i.element,e,i.row.templateData,{height:i.size});const l=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!l,l&&(i.dragStartDisposable=J(i.row.domNode,"dragstart",h=>this.onDragStart(i.element,l,h))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=C7(e.row.domNode);const t=Oe(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const s=this.renderers.get(i.templateId);s&&s.disposeElement&&s.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ve.map(this.disposables.add(new ti(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ve.map(this.disposables.add(new ti(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ve.filter(ve.map(this.disposables.add(new ti(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ve.map(this.disposables.add(new ti(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ve.map(this.disposables.add(new ti(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ve.map(this.disposables.add(new ti(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ve.any(ve.map(this.disposables.add(new ti(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ve.map(this.disposables.add(new ti(this.domNode,Li.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ve.map(this.disposables.add(new ti(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ve.map(this.disposables.add(new ti(this.rowsContainer,Li.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var r,a;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(uw.TEXT,t);let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length)),$qe(i,this.domNode,o,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new ND(s),Z_.CurrentDragAndDropData=new Uqe(s),(a=(r=this.dnd).onDragStart)==null||a.call(r,this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=zOe(this.domNode),i=this.currentSelectionDisposable=new ne,s=i.add(new ne);s.add(J(this.domNode,"selectstart",()=>{s.add(J(t,"mousemove",o=>{var r;((r=t.getSelection())==null?void 0:r.isCollapsed)===!1&&this.setupDragAndDropScrollTopAnimation(o)})),i.add(Re(()=>{const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(o,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(J(t,"selectionchange",()=>{const o=t.getSelection();if(!o||o.isCollapsed){s.isDisposed&&i.dispose();return}let r=this.getIndexOfListElement(o.anchorNode),a=this.getIndexOfListElement(o.focusNode);r!==void 0&&a!==void 0&&(a{var o;s.dispose(),this.teardownDragAndDropScrollTopAnimation(),((o=t.getSelection())==null?void 0:o.isCollapsed)!==!1&&i.dispose()}))}getIndexOfListElement(e){var t;if(!(!e||!this.domNode.contains(e)))for(;e&&e!==this.domNode;){if((t=e.dataset)!=null&&t.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){var o,r;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Z_.CurrentDragAndDropData&&Z_.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Z_.CurrentDragAndDropData)this.currentDragData=Z_.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new qqe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&((o=t.effect)==null?void 0:o.type)===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=bg(i).filter(a=>a>=-1&&aa-l),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(Kqe(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Re(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&i[0]{var a;for(const l of i){const c=this.items[l];c.dropTarget=!1,(a=c.row)==null||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=kg(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)==null||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Z_.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Z_.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=G.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=npe(this.domNode).top;this.dragOverAnimationDisposable=a4e(Oe(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=kg(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return rr(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(hn(i)||ape(i))&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const s=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,s),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),s)}return i}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=l.start;u=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Zqe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let vP=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new Zqe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new q}splice(e,t,i){const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(Koe),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=Rz(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return KM(this.sortedIndexes,e,Koe)>=0}dispose(){Jt(this._onChange)}};S_([wn],vP.prototype,"renderer",null);class Xqe extends vP{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class E9{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function DD(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:DD(n.parentElement,e)}function PL(n){return DD(n,"monaco-editor")}function Qqe(n){return DD(n,"monaco-custom-toggle")}function Jqe(n){return DD(n,"action-item")}function Ok(n){return DD(n,"monaco-tree-sticky-row")}function XI(n){return n.classList.contains("monaco-tree-sticky-container")}function Jbe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Jbe(n.parentElement)}class eve{get onKeyDown(){return ve.chain(this.disposables.add(new ti(this.view.domNode,"keydown")).event,e=>e.filter(t=>!$d(t.target)).map(t=>new ui(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new ne,this.multipleSelectionDisposables=new ne,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(wt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(or(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}S_([wn],eve.prototype,"onKeyDown",null);var Xh;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Xh||(Xh={}));var v0;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(v0||(v0={}));const eKe=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class tKe{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=v0.Idle,this.mode=Xh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new ne,this.disposables=new ne,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Xh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ve.chain(this.enabledDisposables.add(new ti(this.view.domNode,"keydown")).event,o=>o.filter(r=>!$d(r.target)).filter(()=>this.mode===Xh.Automatic||this.triggered).map(r=>new ui(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>Wt.stop(r,!0)).map(r=>r.browserEvent.key)),i=ve.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ve.reduce(ve.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var t;const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const i=(t=this.list.options.accessibilityProvider)==null?void 0:t.getAriaLabel(this.list.element(e[0]));typeof i=="string"?_r(i):i&&_r(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=v0.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===v0.Idle?1:0;this.state=v0.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||jI(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class iKe{constructor(e,t){this.list=e,this.view=t,this.disposables=new ne;const i=ve.chain(this.disposables.add(new ti(t.domNode,"keydown")).event,o=>o.filter(r=>!$d(r.target)).map(r=>new ui(r)));ve.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!hn(s)||s.tabIndex===-1)return;const o=Oe(s).getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function tve(n){return wt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function ive(n){return n.browserEvent.shiftKey}function nKe(n){return eY(n)&&n.button===2}const qoe={isSelectionSingleChangeEvent:tve,isSelectionRangeChangeEvent:ive};class nve{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new ne,this._onPointer=this.disposables.add(new q),e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||qoe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(No.addTarget(e.getHTMLElement()))),ve.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||qoe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){PL(e.browserEvent.target)||os()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if($d(e.browserEvent.target)||PL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||$d(e.browserEvent.target)||PL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),nKe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if($d(e.browserEvent.target)||PL(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),o=Math.max(i,t),r=or(s,o+1),a=this.list.getSelection(),l=aKe(Rz(a,[i]),i);if(l.length===0)return;const c=Rz(r,lKe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class sKe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` +`;var WUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},HUe=function(n,e){return function(t,i){e(t,i,n)}};let fP=class extends G{constructor(e){super(),this.layoutService=e,this.contextView=this._register(new gz(this.layoutService.mainContainer,1)),this.layout(),this._register(e.onDidLayoutContainer(()=>this.layout()))}showContextView(e,t,i){let s;t?t===this.layoutService.getContainer(Pe(t))?s=1:i?s=3:s=2:s=1,this.contextView.setContainer(t??this.layoutService.activeContainer,s),this.contextView.show(e);const o={close:()=>{this.openContextView===o&&this.hideContextView()}};return this.openContextView=o,o}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e),this.openContextView=void 0}};fP=WUe([HUe(0,Au)],fP);class VUe extends fP{getContextViewElement(){return this.contextView.getViewElement()}}function Hbe(n){const e=n;return typeof e=="object"&&"markdown"in e&&"markdownNotSupportedFallback"in e}class zUe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}async update(e,t,i){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(Cs(e)||hn(e)||e===void 0)s=e;else{this._cancellationTokenSource=new Bi;const o=this._cancellationTokenSource.token;let r;if(Hbe(e)?U1(e.markdown)?r=e.markdown(o).then(a=>a??e.markdownNotSupportedFallback):r=e.markdown??e.markdownNotSupportedFallback:r=e.element(o),r instanceof Promise?(this._hoverWidget||this.show(_(1700,"Loading..."),t,i),s=await r):s=r,this.isDisposed||o.isCancellationRequested)return}this.show(s,t,i)}show(e,t,i){var o;const s=this._hoverWidget;if(this.hasContent(e)){const r={content:e,target:this.target,actions:i==null?void 0:i.actions,linkHandler:i==null?void 0:i.linkHandler,trapFocus:i==null?void 0:i.trapFocus,appearance:{showPointer:this.hoverDelegate.placement==="element",skipFadeInAnimation:!this.fadeInAnimation||!!s,showHoverHint:(o=i==null?void 0:i.appearance)==null?void 0:o.showHoverHint},position:{hoverPosition:2}};this._hoverWidget=this.hoverDelegate.showHover(r,t)}s==null||s.dispose()}hasContent(e){return e?cg(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)==null?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)==null||e.dispose(),(t=this._cancellationTokenSource)==null||t.dispose(!0),this._cancellationTokenSource=void 0}}var jUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_C=function(n,e){return function(t,i){e(t,i,n)}};let pz=class extends G{constructor(e,t,i,s,o,r){super(),this._instantiationService=e,this._configurationService=t,this._keybindingService=s,this._layoutService=o,this._accessibilityService=r,this._currentDelayedHoverWasShown=!1,this._delayedHovers=new Map,this._managedHovers=new Map,this._register(i.onDidShowContextMenu(()=>this.hideHover())),this._contextViewHandler=this._register(new fP(this._layoutService)),this._register(As.registerCommandAndKeybindingRule({id:"workbench.action.showHover",weight:0,primary:Fn(2089,2087),handler:()=>{this._showAndFocusHoverForActiveElement()}}))}showInstantHover(e,t,i,s){const o=this._createHover(e,i);if(o)return this._showHover(o,e,t),o}showDelayedHover(e,t){var s;if(e.id===void 0&&(e.id=Roe(e.content)),!this._currentDelayedHover||this._currentDelayedHoverWasShown){if((s=this._currentHover)!=null&&s.isLocked)return;if(dp(this._currentHoverOptions)===dp(e))return this._currentHover;if(this._currentHover&&!this._currentHover.isDisposed&&this._currentDelayedHoverGroupId!==void 0&&this._currentDelayedHoverGroupId===(t==null?void 0:t.groupId))return this.showInstantHover({...e,appearance:{...e.appearance,skipFadeInAnimation:!0}})}else if(this._currentDelayedHover&&dp(this._currentHoverOptions)===dp(e))return this._currentDelayedHover;const i=this._createHover(e,void 0);if(!i){this._currentDelayedHover=void 0,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=void 0;return}return this._currentDelayedHover=i,this._currentDelayedHoverWasShown=!1,this._currentDelayedHoverGroupId=t==null?void 0:t.groupId,wu(this._configurationService.getValue("workbench.hover.delay")).then(()=>{i&&!i.isDisposed&&(this._currentDelayedHoverWasShown=!0,this._showHover(i,e))}),i}setupDelayedHover(e,t,i){const s=()=>({...typeof t=="function"?t():t,target:e});return this._setupDelayedHover(e,s,i)}setupDelayedHoverAtMouse(e,t,i){const s=o=>({...typeof t=="function"?t():t,target:{targetElements:[e],x:o!==void 0?o.x+10:void 0}});return this._setupDelayedHover(e,s,i)}_setupDelayedHover(e,t,i){const s=new ne;return s.add(J(e,_e.MOUSE_OVER,o=>{this.showDelayedHover(t(o),{groupId:i==null?void 0:i.groupId})})),i!=null&&i.setupKeyboardEvents&&s.add(J(e,_e.KEY_DOWN,o=>{const r=new ui(o);(r.equals(10)||r.equals(3))&&this.showInstantHover(t(),!0)})),this._delayedHovers.set(e,{show:o=>{this.showInstantHover(t(),o)}}),s.add(Re(()=>this._delayedHovers.delete(e))),s}_createHover(e,t){var a,l,c,d;if(this._currentDelayedHover=void 0,e.content===""||(a=this._currentHover)!=null&&a.isLocked||(e.id===void 0&&(e.id=Roe(e.content)),dp(this._currentHoverOptions)===dp(e)))return;this._currentHoverOptions=e,this._lastHoverOptions=e;const i=e.trapFocus||this._accessibilityService.isScreenReaderOptimized(),s=as();t||(i&&s?s.classList.contains("monaco-hover")||(this._lastFocusedElementBeforeOpen=s):this._lastFocusedElementBeforeOpen=void 0);const o=new ne,r=this._instantiationService.createInstance(fz,e);if((l=e.persistence)!=null&&l.sticky&&(r.isLocked=!0),(c=e.position)!=null&&c.hoverPosition&&!wg(e.position.hoverPosition)&&(e.target={targetElements:hn(e.target)?[e.target]:e.target.targetElements,x:e.position.hoverPosition.x+10}),r.onDispose(()=>{var u,f;((u=this._currentHover)==null?void 0:u.domNode)&&ipe(this._currentHover.domNode)&&((f=this._lastFocusedElementBeforeOpen)==null||f.focus()),dp(this._currentHoverOptions)===dp(e)&&this.doHideHover(),o.dispose()},void 0,o),!e.container){const h=hn(e.target)?e.target:e.target.targetElements[0];e.container=this._layoutService.getContainer(Pe(h))}if(r.onRequestLayout(()=>this._contextViewHandler.layout(),void 0,o),(d=e.persistence)!=null&&d.sticky)o.add(J(Pe(e.container).document,_e.MOUSE_DOWN,h=>{ys(h.target,r.domNode)||this.doHideHover()}));else{if("targetElements"in e.target)for(const u of e.target.targetElements)o.add(J(u,_e.CLICK,()=>this.hideHover()));else o.add(J(e.target,_e.CLICK,()=>this.hideHover()));const h=as();if(h){const u=Pe(h).document;o.add(J(h,_e.KEY_DOWN,f=>{var g;return this._keyDown(f,r,!!((g=e.persistence)!=null&&g.hideOnKeyDown))})),o.add(J(u,_e.KEY_DOWN,f=>{var g;return this._keyDown(f,r,!!((g=e.persistence)!=null&&g.hideOnKeyDown))})),o.add(J(h,_e.KEY_UP,f=>this._keyUp(f,r))),o.add(J(u,_e.KEY_UP,f=>this._keyUp(f,r)))}}if("IntersectionObserver"in ri){const h=new IntersectionObserver(f=>this._intersectionChange(f,r),{threshold:0}),u="targetElements"in e.target?e.target.targetElements[0]:e.target;h.observe(u),o.add(Re(()=>h.disconnect()))}return this._currentHover=r,r}_showHover(e,t,i){this._contextViewHandler.showContextView(new UUe(e,i),t.container)}hideHover(e){var t;!e&&((t=this._currentHover)!=null&&t.isLocked)||!this._currentHoverOptions||this.doHideHover()}doHideHover(){this._currentHover=void 0,this._currentHoverOptions=void 0,this._contextViewHandler.hideContextView()}_intersectionChange(e,t){e[e.length-1].isIntersecting||t.dispose()}showAndFocusLastHover(){this._lastHoverOptions&&this.showInstantHover(this._lastHoverOptions,!0,!0)}_showAndFocusHoverForActiveElement(){let e=as();for(;e;){const t=this._delayedHovers.get(e)??this._managedHovers.get(e);if(t){t.show(!0);return}e=e.parentElement}}_keyDown(e,t,i){var r,a;if(e.key==="Alt"){t.isLocked=!0;return}const s=new ui(e);this._keybindingService.resolveKeyboardEvent(s).getSingleModifierDispatchChords().some(l=>!!l)||this._keybindingService.softDispatch(s,s.target).kind!==0||i&&(!((r=this._currentHoverOptions)!=null&&r.trapFocus)||e.key!=="Tab")&&(this.hideHover(),(a=this._lastFocusedElementBeforeOpen)==null||a.focus())}_keyUp(e,t){var i;e.key==="Alt"&&(t.isLocked=!1,t.isMouseIn||(this.hideHover(),(i=this._lastFocusedElementBeforeOpen)==null||i.focus()))}setupManagedHover(e,t,i,s){if(e.showNativeHover)return $Ue(t,i);t.setAttribute("custom-hover","true"),t.title!==""&&(console.warn("HTML element already has a title attribute, which will conflict with the custom hover. Please remove the title attribute."),console.trace("Stack trace:",t.title),t.title="");let o,r;const a=(f,g)=>{var m;const p=r!==void 0;f&&(r==null||r.dispose(),r=void 0),g&&(o==null||o.dispose(),o=void 0),p&&((m=e.onDidHideHover)==null||m.call(e),r=void 0)},l=(f,g,p,m)=>new ya(async()=>{(!r||r.isDisposed)&&(r=new zUe(e,p||t,f>0),await r.update(typeof i=="function"?i():i,g,{...s,trapFocus:m}))},f),c=new ne;let d=!1;c.add(J(t,_e.MOUSE_DOWN,()=>{d=!0,a(!0,!0)},!0)),c.add(J(t,_e.MOUSE_UP,()=>{d=!1},!0)),c.add(J(t,_e.MOUSE_LEAVE,f=>{d=!1,a(!1,f.fromElement===t)},!0)),c.add(J(t,_e.MOUSE_OVER,f=>{if(o)return;const g=new ne,p={targetElements:[t],dispose:()=>{}};if(e.placement===void 0||e.placement==="mouse"){const m=b=>{p.x=b.x+10,x9(b,t)||a(!0,!0)};g.add(J(t,_e.MOUSE_MOVE,m,!0))}o=g,x9(f,t)&&g.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,p))},!0));const h=f=>{if(d||o||!x9(f,t))return;const g={targetElements:[t],dispose:()=>{}},p=new ne,m=()=>a(!0,!0);p.add(J(t,_e.BLUR,m,!0)),p.add(l(typeof e.delay=="function"?e.delay(i):e.delay,!1,g)),o=p};qd(t)||c.add(J(t,_e.FOCUS,h,!0));const u={show:f=>{a(!1,!0),l(0,f,void 0,f)},hide:()=>{a(!0,!0)},update:async(f,g)=>{i=f,await(r==null?void 0:r.update(i,void 0,g))},dispose:()=>{this._managedHovers.delete(t),c.dispose(),a(!0,!0)}};return this._managedHovers.set(t,u),u}showManagedHover(e){const t=this._managedHovers.get(e);t&&t.show(!0)}dispose(){this._managedHovers.forEach(e=>e.dispose()),super.dispose()}};pz=jUe([_C(0,Ae),_C(1,lt),_C(2,gl),_C(3,Vt),_C(4,Au),_C(5,Us)],pz);function dp(n){if(n!==void 0)return(n==null?void 0:n.id)??n}function Roe(n){if(!hn(n))return typeof n=="string"?n.toString():n.value}function Moe(n){const e=typeof n=="function"?n():n;if(Cs(e))return vZ(e);if(Hbe(e))return e.markdownNotSupportedFallback}function $Ue(n,e){function t(i){i?n.setAttribute("title",i):n.removeAttribute("title")}return t(Moe(e)),{update:i=>t(Moe(i)),show:()=>{},hide:()=>{},dispose:()=>t(void 0)}}class UUe{get anchorPosition(){return this._hover.anchor}constructor(e,t=!1){this._hover=e,this._focus=t,this.layer=1}render(e){return this._hover.render(e),this._focus&&this._hover.focus(),this._hover}getAnchor(){return{x:this._hover.x,y:this._hover.y}}layout(){this._hover.layout()}}function x9(n,e){return hn(n.target)&&qUe(n.target,e)===e}function qUe(n,e){for(e=e??Pe(n).document.body;!n.hasAttribute("custom-hover")&&n!==e;)n=n.parentElement;return n}Lt(Sr,pz,1);dc((n,e)=>{const t=n.getColor(wY);t&&(e.addRule(`.monaco-hover.workbench-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-hover.workbench-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`))});const KUe={ctrlCmd:!1,alt:!1};var GE;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(GE||(GE={}));var Ld;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Ld||(Ld={}));var Ii;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage",n[n.NextSeparator=8]="NextSeparator",n[n.PreviousSeparator=9]="PreviousSeparator"})(Ii||(Ii={}));var gP;(function(n){n[n.Title=1]="Title",n[n.Inline=2]="Inline",n[n.Input=3]="Input"})(gP||(gP={}));const No=mt("quickInputService");var gy;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(gy||(gy={}));var Ob;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Ob||(Ob={}));const V4=class V4 extends G{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new K1),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Ob.None,this.cache=new Map,this.flushDelayer=this._register(new Wge(V4.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)==null||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)==null||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Ob.Closed)return;let i=!1;Ol(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return Ol(i)?t:i}getBoolean(e,t){const i=this.get(e);return Ol(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return Ol(i)?t:parseInt(i,10)}async set(e,t,i=!1){if(this.state===Ob.Closed)return;if(Ol(t))return this.delete(e,i);const s=os(t)||Array.isArray(t)?E$e(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Ob.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())==null||t()})}async flush(e){if(!(this.state===Ob.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===gy.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}};V4.DEFAULT_FLUSH_DELAY=100;let Ak=V4;class L9{constructor(){this.onDidChangeItemsExternal=ve.None,this.items=new Map}async updateItems(e){var t,i;(t=e.insert)==null||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)==null||i.forEach(s=>this.items.delete(s))}}const qR="__$__targetStorageMarker",Jo=mt("storageService");var Lm;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(Lm||(Lm={}));function GUe(n){const e=n.get(qR);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const z4=class z4 extends G{constructor(e={flushInterval:z4.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new K1),this._onDidChangeTarget=this._register(new K1),this._onWillSaveState=this._register(new q),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new Gt),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new ai(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return ve.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=jG(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===qR){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))==null?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(Ol(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))==null||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))==null||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var r,a;const o=this.getKeyTargets(t);typeof i=="number"?o[e]!==i&&(o[e]=i,(r=this.getStorage(t))==null||r.set(qR,JSON.stringify(o),s)):typeof o[e]=="number"&&(delete o[e],(a=this.getStorage(t))==null||a.set(qR,JSON.stringify(o),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?GUe(t):Object.create(null)}async flush(e=Lm.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(-1),i=this.getStorage(0),s=this.getStorage(1);switch(e){case Lm.NONE:await aE.settled([(t==null?void 0:t.whenFlushed())??Promise.resolve(),(i==null?void 0:i.whenFlushed())??Promise.resolve(),(s==null?void 0:s.whenFlushed())??Promise.resolve()]);break;case Lm.SHUTDOWN:await aE.settled([(t==null?void 0:t.flush(0))??Promise.resolve(),(i==null?void 0:i.flush(0))??Promise.resolve(),(s==null?void 0:s.flush(0))??Promise.resolve()]);break}}};z4.DEFAULT_FLUSH_INTERVAL=60*1e3;let mz=z4;class YUe extends mz{constructor(){super(),this.applicationStorage=this._register(new Ak(new L9,{hint:gy.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Ak(new L9,{hint:gy.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Ak(new L9,{hint:gy.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}shouldFlushWhenIdle(){return!1}}var ZUe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Aoe=function(n,e){return function(t,i){e(t,i,n)}};const E3=mt("IInlineCompletionsService"),Vbe=new Se("inlineCompletions.snoozed",!1,_(79,"Whether inline completions are currently snoozed"));let _z=class extends G{get snoozeTimeLeft(){return this._snoozeTimeEnd===void 0?0:Math.max(0,this._snoozeTimeEnd-Date.now())}constructor(e,t){super(),this._contextKeyService=e,this._telemetryService=t,this._onDidChangeIsSnoozing=this._register(new q),this.onDidChangeIsSnoozing=this._onDidChangeIsSnoozing.event,this._snoozeTimeEnd=void 0,this._recentCompletionIds=[],this._timer=this._register(new ya);const i=Vbe.bindTo(this._contextKeyService);this._register(this.onDidChangeIsSnoozing(()=>i.set(this.isSnoozing())))}setSnoozeDuration(e){if(e<0)throw new Ve(`Invalid snooze duration: ${e}. Duration must be non-negative.`);if(e===0){this.cancelSnooze();return}const t=this.isSnoozing(),i=this.snoozeTimeLeft;this._snoozeTimeEnd=Date.now()+e,t||this._onDidChangeIsSnoozing.fire(!0),this._timer.cancelAndSet(()=>{if(!this.isSnoozing())this._onDidChangeIsSnoozing.fire(!1);else throw new Ve("Snooze timer did not fire as expected")},this.snoozeTimeLeft+1),this._reportSnooze(e-i,e)}isSnoozing(){return this.snoozeTimeLeft>0}cancelSnooze(){this.isSnoozing()&&(this._reportSnooze(-this.snoozeTimeLeft,0),this._snoozeTimeEnd=void 0,this._timer.cancel(),this._onDidChangeIsSnoozing.fire(!1))}reportNewCompletion(e){this._lastCompletionId=e,this._recentCompletionIds.unshift(e),this._recentCompletionIds.length>5&&this._recentCompletionIds.pop()}_reportSnooze(e,t){const i=Math.round(e/1e3),s=Math.round(t/1e3);this._telemetryService.publicLog2("inlineCompletions.snooze",{deltaSeconds:i,totalSeconds:s,lastCompletionId:this._lastCompletionId,recentCompletionIds:this._recentCompletionIds})}};_z=ZUe([Aoe(0,Xe),Aoe(1,To)],_z);Lt(E3,_z,1);const XUe="editor.action.inlineSuggest.snooze",QUe="editor.action.inlineSuggest.cancelSnooze",Poe="inlineCompletions.lastSnoozeDuration",j4=class j4 extends Ps{constructor(){super({id:j4.ID,title:ie(81,"Snooze Inline Suggestions"),precondition:le.true(),f1:!0})}async run(e,...t){const i=e.get(No),s=e.get(E3),o=e.get(Jo);let r;t.length>0&&typeof t[0]=="number"&&(r=t[0]*6e4),r||(r=await this.getDurationFromUser(i,o)),r&&s.setSnoozeDuration(r)}async getDurationFromUser(e,t){const i=t.getNumber(Poe,0,3e5),s=[{label:"1 minute",id:"1",value:6e4},{label:"5 minutes",id:"5",value:3e5},{label:"10 minutes",id:"10",value:6e5},{label:"15 minutes",id:"15",value:9e5},{label:"30 minutes",id:"30",value:18e5},{label:"60 minutes",id:"60",value:36e5}],o=await e.pick(s,{placeHolder:_(80,"Select snooze duration for Inline Suggestions"),activeItem:s.find(r=>r.value===i)});if(o)return t.store(Poe,o.value,0,0),o.value}};j4.ID=XUe;let bz=j4;const $4=class $4 extends Ps{constructor(){super({id:$4.ID,title:ie(82,"Cancel Snooze Inline Suggestions"),precondition:Vbe,f1:!0})}async run(e){e.get(E3).cancelSnooze()}};$4.ID=QUe;let vz=$4;const ED=mt("IWorkspaceEditService");class EZ{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(km.is(t))return km.lift(t);if(py.is(t))return py.lift(t);throw new Error("Unsupported edit")})}}class km extends EZ{static is(e){return e instanceof km?!0:os(e)&&He.isUri(e.resource)&&os(e.textEdit)}static lift(e){return e instanceof km?e:new km(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class py extends EZ{static is(e){return e instanceof py?!0:os(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof py?e:new py(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const Zs={enableSplitViewResizing:!0,renderSideBySide:!0,renderMarginRevertIcon:!0,renderGutterMenu:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0,useTrueInlineView:!1},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0,compactMode:!1},N3=Object.freeze({id:"editor",order:5,type:"object",title:_(147,"Editor"),scope:6}),pP={...N3,properties:{"editor.tabSize":{type:"number",default:no.tabSize,minimum:1,maximum:100,markdownDescription:_(148,"The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:_(149,'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:no.insertSpaces,markdownDescription:_(150,"Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:no.detectIndentation,markdownDescription:_(151,"Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:no.trimAutoWhitespace,description:_(152,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:no.largeFileOptimizations,description:_(153,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{enum:["off","currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[_(154,"Turn off Word Based Suggestions."),_(155,"Only suggest words from the active document."),_(156,"Suggest words from all open documents of the same language."),_(157,"Suggest words from all open documents.")],description:_(158,"Controls whether completions should be computed based on words in the document and from which documents they are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[_(159,"Semantic highlighting enabled for all color themes."),_(160,"Semantic highlighting disabled for all color themes."),_(161,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:_(162,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:_(163,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:_(164,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!0,description:_(165,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:_(166,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:_(167,"Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.experimental.treeSitterTelemetry":{type:"boolean",default:!1,markdownDescription:_(168,"Controls whether tree sitter parsing should be turned on and telemetry collected. Setting `#editor.experimental.preferTreeSitter#` for specific languages will take precedence."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.css":{type:"boolean",default:!1,markdownDescription:_(169,"Controls whether tree sitter parsing should be turned on for css. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for css."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.typescript":{type:"boolean",default:!1,markdownDescription:_(170,"Controls whether tree sitter parsing should be turned on for typescript. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for typescript."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.ini":{type:"boolean",default:!1,markdownDescription:_(171,"Controls whether tree sitter parsing should be turned on for ini. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for ini."),tags:["experimental"],experiment:{mode:"auto"}},"editor.experimental.preferTreeSitter.regex":{type:"boolean",default:!1,markdownDescription:_(172,"Controls whether tree sitter parsing should be turned on for regex. This will take precedence over `#editor.experimental.treeSitterTelemetry#` for regex."),tags:["experimental"],experiment:{mode:"auto"}},"editor.language.brackets":{type:["array","null"],default:null,description:_(173,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:_(174,"The opening bracket character or string sequence.")},{type:"string",description:_(175,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:_(176,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:_(177,"The opening bracket character or string sequence.")},{type:"string",description:_(178,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:Zs.maxComputationTime,description:_(179,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:Zs.maxFileSize,description:_(180,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:Zs.renderSideBySide,description:_(181,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:Zs.renderSideBySideInlineBreakpoint,description:_(182,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:Zs.useInlineViewWhenSpaceIsLimited,description:_(183,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:Zs.renderMarginRevertIcon,description:_(184,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.renderGutterMenu":{type:"boolean",default:Zs.renderGutterMenu,description:_(185,"When enabled, the diff editor shows a special gutter for revert and stage actions.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:Zs.ignoreTrimWhitespace,description:_(186,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:Zs.renderIndicators,description:_(187,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:Zs.diffCodeLens,description:_(188,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:Zs.diffWordWrap,markdownEnumDescriptions:[_(189,"Lines will never wrap."),_(190,"Lines will wrap at the viewport width."),_(191,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:Zs.diffAlgorithm,markdownEnumDescriptions:[_(192,"Uses the legacy diffing algorithm."),_(193,"Uses the advanced diffing algorithm.")]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:Zs.hideUnchangedRegions.enabled,markdownDescription:_(194,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:Zs.hideUnchangedRegions.revealLineCount,markdownDescription:_(195,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:Zs.hideUnchangedRegions.minimumLineCount,markdownDescription:_(196,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:Zs.hideUnchangedRegions.contextLineCount,markdownDescription:_(197,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:Zs.experimental.showMoves,markdownDescription:_(198,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:Zs.experimental.showEmptyDecorations,description:_(199,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")},"diffEditor.experimental.useTrueInlineView":{type:"boolean",default:Zs.experimental.useTrueInlineView,description:_(200,"If enabled and the editor uses the inline view, word changes are rendered inline.")}}};function JUe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of s0){const e=n.schema;if(typeof e<"u")if(JUe(e))pP.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(pP.properties[t]=e[t])}let m2=null;function zbe(){return m2===null&&(m2=Object.create(null),Object.keys(pP.properties).forEach(n=>{m2[n]=!0})),m2}function eqe(n){return zbe()[`editor.${n}`]||!1}function tqe(n){return zbe()[`diffEditor.${n}`]||!1}const iqe=Ji.as(ch.Configuration);iqe.registerConfiguration(pP);class ln{static insert(e,t){return{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function _2(n){return Object.isFrozen(n)?n:AMe(n)}class Vs{static createEmptyModel(e){return new Vs({},[],[],void 0,e)}constructor(e,t,i,s,o){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.logService=o,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof Vs)return t;const i=new nqe("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Nie(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return _2(i.rawConfiguration.getValue(e))},get override(){return t?_2(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return _2(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:o,identifiers:r,keys:a}of i.rawConfiguration.overrides){const l=new Vs(o,a,[],void 0,i.logService).getValue(e);l!==void 0&&s.push({identifiers:r,value:l})}return s.length?_2(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Nie(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=$h(this.contents),i=$h(this.overrides),s=[...this.keys],o=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const r of e)if(o.push(...r.raw?Array.isArray(r.raw)?r.raw:[r.raw]:[r]),!r.isEmpty()){this.mergeContents(t,r.contents);for(const a of r.overrides){const[l]=i.filter(c=>Fi(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=bg(l.keys)):i.push($h(a))}for(const a of r.keys)s.indexOf(a)===-1&&s.push(a)}return new Vs(t,s,i,!o.length||o.every(r=>r instanceof Vs)?void 0:o,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of bg([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=$h(o),this.mergeContents(o,r)):o=r),i[s]=o}return new Vs(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&os(e[i])&&os(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=$h(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=$h(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),TFe(this.contents,e),n_.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Fi(i.identifiers,vA(e))),1))}updateValue(e,t,i){if(Epe(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),n_.test(e)){const s=vA(e),o={identifiers:s,keys:Object.keys(this.contents[e]),contents:NH(this.contents[e],a=>this.logService.error(a))},r=this.overrides.findIndex(a=>Fi(a.identifiers,s));r!==-1?this.overrides[r]=o:this.overrides.push(o)}}}class nqe{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||Vs.createEmptyModel(this.logService)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Vs(i,s,o,a?[e]:void 0,this.logService),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=Ji.as(ch.Configuration),s=i.getConfigurationProperties(),o=i.getExcludedConfigurationProperties(),r=this.filter(e,s,o,!0,t);e=r.raw;const a=NH(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`)),l=Object.keys(e),c=this.toOverrides(e,d=>this.logService.error(`Conflict in settings file ${this._name}: ${d}`));return{contents:a,keys:l,overrides:c,restricted:r.restricted,hasExcludedProperties:r.hasExcludedProperties}}filter(e,t,i,s,o){var c;let r=!1;if(!(o!=null&&o.scopes)&&!(o!=null&&o.skipRestricted)&&!(o!=null&&o.skipUnregistered)&&!((c=o==null?void 0:o.exclude)!=null&&c.length))return{raw:e,restricted:[],hasExcludedProperties:r};const a={},l=[];for(const d in e)if(n_.test(d)&&s){const h=this.filter(e[d],t,i,!1,o);a[d]=h.raw,r=r||h.hasExcludedProperties,l.push(...h.restricted)}else{const h=t[d];h!=null&&h.restricted&&l.push(d),this.shouldInclude(d,h,i,o)?a[d]=e[d]:r=!0}return{raw:a,restricted:l,hasExcludedProperties:r}}shouldInclude(e,t,i,s){var a,l;if((a=s.exclude)!=null&&a.includes(e))return!1;if((l=s.include)!=null&&l.includes(e))return!0;if(s.skipRestricted&&(t!=null&&t.restricted)||s.skipUnregistered&&!t)return!1;const o=t??i[e],r=o?typeof o.scope<"u"?o.scope:4:void 0;return r===void 0||s.scopes===void 0?!0:s.scopes.includes(r)}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(n_.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:vA(s),keys:Object.keys(o),contents:NH(o,t)})}return i}}class sqe{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=h,this.folderConfigurationModel=u,this.memoryConfigurationModel=f}toInspectValue(e){return(e==null?void 0:e.value)!==void 0||(e==null?void 0:e.override)!==void 0||(e==null?void 0:e.overrides)!==void 0?e:void 0}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.toInspectValue(this.userInspectValue)}}class D3{constructor(e,t,i,s,o,r,a,l,c,d){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=d,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new En,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=Vs.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new sqe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Vs(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){s=s.merge();for(const o of this._policyConfiguration.keys)s.setValue(o,this._policyConfiguration.getValue(o))}return s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),o=this.parseConfigurationModel(e.application,t),r=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((d,h)=>(d.set(He.revive(h[0]),this.parseConfigurationModel(h[1],t)),d),new En);return new D3(i,s,o,r,a,l,c,Vs.createEmptyModel(t),new En,t)}static parseConfigurationModel(e,t){return new Vs(e.contents,e.keys,e.overrides,e.raw,t)}}class oqe{constructor(e,t,i,s,o){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=o,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const r of e.keys)this.affectedKeys.add(r);for(const[,r]of e.overrides)for(const a of r)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const r of this.affectedKeys)this._affectsConfigStr+=r+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=D3.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){var a;const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const o=s+i.length;if(o>=this._affectsConfigStr.length)return!1;const r=this._affectsConfigStr.charCodeAt(o);if(r!==this._markerCode1&&r!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(a=this.previous)==null?void 0:a.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!_a(l,c)}return!0}}const mP={kind:0},rqe={kind:1};function aqe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class Pk{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=Pk.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||s.length===0)return null;if(s.length===1&&!i)return s[0];for(let o=s.length-1;o>=0;o--){const r=s[o];if(t.contextMatchesRules(r.when))return r}return i?null:s[s.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),mP;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let h=!0;for(let u=1;u=0;i--){const s=t[i];if(Pk._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function Ooe(n){return n?`${n.serialize()}`:"no when condition"}function Foe(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const lqe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class cqe extends G{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ve.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new q),this._currentChords=[],this._currentChordChecker=new zG,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=m0.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new ya,this._currentlyDispatchingCommandId=null,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t,i=!1){const s=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService,i);if(s)return s.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),mP;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),mP;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw JM("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(_(1701,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(_(1702,"({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),pu.enabled&&pu.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.close(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],pu.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=m0.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=m0.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new m0(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[d]=e.getSingleModifierDispatchChords();o=d,r=d?[d]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map(({keypress:d})=>d);if(o===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),c=this._getResolver().resolve(a,r,o);switch(c.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1703,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}return s}case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,l),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:{if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${c.commandId} ]`),c.commandId===null||c.commandId===""){if(this.inChordMode){const d=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${d}, ${l}".`),this._notificationService.status(_(1704,"The key combination ({0}, {1}) is not a command.",d,l),{hideAfter:10*1e3}),this._leaveChordMode(),s=!0}}else{this.inChordMode&&this._leaveChordMode(),c.isBubble||(s=!0),this._log(`+ Invoking command ${c.commandId}.`),this._currentlyDispatchingCommandId=c.commandId;try{typeof c.commandArgs>"u"?this._commandService.executeCommand(c.commandId).then(void 0,d=>this._notificationService.warn(d)):this._commandService.executeCommand(c.commandId,c.commandArgs).then(void 0,d=>this._notificationService.warn(d))}finally{this._currentlyDispatchingCommandId=null}lqe.test(c.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:c.commandId,from:"keybinding",detail:e.getUserSettingsLabel()??void 0})}return s}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}const U4=class U4{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}};U4.EMPTY=new U4(null);let m0=U4;class Boe{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?wz(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=wz(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function wz(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return dqe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:hqe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return uqe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new KPe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class YE extends gqe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Tf.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Tf.toString(e.keyCode)}_getElectronAccelerator(e){return Tf.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Tf.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return YE.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Tf.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=TG[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof Lg)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new Lg(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=wz(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new YE(i,t)]:[]}}const lw=mt("labelService"),jbe=mt("progressService"),wQ=class wQ{constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};wQ.None=Object.freeze({report(){}});let Vd=wQ;const Tg=mt("editorProgressService");class pqe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new my(new bqe(e,t))}static forStrings(){return new my(new pqe)}static forConfigKeys(){return new my(new mqe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new b2,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new b2,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new b2,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new b2,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=gf.unwrap(s.value);s.value=gf.wrap(t),s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],h=o[a+1][0];if(d===1&&h===1)o[a][1]=l.rotateLeft();else if(d===-1&&h===-1)o[a][1]=l.rotateRight();else if(d===1&&h===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&h===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return gf.unwrap((t=this._getNode(e))==null?void 0:t.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let o=this._root;for(;o;){const r=i.cmp(o.segment);if(r>0)s.push([-1,o]),o=o.left;else if(r<0)s.push([1,o]),o=o.right;else if(i.hasNext())i.next(),s.push([0,o]),o=o.mid;else break}if(o){if(t?(o.left=void 0,o.mid=void 0,o.right=void 0,o.height=1):(o.key=void 0,o.value=void 0),!o.mid&&!o.value)if(o.left&&o.right){const r=[[1,o]],a=this._min(o.right,r);if(a.key){o.key=a.key,o.value=a.value,o.segment=a.segment;const l=a.right;if(r.length>1){const[d,h]=r[r.length-1];switch(d){case-1:h.left=l;break;case 0:QI(!1);case 1:QI(!1)}}else o.right=l;const c=this._balanceByStack(r);if(s.length>0){const[d,h]=s[s.length-1];switch(d){case-1:h.left=c;break;case 0:h.mid=c;break;case 1:h.right=c;break}}else this._root=c}}else{const r=o.left??o.right;if(s.length>0){const[a,l]=s[s.length-1];switch(a){case-1:l.left=r;break;case 0:l.mid=r;break;case 1:l.right=r;break}}else this._root=r}this._root=this._balanceByStack(s)??this._root}}_min(e,t){for(;e.left;)t.push([-1,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const s=i.balanceFactor();if(s>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):s<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case-1:e[t-1][1].left=e[t][1];break;case 1:e[t-1][1].right=e[t][1];break;case 0:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=gf.unwrap(i.value)||s,i=i.mid;else break}return i&&gf.unwrap(i.value)||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?gf.unwrap(s.value):void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,gf.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const Rg=mt("contextService");function Cz(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&He.isUri(e.uri)}function vqe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&!Cz(n)&&!yqe(n)}const wqe={id:"empty-window"};function Cqe(n,e){if(typeof n=="string"||typeof n>"u")return typeof n=="string"?{id:sg(n)}:wqe;const t=n;return t.configuration?{id:t.id,configPath:t.configuration}:t.folders.length===1?{id:t.id,uri:t.folders[0].uri}:{id:t.id}}function yqe(n){const e=n;return typeof(e==null?void 0:e.id)=="string"&&He.isUri(e.configPath)}class Sqe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const yz="code-workspace";_(2050,"Code Workspace");const $be="4064f6ec-cb38-4ad0-af64-ee6467e63c82";function xqe(n){return n.id===$be}var Sz;(function(n){n.inspectTokensAction=_(786,"Developer: Inspect Tokens")})(Sz||(Sz={}));var _P;(function(n){n.gotoLineActionLabel=_(787,"Go to Line/Column...")})(_P||(_P={}));var xz;(function(n){n.helpQuickAccessActionLabel=_(788,"Show all Quick Access Providers")})(xz||(xz={}));var bP;(function(n){n.quickCommandActionLabel=_(789,"Command Palette"),n.quickCommandHelp=_(790,"Show And Run Commands")})(bP||(bP={}));var ZE;(function(n){n.quickOutlineActionLabel=_(791,"Go to Symbol..."),n.quickOutlineByCategoryActionLabel=_(792,"Go to Symbol by Category...")})(ZE||(ZE={}));var Lz;(function(n){n.editorViewAccessibleLabel=_(793,"Editor content")})(Lz||(Lz={}));var kz;(function(n){n.toggleHighContrast=_(794,"Toggle High Contrast Theme")})(kz||(kz={}));var Iz;(function(n){n.bulkEditServiceSummary=_(795,"Made {0} edits in {1} files")})(Iz||(Iz={}));const Ube=mt("workspaceTrustManagementService");let SS=[],DZ=[],qbe=[];function v2(n,e=!1){Lqe(n,!1,e)}function Lqe(n,e,t){const i=kqe(n,e);SS.push(i),i.userConfigured?qbe.push(i):DZ.push(i),t&&!i.userConfigured&&SS.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function kqe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?Z_e(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Vn.sep)>=0:!1}}function Iqe(){SS=SS.filter(n=>n.userConfigured),DZ=[]}function Eqe(n,e){return Nqe(n,e).map(t=>t.id)}function Nqe(n,e){let t;if(n)switch(n.scheme){case Ge.file:t=n.fsPath;break;case Ge.data:{t=i_.parseMetaData(n).get(i_.META_DATA_LABEL);break}case Ge.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:mn.unknown}];t=t.toLowerCase();const i=sg(t),s=Woe(t,i,qbe);if(s)return[s,{id:al,mime:mn.text}];const o=Woe(t,i,DZ);if(o)return[o,{id:al,mime:mn.text}];if(e){const r=Dqe(e);if(r)return[r,{id:al,mime:mn.text}]}return[{id:"unknown",mime:mn.unknown}]}function Woe(n,e,t){var r;let i,s,o;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){i=l;break}if(l.filepattern&&(!s||l.filepattern.length>s.filepattern.length)){const c=l.filepatternOnPath?n:e;(r=l.filepatternLowercase)!=null&&r.call(l,c)&&(s=l)}l.extension&&(!o||l.extension.length>o.extension.length)&&e.endsWith(l.extensionLowercase)&&(o=l)}if(i)return i;if(s)return s;if(o)return o}function Dqe(n){if(WG(n)&&(n=n.substr(1)),n.length>0)for(let e=SS.length-1;e>=0;e--){const t=SS[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const w2=Object.prototype.hasOwnProperty,Hoe="vs.editor.nullLanguage";class Tqe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Hoe,0),this._register(al,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Hoe}}const uI=class uI extends G{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,uI.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Tqe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(dS.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){uI.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Iqe();const e=[].concat(dS.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),Ji.as(ch.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;w2.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)v2({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)v2({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)v2({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);Dge(l)||v2({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?w2.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return w2.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&w2.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:Eqe(e,t)}};uI.instanceCount=0;let Ez=uI;const fI=class fI extends G{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new q),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new q),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new q({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,fI.instanceCount++,this._registry=this._register(new Ez(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){fI.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return this._registry.guessLanguageIdByFilepathOrFirstLine(e,t).at(0)??null}createById(e){return new Voe(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Voe(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=al),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),rn.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}};fI.instanceCount=0;let Nz=fI;class Voe{constructor(e,t){this._value=qt(this,e,()=>t()),this.onDidChange=ve.fromObservable(this._value)}get languageId(){return this._value.get()}}function dg(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=dg(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function zoe(n){const e=n.replaceAll(/[^_\-a-z0-9]/gi,"");return e!==n&&console.warn(`CSS ident value ${n} modified to ${e} to be safe for CSS`),e}function hp(n){return`'${n.replaceAll(/'/g,"\\000027")}'`}function xu(n){return n?sa`url('${CSS.escape(zge.uriToBrowserUri(n).toString(!0))}')`:"url('')"}function C2(n,e=!1){const t=CSS.escape(n);return!e&&t!==n&&console.warn(`CSS class name ${n} modified to ${t} to be safe for CSS`),t}function sa(n,...e){return n.reduce((t,i,s)=>{const o=e[s]||"";return t+i+o},"")}class k9{constructor(){this._parts=[]}push(...e){this._parts.push(...e)}join(e=` +`){return this._parts.join(e)}}const cw={RESOURCES:"ResourceURLs",TEXT:mn.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"},Rqe=()=>({get delay(){return-1},dispose:()=>{},showHover:()=>{}});let R3=Rqe;const Mqe=new ro(()=>R3("mouse",!1)),Aqe=new ro(()=>R3("element",!1));function Pqe(n){R3=n}function Pu(n){return n==="element"?Aqe.value:Mqe.value}function Kbe(){return R3("element",!0)}let Gbe={showInstantHover:()=>{},showDelayedHover:()=>{},setupDelayedHover:()=>G.None,setupDelayedHoverAtMouse:()=>G.None,hideHover:()=>{},showAndFocusLastHover:()=>{},setupManagedHover:()=>({dispose:()=>{},show:()=>{},hide:()=>{},update:()=>{}}),showManagedHover:()=>{}};function Oqe(n){Gbe=n}function td(){return Gbe}class Fqe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class G_ extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function joe(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class Hqe{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=joe({start:0,end:e},this.groups),r=joe({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:Dz(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=Wqe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}function zqe(n,e,t,i=[]){if(!n.dataTransfer)return;const s=me(".monaco-drag-image");s.textContent=t,s.classList.add(...i),(a=>{for(;a&&!a.classList.contains("monaco-workbench");)a=a.parentElement;return a||e.ownerDocument.body})(e).appendChild(s),n.dataTransfer.setDragImage(s,-10,-10),setTimeout(()=>s.remove(),0)}var $g=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Y_={CurrentDragAndDropData:void 0},yh={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class ND{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class jqe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class $qe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}const q4=class q4{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get scrollableElementDomNode(){return this.scrollableElement.getDomNode()}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:C7(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=yh){var r,a;if(this.virtualDelegate=t,this.domId=`list_id_${++q4.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ec(50),this.splicing=!1,this.dragOverAnimationStopDisposable=G.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=G.None,this.onDragLeaveTimeout=G.None,this.currentSelectionDisposable=G.None,this.disposables=new ne,this._onDidChangeContentHeight=new q,this._onDidChangeContentWidth=new q,this.onDidChangeContentHeight=ve.latch(this._onDidChangeContentHeight.event,void 0,this.disposables),this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=this.createRangeMap(s.paddingTop??0);for(const l of i)this.renderers.set(l.templateId,l);if(this.cache=this.disposables.add(new Vqe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=s.horizontalScrolling??yh.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new qqe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",(s.transformOptimization??yh.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Eo.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new sx({forceIntegerValues:!0,smoothScrollDuration:s.smoothScrolling??!1?125:0,scheduleAtNextAnimationFrame:l=>Kr(Pe(this.domNode),l)})),this.scrollableElement=this.disposables.add(new m3(this.rowsContainer,{alwaysConsumeMouseWheel:s.alwaysConsumeMouseWheel??yh.alwaysConsumeMouseWheel,horizontal:1,vertical:s.verticalScrollMode??yh.verticalScrollMode,useShadows:s.useShadows??yh.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(J(this.rowsContainer,xi.Change,l=>this.onTouchChange(l))),this.disposables.add(J(this.scrollableElement.getDomNode(),"scroll",l=>{const c=l.target,d=c.scrollTop;c.scrollTop=0,s.scrollToActiveElement&&this.setScrollTop(this.scrollTop+d)})),this.disposables.add(J(this.domNode,"dragover",l=>this.onDragOver(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"drop",l=>this.onDrop(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"dragleave",l=>this.onDragLeave(this.toDragEvent(l)))),this.disposables.add(J(this.domNode,"dragend",l=>this.onDragEnd(l))),s.userSelection){if(s.dnd)throw new Error("DND and user selection cannot be used simultaneously");this.disposables.add(J(this.domNode,"mousedown",l=>this.onPotentialSelectionStart(l)))}this.setRowLineHeight=s.setRowLineHeight??yh.setRowLineHeight,this.setRowHeight=s.setRowHeight??yh.setRowHeight,this.supportDynamicHeights=s.supportDynamicHeights??yh.supportDynamicHeights,this.dnd=s.dnd??this.disposables.add(yh.dnd),this.layout((r=s.initialSize)==null?void 0:r.height,(a=s.initialSize)==null?void 0:a.width),s.scrollToActiveElement&&this._setupFocusObserver(e)}_setupFocusObserver(e){this.disposables.add(J(e,"focus",()=>{const t=as();this.activeElement!==t&&t!==null&&(this.activeElement=t,this._scrollToActiveElement(this.activeElement,e))},!0))}_scrollToActiveElement(e,t){const i=t.getBoundingClientRect(),o=e.getBoundingClientRect().top-i.top;o<0&&this.setScrollTop(this.scrollTop+o)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t={...t??{},scrollByPage:e.scrollByPage}),e.mouseWheelScrollSensitivity!==void 0&&(t={...t??{},mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity}),e.fastScrollSensitivity!==void 0&&(t={...t??{},fastScrollSensitivity:e.fastScrollSensitivity}),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}createRangeMap(e){return new Hqe(e)}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=mo.intersect(s,o),a=new Map;for(let S=r.end-1;S>=r.start;S--){const L=this.items[S];if(L.dragStartDisposable.dispose(),L.checkedDisposable.dispose(),L.row){let x=a.get(L.templateId);x||(x=[],a.set(L.templateId,x));const I=this.renderers.get(L.templateId);I&&I.disposeElement&&I.disposeElement(L.element,S,L.row.templateData,{height:L.size}),x.unshift(L.row)}L.row=null,L.stale=!0}const l={start:e+t,end:this.items.length},c=mo.intersect(l,s),d=mo.relativeComplement(l,s),h=i.map(S=>({id:String(this.itemId++),element:S,templateId:this.virtualDelegate.getTemplateId(S),size:this.virtualDelegate.getHeight(S),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(S),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:G.None,checkedDisposable:G.None,stale:!1}));let u;e===0&&t>=this.items.length?(this.rangeMap=this.createRangeMap(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,h),u=this.items,this.items=h):(this.rangeMap.splice(e,t,h),u=GM(this.items,e,t,h));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=Dz(c,f),m=mo.intersect(g,p);for(let S=m.start;SDz(S,f)),C=[{start:e,end:e+i.length},...v].map(S=>mo.intersect(g,S)).reverse();for(const S of C)for(let L=S.end-1;L>=S.start;L--){const x=this.items[L],I=a.get(x.templateId),E=I==null?void 0:I.pop();this.insertItemInDOM(L,E)}for(const S of a.values())for(const L of S)this.cache.release(L);return this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight),u.map(S=>S.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=Kr(Pe(this.domNode),()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){return this.getVisibleRange(this.lastRenderTop,this.lastRenderHeight).start}element(e){return this.items[e].element}indexOf(e){return this.items.findIndex(t=>t.element===e)}domElement(e){const t=this.items[e].row;return t&&t.domNode}elementHeight(e){return this.items[e].size}elementTop(e){return this.rangeMap.positionAt(e)}indexAt(e){return this.rangeMap.indexAt(e)}indexAfter(e){return this.rangeMap.indexAfter(e)}layout(e,t){const i={height:typeof e=="number"?e:YOe(this.domNode)};this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,i.scrollHeight=this.scrollHeight),this.scrollableElement.setScrollDimensions(i),typeof t<"u"&&(this.renderWidth=t,this.supportDynamicHeights&&this._rerender(this.scrollTop,this.renderHeight)),this.horizontalScrolling&&this.scrollableElement.setScrollDimensions({width:typeof t=="number"?t:C7(this.domNode)})}render(e,t,i,s,o,r=!1,a=!1){const l=this.getRenderRange(t,i),c=mo.relativeComplement(l,e).reverse(),d=mo.relativeComplement(e,l);if(r){const h=mo.intersect(e,l);for(let u=h.start;u{for(const h of d)for(let u=h.start;u=h.start;u--)this.insertItemInDOM(u)}),s!==void 0&&(this.rowsContainer.style.left=`-${s}px`),this.rowsContainer.style.top=`-${t}px`,this.horizontalScrolling&&o!==void 0&&(this.rowsContainer.style.width=`${Math.max(o,this.renderWidth)}px`),this.lastRenderTop=t,this.lastRenderHeight=i}insertItemInDOM(e,t){var c,d;const i=this.items[e];if(!i.row)if(t)i.row=t,i.stale=!0;else{const h=this.cache.alloc(i.templateId);i.row=h.row,i.stale||(i.stale=h.isReusingConnectedDomNode)}const s=this.accessibilityProvider.getRole(i.element)||"listitem";i.row.domNode.setAttribute("role",s);const o=this.accessibilityProvider.isChecked(i.element),r=h=>h==="mixed"?"mixed":String(!!h);if(typeof o=="boolean"||o==="mixed")i.row.domNode.setAttribute("aria-checked",r(o));else if(o){const h=u=>i.row.domNode.setAttribute("aria-checked",r(u));h(o.value),i.checkedDisposable=o.onDidChange(()=>h(o.value))}if(i.stale||!i.row.domNode.parentElement){const h=((d=(c=this.items.at(e+1))==null?void 0:c.row)==null?void 0:d.domNode)??null;(i.row.domNode.parentElement!==this.rowsContainer||i.row.domNode.nextElementSibling!==h)&&this.rowsContainer.insertBefore(i.row.domNode,h),i.stale=!1}this.updateItemInDOM(i,e);const a=this.renderers.get(i.templateId);if(!a)throw new Error(`No renderer found for template id ${i.templateId}`);a==null||a.renderElement(i.element,e,i.row.templateData,{height:i.size});const l=this.dnd.getDragURI(i.element);i.dragStartDisposable.dispose(),i.row.domNode.draggable=!!l,l&&(i.dragStartDisposable=J(i.row.domNode,"dragstart",h=>this.onDragStart(i.element,l,h))),this.horizontalScrolling&&(this.measureItemWidth(i),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=C7(e.row.domNode);const t=Pe(e.row.domNode).getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e,t){const i=this.items[e];if(i.dragStartDisposable.dispose(),i.checkedDisposable.dispose(),i.row){const s=this.renderers.get(i.templateId);s&&s.disposeElement&&s.disposeElement(i.element,e,i.row.templateData,{height:i.size,onScroll:t}),this.cache.release(i.row),i.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ve.map(this.disposables.add(new ti(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ve.map(this.disposables.add(new ti(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ve.filter(ve.map(this.disposables.add(new ti(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ve.map(this.disposables.add(new ti(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ve.map(this.disposables.add(new ti(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ve.map(this.disposables.add(new ti(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ve.any(ve.map(this.disposables.add(new ti(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ve.map(this.disposables.add(new ti(this.domNode,xi.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ve.map(this.disposables.add(new ti(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ve.map(this.disposables.add(new ti(this.rowsContainer,xi.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element,o=this.getTargetSector(e,t);return{browserEvent:e,index:t,element:s,sector:o}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth,void 0,!0),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var r,a;if(!i.dataTransfer)return;const s=this.dnd.getDragElements(e);i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(cw.TEXT,t);let o;this.dnd.getDragLabel&&(o=this.dnd.getDragLabel(s,i)),typeof o>"u"&&(o=String(s.length)),zqe(i,this.domNode,o,[this.domId]),this.domNode.classList.add("dragging"),this.currentDragData=new ND(s),Y_.CurrentDragAndDropData=new jqe(s),(a=(r=this.dnd).onDragStart)==null||a.call(r,this.currentDragData,i)}onPotentialSelectionStart(e){this.currentSelectionDisposable.dispose();const t=HOe(this.domNode),i=this.currentSelectionDisposable=new ne,s=i.add(new ne);s.add(J(this.domNode,"selectstart",()=>{s.add(J(t,"mousemove",o=>{var r;((r=t.getSelection())==null?void 0:r.isCollapsed)===!1&&this.setupDragAndDropScrollTopAnimation(o)})),i.add(Re(()=>{const o=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.currentSelectionBounds=void 0,this.render(o,this.lastRenderTop,this.lastRenderHeight,void 0,void 0)})),i.add(J(t,"selectionchange",()=>{const o=t.getSelection();if(!o||o.isCollapsed){s.isDisposed&&i.dispose();return}let r=this.getIndexOfListElement(o.anchorNode),a=this.getIndexOfListElement(o.focusNode);r!==void 0&&a!==void 0&&(a{var o;s.dispose(),this.teardownDragAndDropScrollTopAnimation(),((o=t.getSelection())==null?void 0:o.isCollapsed)!==!1&&i.dispose()}))}getIndexOfListElement(e){var t;if(!(!e||!this.domNode.contains(e)))for(;e&&e!==this.domNode;){if((t=e.dataset)!=null&&t.index)return Number(e.dataset.index);e=e.parentElement}}onDragOver(e){var o,r;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Y_.CurrentDragAndDropData&&Y_.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Y_.CurrentDragAndDropData)this.currentDragData=Y_.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new $qe}const t=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.sector,e.browserEvent);if(this.canDrop=typeof t=="boolean"?t:t.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof t!="boolean"&&((o=t.effect)==null?void 0:o.type)===0?"copy":"move";let i;typeof t!="boolean"&&t.feedback?i=t.feedback:typeof e.index>"u"?i=[-1]:i=[e.index],i=bg(i).filter(a=>a>=-1&&aa-l),i=i[0]===-1?[-1]:i;let s=typeof t!="boolean"&&t.effect&&t.effect.position?t.effect.position:"drop-target";if(Uqe(this.currentDragFeedback,i)&&this.currentDragFeedbackPosition===s)return!0;if(this.currentDragFeedback=i,this.currentDragFeedbackPosition=s,this.currentDragFeedbackDisposable.dispose(),i[0]===-1)this.domNode.classList.add(s),this.rowsContainer.classList.add(s),this.currentDragFeedbackDisposable=Re(()=>{this.domNode.classList.remove(s),this.rowsContainer.classList.remove(s)});else{if(i.length>1&&s!=="drop-target")throw new Error("Can't use multiple feedbacks with position different than 'over'");s==="drop-target-after"&&i[0]{var a;for(const l of i){const c=this.items[l];c.dropTarget=!1,(a=c.row)==null||a.domNode.classList.remove(s)}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=kg(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)==null||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Y_.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.sector,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Y_.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackPosition=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=G.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=Jge(this.domNode).top;this.dragOverAnimationDisposable=o4e(Pe(this.domNode),this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=kg(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getTargetSector(e,t){if(t===void 0)return;const i=e.offsetY/this.items[t].size,s=Math.floor(i/.25);return lr(s,0,3)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;(hn(i)||npe(i))&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getVisibleRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}getRenderRange(e,t){const i=this.getVisibleRange(e,t);if(this.currentSelectionBounds){const s=this.rangeMap.count;i.start=Math.min(i.start,this.currentSelectionBounds.start,s),i.end=Math.min(Math.max(i.end,this.currentSelectionBounds.end+1),s)}return i}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=u.start;f--)this.insertItemInDOM(f);for(let u=l.start;u=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class Gqe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let vP=class{get onChange(){return this._onChange.event}get name(){return this._trait}get renderer(){return new Gqe(this)}constructor(e){this._trait=e,this.indexes=[],this.sortedIndexes=[],this._onChange=new q}splice(e,t,i){const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);this.renderer.splice(e,t,i.length),this._set(r,r)}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(Uoe),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=Tz(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return KM(this.sortedIndexes,e,Uoe)>=0}dispose(){ei(this._onChange)}};y_([wn],vP.prototype,"renderer",null);class Yqe extends vP{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class I9{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function DD(n,e){return n.classList.contains(e)?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:DD(n.parentElement,e)}function PL(n){return DD(n,"monaco-editor")}function Zqe(n){return DD(n,"monaco-custom-toggle")}function Xqe(n){return DD(n,"action-item")}function Ok(n){return DD(n,"monaco-tree-sticky-row")}function XE(n){return n.classList.contains("monaco-tree-sticky-container")}function Ybe(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:Ybe(n.parentElement)}class Zbe{get onKeyDown(){return ve.chain(this.disposables.add(new ti(this.view.domNode,"keydown")).event,e=>e.filter(t=>!qd(t.target)).map(t=>new ui(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new ne,this.multipleSelectionDisposables=new ne,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(yt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(ar(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}y_([wn],Zbe.prototype,"onKeyDown",null);var Qh;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Qh||(Qh={}));var _0;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(_0||(_0={}));const Qqe=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class Jqe{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=_0.Idle,this.mode=Qh.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new ne,this.disposables=new ne,this.updateOptions(e.options)}updateOptions(e){e.typeNavigationEnabled??!0?this.enable():this.disable(),this.mode=e.typeNavigationMode??Qh.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ve.chain(this.enabledDisposables.add(new ti(this.view.domNode,"keydown")).event,o=>o.filter(r=>!qd(r.target)).filter(()=>this.mode===Qh.Automatic||this.triggered).map(r=>new ui(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>Ht.stop(r,!0)).map(r=>r.browserEvent.key)),i=ve.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ve.reduce(ve.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var t;const e=this.list.getFocus();if(e.length>0&&e[0]===this.previouslyFocused){const i=(t=this.list.options.accessibilityProvider)==null?void 0:t.getAriaLabel(this.list.element(e[0]));typeof i=="string"?vr(i):i&&vr(i.get())}this.previouslyFocused=-1}onInput(e){if(!e){this.state=_0.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===_0.Idle?1:0;this.state=_0.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||jE(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class eKe{constructor(e,t){this.list=e,this.view=t,this.disposables=new ne;const i=ve.chain(this.disposables.add(new ti(t.domNode,"keydown")).event,o=>o.filter(r=>!qd(r.target)).map(r=>new ui(r)));ve.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!hn(s)||s.tabIndex===-1)return;const o=Pe(s).getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function Xbe(n){return yt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function Qbe(n){return n.browserEvent.shiftKey}function tKe(n){return JG(n)&&n.button===2}const $oe={isSelectionSingleChangeEvent:Xbe,isSelectionRangeChangeEvent:Qbe};class Jbe{get onPointer(){return this._onPointer.event}constructor(e){this.list=e,this.disposables=new ne,this._onPointer=this.disposables.add(new q),e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||$oe),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Eo.addTarget(e.getHTMLElement()))),ve.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||$oe))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){PL(e.browserEvent.target)||as()!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(qd(e.browserEvent.target)||PL(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||qd(e.browserEvent.target)||PL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),tKe(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(qd(e.browserEvent.target)||PL(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){typeof i>"u"&&(i=this.list.getFocus()[0]??t,this.list.setAnchor(i));const s=Math.min(i,t),o=Math.max(i,t),r=ar(s,o+1),a=this.list.getSelection(),l=oKe(Tz(a,[i]),i);if(l.length===0)return;const c=Tz(r,rKe(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class iKe{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){const t=this.selectorSuffix&&`.${this.selectorSuffix}`,i=[];e.listBackground&&i.push(`.monaco-list${t} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(i.push(`.monaco-list${t}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),i.push(`.monaco-list${t}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&i.push(`.monaco-list${t}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&i.push(` .monaco-drag-image${t}, .monaco-list${t}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&i.push(` @@ -732,17 +727,17 @@ ${Vc(e)} background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=i.join(` -`)}}const oKe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:se.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:se.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:se.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},rKe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function aKe(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class cKe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var r;let o=0;for(const a of this.renderers)(r=a.disposeElement)==null||r.call(a,e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class dKe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new ne}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),o=s&&typeof s!="string"?s:Ci(s);i.disposables.add(qe(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class hKe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,e,t)}onDragOver(e,t,i,s,o){return this.dnd.onDragOver(e,t,i,s,o)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)==null||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}drop(e,t,i,s,o){this.dnd.drop(e,t,i,s,o)}dispose(){this.dnd.dispose()}}class pl{get onDidChangeFocus(){return ve.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ve.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=ve.chain(this.disposables.add(new ti(this.view.domNode,"keydown")).event,o=>o.map(r=>new ui(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Wt.stop(r,!0)).filter(()=>!1)),i=ve.chain(this.disposables.add(new ti(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new ui(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Wt.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=ve.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new ao(Oe(this.view.domNode),l),browserEvent:l})));return ve.any(t,i,s)}get onKeyDown(){return this.disposables.add(new ti(this.view.domNode,"keydown")).event}get onDidFocus(){return ve.signal(this.disposables.add(new ti(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return ve.signal(this.disposables.add(new ti(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,o=rKe){var c,d,h;this.user=e,this._options=o,this.focus=new vP("focused"),this.anchor=new vP("anchor"),this.eventBufferer=new oD,this._ariaLabel="",this.disposables=new ne,this._onDidDispose=new q,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(c=this._options.accessibilityProvider)==null?void 0:c.getWidgetRole():"list";this.selection=new Xqe(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new dKe(this.accessibilityProvider)),(h=(d=this.accessibilityProvider).onDidChangeActiveDescendant)==null||h.call(d,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(u=>new cKe(u.templateId,[...a,u]));const l={...o,dnd:o.dnd&&new hKe(this,o.dnd)};if(this.view=this.createListView(t,i,s,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const u=lc(this.view.domNode);this.styleController=new sKe(u,this.view.domId)}if(this.spliceable=new Wqe([new E9(this.focus,this.view,o.identityProvider),new E9(this.selection,this.view,o.identityProvider),new E9(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new iKe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new eve(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const u=o.keyboardNavigationDelegate||eKe;this.typeNavigationController=new tKe(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),u),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const u=this.accessibilityProvider.getWidgetAriaLabel(),f=u&&typeof u!="string"?u:Ci(u);this.disposables.add(qe(g=>{this.ariaLabel=g.readObservable(f)}))}this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Yc(e,t,i,s)}createMouseController(e){return new nve(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)==null||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)==null||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new Y_(this.user,`Invalid start index: ${e}`);if(t<0)throw new Y_(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new Y_(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new Y_(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new Y_(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await vu(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const o=i(),r=this.view.getScrollTop()+o;r===0?s=this.view.indexAt(r):s=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const l=this.findNextIndex(s,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([s],e)}else{const l=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await vu(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new Y_(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(wg(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*rr(t,0,1)+o-i)}else{const a=o+r,l=s+this.view.renderHeight;o=l||(o=l&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new Y_(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-s)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var t;const e=this.focus.get();if(e.length>0){let i;(t=this.accessibilityProvider)!=null&&t.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}S_([wn],pl.prototype,"onDidChangeFocus",null);S_([wn],pl.prototype,"onDidChangeSelection",null);S_([wn],pl.prototype,"onContextMenu",null);S_([wn],pl.prototype,"onKeyDown",null);S_([wn],pl.prototype,"onDidFocus",null);S_([wn],pl.prototype,"onDidBlur",null);const gv=me,sve="selectOption.entry.template";class uKe{get templateId(){return sve}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ue(e,gv(".option-text")),t.detail=ue(e,gv(".option-detail")),t.decoratorRight=ue(e,gv(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.textContent=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const Oh=class Oh extends G{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new ne),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Oh.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new q,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(ed().setupManagedHover(Au("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return sve}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=me(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ue(this.selectDropDownContainer,gv(".select-box-details-pane"));const t=ue(this.selectDropDownContainer,gv(".select-box-dropdown-container-width-control")),i=ue(t,gv(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ue(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=lc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(J(this.selectDropDownContainer,_e.DRAG_START,s=>{Wt.stop(s,!0)}))}registerListeners(){this._register(xn(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(J(this.selectElement,_e.CLICK,t=>{Wt.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(J(this.selectElement,_e.MOUSE_DOWN,t=>{Wt.stop(t)}));let e;this._register(J(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(J(this.selectElement,"touchend",t=>{Wt.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(J(this.selectElement,_e.KEY_DOWN,t=>{const i=new ui(t);let s=!1;wt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),Wt.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Bi(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)==null||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=dg(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Oe(this.selectElement),i=dn(this.selectElement),s=Oe(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Oh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,g=Math.floor((r-o-u)/this.getHeight()),p=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=g*this.getHeight())}else f>a&&(h=p*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ra(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ue(e,gv(".select-box-dropdown-list-container")),this.listRenderer=new uKe,this.selectList=this._register(new pl("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>_(16,"Select Box"),getRole:()=>wt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ti(this.selectDropDownListContainer,"keydown")),i=ve.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new ui(o)));this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(J(this.selectList.getHTMLElement(),_e.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(J(this.selectDropDownContainer,_e.FOCUS_OUT,s=>{!this._isVisible||Cs(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Wt.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Wt.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Wt.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Wt.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Wt.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Df.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(J(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(xn(this.selectElement,"click",e=>{Wt.stop(e,!0)})),this._register(xn(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(xn(this.selectElement,"keydown",e=>{let t=!1;wt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Bi(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new iw)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(No.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,$r&&this._register(J(e,_e.DRAG_START,s=>{var o;return(o=s.dataTransfer)==null?void 0:o.setData(uw.TEXT,this._action.label)}))),this._register(J(t,Li.Tap,s=>this.onClick(s,!0))),this._register(J(t,_e.MOUSE_DOWN,s=>{i||Wt.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),wt&&this._register(J(t,_e.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(J(t,_e.CLICK,s=>{Wt.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(J(t,_e.DBLCLICK,s=>{Wt.stop(s,!0)})),[_e.MOUSE_UP,_e.MOUSE_OUT].forEach(s=>{this._register(J(t,s,o=>{Wt.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var s;Wt.stop(e,!0);const i=Hl(this._context)?(s=this.options)!=null&&s.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),!this.customHover&&e!==""){const t=this.options.hoverDelegate??Au("element");this.customHover=this._store.add(ed().setupManagedHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class kS extends Nd{constructor(e,t,i){i={...i,icon:i.icon!==void 0?i.icon:!1,label:i.label!==void 0?i.label:!0},super(e,t,i),this.options=i,this.cssClass=""}render(e){super.render(e),Ot(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Xn.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=_(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)==null||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)==null||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)==null||t.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class pKe extends Nd{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new gKe(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)==null||e.focus()}blur(){var e;(e=this.selectBox)==null||e.blur()}render(e){this.selectBox.render(e)}}class mKe extends iw{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new q),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ue(e,me(".monaco-dropdown")),this._label=ue(this._element,me(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[_e.CLICK,_e.MOUSE_DOWN,Li.Tap])this._register(J(this.element,o,r=>Wt.stop(r,!0)));for(const o of[_e.MOUSE_DOWN,Li.Tap])this._register(J(this._label,o,r=>{eY(r)&&r.button!==0||(this.visible?this.hide():this.show())}));this._register(J(this._label,_e.KEY_DOWN,o=>{const r=new ui(o);(r.equals(3)||r.equals(10))&&(Wt.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(No.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class _Ke extends mKe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class wP extends Nd{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new q),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>(this.element=ue(o,me("a.action-label")),this.renderLabel(this.element)),i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new _Ke(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)==null||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return typeof this.options.classNames=="string"?t=this.options.classNames.split(/\s+/g).filter(i=>!!i):this.options.classNames&&(t=this.options.classNames),t.find(i=>i==="icon")||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(ed().setupManagedHover(this.options.hoverDelegate??Au("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)==null||e.show()}updateEnabled(){var t,i;const e=!this.action.enabled;(t=this.actionItem)==null||t.classList.toggle("disabled",e),(i=this.element)==null||i.classList.toggle("disabled",e)}}function bKe(n){return!!n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function vKe(n){return n?n.condition!==void 0:!1}function wKe(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?pe(s):void 0}return t}const ove={keybindingLabelBackground:pe(r7e),keybindingLabelForeground:pe(a7e),keybindingLabelBorder:pe(l7e),keybindingLabelBottomBorder:pe(c7e),keybindingLabelShadow:pe(sx)},CKe={buttonForeground:pe(f3),buttonSeparator:pe(K8e),buttonBackground:pe(hv),buttonHoverBackground:pe(G8e),buttonSecondaryForeground:pe(mme),buttonSecondaryBackground:pe(FA),buttonSecondaryHoverBackground:pe(Z8e),buttonBorder:pe(Y8e)},yKe={progressBarBackground:pe(c8e)},CP={inputActiveOptionBorder:pe(mD),inputActiveOptionForeground:pe(_D),inputActiveOptionBackground:pe(ox)};pe(DL),pe(X8e),pe(Q8e),pe(J8e),pe(e7e),pe(t7e),pe(i7e);const RZ={checkboxBackground:pe(IY),checkboxBorder:pe(n7e),checkboxForeground:pe(NY),checkboxDisabledBackground:pe(s7e),checkboxDisabledForeground:pe(o7e)};pe(el),pe(c3),pe(sx),pe(xY),pe(I8e),pe(N8e),pe(D8e),pe(a8e);const yP={inputBackground:pe(tV),inputForeground:pe(gme),inputBorder:pe(pme),inputValidationInfoBorder:pe(W8e),inputValidationInfoBackground:pe(F8e),inputValidationInfoForeground:pe(B8e),inputValidationWarningBorder:pe(z8e),inputValidationWarningBackground:pe(H8e),inputValidationWarningForeground:pe(V8e),inputValidationErrorBorder:pe(U8e),inputValidationErrorBackground:pe(j8e),inputValidationErrorForeground:pe($8e)},SKe={listFilterWidgetBackground:pe(y7e),listFilterWidgetOutline:pe(S7e),listFilterWidgetNoMatchesOutline:pe(x7e),listFilterWidgetShadow:pe(L7e),inputBoxStyles:yP,toggleStyles:CP},rve={badgeBackground:pe(AR),badgeForeground:pe(l8e),badgeBorder:pe(Dt)};pe(k8e),pe(L8e),pe(yne),pe(yne),pe(E8e);const dx={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:pe(d7e),listFocusForeground:pe(h7e),listFocusOutline:pe(u7e),listActiveSelectionBackground:pe(nw),listActiveSelectionForeground:pe(EI),listActiveSelectionIconForeground:pe(_me),listFocusAndSelectionOutline:pe(f7e),listFocusAndSelectionBackground:pe(nw),listFocusAndSelectionForeground:pe(EI),listInactiveSelectionBackground:pe(g7e),listInactiveSelectionIconForeground:pe(m7e),listInactiveSelectionForeground:pe(p7e),listInactiveFocusBackground:pe(_7e),listInactiveFocusOutline:pe(b7e),listHoverBackground:pe(bme),listHoverForeground:pe(vme),listDropOverBackground:pe(v7e),listDropBetweenBackground:pe(w7e),listSelectionOutline:pe(Vi),listHoverOutline:pe(Vi),treeIndentGuidesStroke:pe(wme),treeInactiveIndentGuidesStroke:pe(k7e),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:pe(l3),tableColumnsBorder:pe(E7e),tableOddRowsBackgroundColor:pe(I7e)};function zw(n){return wKe(n,dx)}const xKe={selectBackground:pe(u3),selectListBackground:pe(q8e),selectForeground:pe(kY),decoratorRightForeground:pe(Cme),selectBorder:pe(EY),focusBorder:pe(wu),listFocusBackground:pe(NI),listInactiveSelectionIconForeground:pe(DY),listFocusForeground:pe(II),listFocusOutline:nme(Vi,se.transparent.toString()),listHoverBackground:pe(bme),listHoverForeground:pe(vme),listHoverOutline:pe(Vi),selectListBorder:pe(vY),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},LKe={shadowColor:pe(sx),borderColor:pe(D7e),foregroundColor:pe(T7e),backgroundColor:pe(R7e),selectionForegroundColor:pe(M7e),selectionBackgroundColor:pe(A7e),selectionBorderColor:pe(P7e),separatorColor:pe(O7e),scrollbarShadow:pe(l3),scrollbarSliderBackground:pe(lme),scrollbarSliderHoverBackground:pe(cme),scrollbarSliderActiveBackground:pe(dme)};function kKe(n,e){if(Du)return!1;const t=EKe(n,e),i=n.getValue("window");return(i==null?void 0:i.menuStyle)==="native"?!(!wt&&!t):(i==null?void 0:i.menuStyle)==="custom"?!1:t}function EKe(n,e){return e||(e=ave(n)),e==="native"}function ave(n){if(Du)return"custom";const e=n.getValue("window");if(e){if(wt&&e.nativeTabs===!0||wt&&e.nativeFullScreen===!1)return"native";const s=e.titleBarStyle;if(s==="native"||s==="custom")return s}return"custom"}function IKe(n){if(Du||wt||ave(n)==="native")return"native";const e=n.getValue("window"),t=e==null?void 0:e.controlsStyle;return t==="custom"||t==="hidden"?t:"native"}var M3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cr=function(n,e){return function(t,i){e(t,i,n)}};function NKe(n,e){const t=[];return DKe(n,t),t}function DKe(n,e,t){const i=jf.getInstance(),s=i.keyStatus.altKey||($s||jr)&&i.keyStatus.shiftKey;dve(n,e,s,o=>o==="navigation")}function lve(n,e,t,i){const s={primary:[],secondary:[]};return cve(n,s,e,t,i),s}function TKe(n,e,t,i){const s=[];return cve(n,s,e,t,i),s}function cve(n,e,t,i,s){dve(n,e,!1,typeof t=="string"?r=>r===t:t,i,s)}function dve(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let h;i(c)?(h=r,h.length>0&&o&&h.push(new Xn)):(h=a,h.length>0&&h.push(new Xn));for(let u of d){t&&(u=u instanceof rl&&u.alt?u.alt:u);const f=h.push(u);u instanceof hS&&l.add({group:c,action:u,index:f-1})}}for(const{group:c,action:d,index:h}of l){const u=i(c)?r:a,f=d.actions;s(d,c,u.length)&&u.splice(h,1,...f)}}let c_=class extends kS{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate,keybindingNotRenderedWithLabel:t==null?void 0:t.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Kt),this._altKey=jf.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var o;const s=!!((o=this._menuItemAction.alt)!=null&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(J(e,"mouseleave",s=>{t=!1,i()})),this._register(J(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var o;const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?_(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&((o=this._menuItemAction.alt)!=null&&o.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?_(1645,"{0} ({1})",r,l):r;s=_(1646,`{0} -[{1}] {2}`,s,DZ.modifierLabels[ha].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&vKe(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(Ue.isThemeIcon(s)){const o=Ue.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Re(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=Ng(this._themeService.getColorTheme().type)?Su(s.dark):Su(s.light),i.classList.add("icon"),this._itemClassDispose.value=Hc(Re(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};c_=M3([cr(2,Ht),cr(3,fn),cr(4,Xe),cr(5,en),cr(6,gl),cr(7,Us)],c_);class MZ extends c_{render(e){var t;this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",((t=this._options)==null?void 0:t.useComma)??!1)}updateLabel(){var t;const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const i=MZ._symbolPrintEnter(e);(t=this._options)!=null&&t.conversational?this.label.textContent=_(1647,"{1} to {0}",this._action.label,i):this.label.textContent=_(1648,"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){var t;return(t=e.getLabel())==null?void 0:t.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let Az=class extends wP{constructor(e,t,i,s,o){const r={...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!1,classNames:(t==null?void 0:t.classNames)??(Ue.isThemeIcon(e.item.icon)?Ue.asClassName(e.item.icon):void 0),keybindingProvider:(t==null?void 0:t.keybindingProvider)??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,r),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Ot(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Ue.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=Ng(this._themeService.getColorTheme().type)?Su(i.dark):Su(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};Az=M3([cr(2,Ht),cr(3,gl),cr(4,en)],Az);let Pz=class extends Nd{constructor(e,t,i,s,o,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._defaultActionDisposables=this._register(new ne),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t!=null&&t.togglePrimaryAction?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(c_,c,{keybinding:this._getDefaultActionKeybindingLabel(c)}));const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!0,classNames:(t==null?void 0:t.classNames)??["codicon","codicon-chevron-down"],actionRunner:(t==null?void 0:t.actionRunner)??this._register(new iw)};this._dropdown=this._register(new wP(e,e.actions,this._contextMenuService,h)),t!=null&&t.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof rl&&this.update(u.action)}))}update(e){var t;(t=this._options)!=null&&t.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(c_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends iw{async runAction(i,s){await i.run(void 0)}}),this._container&&this._defaultAction.render(V5(this._container,me(".action-container")))}_getDefaultActionKeybindingLabel(e){var i;let t;if((i=this._options)!=null&&i.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(t=`(${s.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=me(".action-container");this._defaultAction.render(ue(this._container,t)),this._register(J(t,_e.KEY_DOWN,s=>{const o=new ui(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=me(".dropdown-action-container");this._dropdown.render(ue(this._container,i)),this._register(J(i,_e.KEY_DOWN,s=>{var r;const o=new ui(s);o.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)==null||r.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};Pz=M3([cr(2,Ht),cr(3,fn),cr(4,gl),cr(5,uc),cr(6,Ae),cr(7,Qo)],Pz);let Oz=class extends pKe{constructor(e,t,i){super(null,e,e.actions.map(s=>({text:s.id===Xn.ID?"─────────":s.label,isDisabled:!s.enabled})),0,t,xKe,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!kKe(i)}),this.select(Math.max(0,e.actions.findIndex(s=>s.checked)))}render(e){super.render(e),e.style.borderColor=pe(EY)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};Oz=M3([cr(1,zg),cr(2,lt)],Oz);function AZ(n,e,t){return e instanceof rl?n.createInstance(c_,e,t):e instanceof Nv?e.item.isSelection?n.createInstance(Oz,e):e.item.isSplitButton?n.createInstance(Pz,e,{...t,togglePrimaryAction:typeof e.item.isSplitButton!="boolean"?e.item.isSplitButton.togglePrimaryAction:!1}):n.createInstance(Az,e,t):void 0}class Vr extends G{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){var o,r;super(),this._actionRunnerDisposables=this._register(new ne),this.viewItemDisposables=this._register(new T5),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new q),this._onDidCancel=this._register(new q({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new q),this._onWillRun=this._register(new q),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:((o=this.options.triggerKeys)==null?void 0:o.keyDown)??!1,keys:((r=this.options.triggerKeys)==null?void 0:r.keys)??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(Xbe()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new iw,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(a=>this._onDidRun.fire(a))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(a=>this._onWillRun.fire(a))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case 0:i=[15],s=[17];break;case 1:i=[16],s=[18],this.domNode.className+=" vertical";break}this._register(J(this.domNode,_e.KEY_DOWN,a=>{const l=new ui(a);let c=!0;const d=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(l.equals(i[0])||l.equals(i[1]))?c=this.focusPrevious():s&&(l.equals(s[0])||l.equals(s[1]))?c=this.focusNext():l.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():l.equals(14)?c=this.focusFirst():l.equals(13)?c=this.focusLast():l.equals(2)&&d instanceof Nd&&d.trapsArrowNavigation?c=this.focusNext(void 0,!0):this.isTriggerKeyEvent(l)?this._triggerKeys.keyDown?this.doTrigger(l):this.triggerKeyDown=!0:c=!1,c&&(l.preventDefault(),l.stopPropagation())})),this._register(J(this.domNode,_e.KEY_UP,a=>{const l=new ui(a);this.isTriggerKeyEvent(l)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(l)),l.preventDefault(),l.stopPropagation()):(l.equals(2)||l.equals(1026)||l.equals(16)||l.equals(18)||l.equals(15)||l.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(oc(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(os()===this.domNode||!Cs(os(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Nd&&i.isEnabled());t instanceof Nd&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Nd&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])==null?void 0:t.action;if(hn(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new kS(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,J(r,_e.CONTEXT_MENU,c=>{Wt.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),this.focusable){let o=!1;for(const r of this.viewItems){if(!(r instanceof Nd))continue;let a;o||r.action.id===Xn.ID||!r.isEnabled()&&this.options.focusOnlyEnabledItems?a=!1:a=!0,a?(r.setFocusable(!0),o=!0):r.setFocusable(!1)}}typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let s;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,s=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!s.isEnabled()||s.action.id===Xn.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Xn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var o,r;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])==null||o.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;G1(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&G1(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===Xn.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((r=s.showHover)==null||r.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Nd){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=Jt(this.viewItems),this.getContainer().remove(),super.dispose()}}const Fz=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,I9=/(&)?(&)([^\s&])/g;var SP;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(SP||(SP={}));var Bz;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(Bz||(Bz={}));class vy extends Vr{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...wt||jr?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(No.addTarget(o)),this._register(J(o,_e.KEY_DOWN,c=>{new ui(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(J(o,_e.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){Wt.stop(c,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof Goe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(c)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),jr&&this._register(J(o,_e.KEY_DOWN,c=>{const d=new ui(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Wt.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Wt.stop(c,!0))})),this._register(J(this.domNode,_e.MOUSE_OUT,c=>{const d=c.relatedTarget;Cs(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(J(this.actionsList,_e.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!Cs(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(No.addTarget(this.actionsList)),this._register(J(this.actionsList,Li.Tap,c=>{let d=c.initialTarget;if(!(!d||!Cs(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new wD(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(J(o,Li.Change,c=>{Wt.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(J(a,_e.MOUSE_UP,c=>{c.preventDefault()}));const l=Oe(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>{var h;return(h=i.submenuIds)!=null&&h.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof Xn&&(d===t.length-1||d===0||t[d-1]instanceof Xn))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof Yoe)).forEach((c,d,h)=>{c.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(pA(e)?this.styleSheet=lc(e):(vy.globalStyleSheet||(vy.globalStyleSheet=lc()),this.styleSheet=vy.globalStyleSheet)),this.styleSheet.textContent=MKe(t,pA(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(J(this.element,_e.MOUSE_UP,o=>{if(Wt.stop(o,!0),$r){if(new ao(Oe(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(J(this.element,_e.CONTEXT_MENU,o=>{Wt.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ue(this.element,me("a.action-menu-item")),this._action.id===Xn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ue(this.item,me("span.menu-item-check"+Ue.asCSSSelector(de.menuSelection))),this.check.setAttribute("role","none"),this.label=ue(this.item,me("span.action-label")),this.options.label&&this.options.keybinding&&(ue(this.item,me("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)==null||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){js(this.label);let t=wZ(this.action.label);if(t){const i=RKe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=Fz.exec(t);if(s){t=Vc(t),I9.lastIndex=0;let o=I9.exec(t);for(;o&&o[1];)o=I9.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(rD(r(t.substr(0,o.index))," "),me("u",{"aria-hidden":"true"},o[3]),Rge(r(t.substr(o.index+o[0].length))," ")):this.label.textContent=r(t).trim(),(e=this.item)==null||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.textContent=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class Goe extends hve{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new ne),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:SP.Right,vertical:Bz.Below},this.showScheduler=new ai(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ai(()=>{this.element&&!Cs(os(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=ue(this.item,me("span.submenu-indicator"+Ue.asCSSSelector(de.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(J(this.element,_e.KEY_UP,t=>{const i=new ui(t);(i.equals(17)||i.equals(3))&&(Wt.stop(t,!0),this.createSubmenu(!0))})),this._register(J(this.element,_e.KEY_DOWN,t=>{const i=new ui(t);os()===this.item&&(i.equals(17)||i.equals(3))&&Wt.stop(t,!0)})),this._register(J(this.element,_e.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(J(this.element,_e.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(J(this.element,_e.FOCUS_OUT,t=>{this.element&&!Cs(os(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Wt.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=_0(e.width,t.width,{position:s.horizontal===SP.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new ui(d).equals(15)&&(Wt.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(J(this.submenuContainer,_e.KEY_DOWN,d=>{new ui(d).equals(15)&&Wt.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)==null||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Yoe extends kS{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function RKe(n){const e=Fz,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function Zoe(n){const e=Ege()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function MKe(n,e){let t=` +`)}}const nKe={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropOverBackground:"#383B3D",listDropBetweenBackground:"#EEEEEE",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:se.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:se.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:se.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},sKe={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function oKe(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class aKe{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var r;let o=0;for(const a of this.renderers)(r=a.disposeElement)==null||r.call(a,e,t,i[o],s),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class lKe{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return{container:e,disposables:new ne}}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e),o=s&&typeof s!="string"?s:wi(s);i.disposables.add(qe(a=>{this.setAriaLabel(a.readObservable(o),i.container)}));const r=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof r=="number"?i.container.setAttribute("aria-level",`${r}`):i.container.removeAttribute("aria-level")}setAriaLabel(e,t){e?t.setAttribute("aria-label",e):t.removeAttribute("aria-label")}disposeElement(e,t,i){i.disposables.clear()}disposeTemplate(e){e.disposables.dispose()}}class cKe{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,e,t)}onDragOver(e,t,i,s,o){return this.dnd.onDragOver(e,t,i,s,o)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)==null||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}drop(e,t,i,s,o){this.dnd.drop(e,t,i,s,o)}dispose(){this.dnd.dispose()}}class pl{get onDidChangeFocus(){return ve.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ve.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=ve.chain(this.disposables.add(new ti(this.view.domNode,"keydown")).event,o=>o.map(r=>new ui(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ht.stop(r,!0)).filter(()=>!1)),i=ve.chain(this.disposables.add(new ti(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new ui(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ht.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=ve.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new lo(Pe(this.view.domNode),l),browserEvent:l})));return ve.any(t,i,s)}get onKeyDown(){return this.disposables.add(new ti(this.view.domNode,"keydown")).event}get onDidFocus(){return ve.signal(this.disposables.add(new ti(this.view.domNode,"focus",!0)).event)}get onDidBlur(){return ve.signal(this.disposables.add(new ti(this.view.domNode,"blur",!0)).event)}constructor(e,t,i,s,o=sKe){var c,d,h;this.user=e,this._options=o,this.focus=new vP("focused"),this.anchor=new vP("anchor"),this.eventBufferer=new oD,this._ariaLabel="",this.disposables=new ne,this._onDidDispose=new q,this.onDidDispose=this._onDidDispose.event;const r=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(c=this._options.accessibilityProvider)==null?void 0:c.getWidgetRole():"list";this.selection=new Yqe(r!=="listbox");const a=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(a.push(new lKe(this.accessibilityProvider)),(h=(d=this.accessibilityProvider).onDidChangeActiveDescendant)==null||h.call(d,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(u=>new aKe(u.templateId,[...a,u]));const l={...o,dnd:o.dnd&&new cKe(this,o.dnd)};if(this.view=this.createListView(t,i,s,l),this.view.domNode.setAttribute("role",r),o.styleController)this.styleController=o.styleController(this.view.domId);else{const u=sc(this.view.domNode);this.styleController=new iKe(u,this.view.domId)}if(this.spliceable=new Fqe([new I9(this.focus,this.view,o.identityProvider),new I9(this.selection,this.view,o.identityProvider),new I9(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new eKe(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new Zbe(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const u=o.keyboardNavigationDelegate||Qqe;this.typeNavigationController=new Jqe(this,this.view,o.keyboardNavigationLabelProvider,o.keyboardNavigationEventFilter??(()=>!0),u),this.disposables.add(this.typeNavigationController)}if(this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider){const u=this.accessibilityProvider.getWidgetAriaLabel(),f=u&&typeof u!="string"?u:wi(u);this.disposables.add(qe(g=>{this.ariaLabel=g.readObservable(f)}))}this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Zc(e,t,i,s)}createMouseController(e){return new Jbe(this)}updateOptions(e={}){var t,i;this._options={...this._options,...e},(t=this.typeNavigationController)==null||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)==null||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new G_(this.user,`Invalid start index: ${e}`);if(t<0)throw new G_(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}indexOf(e){return this.view.indexOf(e)}indexAt(e){return this.view.indexAt(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new G_(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new G_(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return this.anchor.get().at(0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new G_(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}async focusNextPage(e,t){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),await wu(0),await this.focusNextPage(e,t))}}async focusPreviousPage(e,t,i=()=>0){let s;const o=i(),r=this.view.getScrollTop()+o;r===0?s=this.view.indexAt(r):s=this.view.indexAfter(r-1);const a=this.getFocus()[0];if(a!==s&&(a===void 0||a>=s)){const l=this.findNextIndex(s,!1,t);l>-1&&a!==l?this.setFocus([l],e):this.setFocus([s],e)}else{const l=r;this.view.setScrollTop(r-this.view.renderHeight-o),this.view.getScrollTop()+i()!==l&&(this.setFocus([]),await wu(0),await this.focusPreviousPage(e,t,i))}}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t,i=0){if(e<0||e>=this.length)throw new G_(this.user,`Invalid index ${e}`);const s=this.view.getScrollTop(),o=this.view.elementTop(e),r=this.view.elementHeight(e);if(wg(t)){const a=r-this.view.renderHeight+i;this.view.setScrollTop(a*lr(t,0,1)+o-i)}else{const a=o+r,l=s+this.view.renderHeight;o=l||(o=l&&r>=this.view.renderHeight?this.view.setScrollTop(o-i):a>=l&&this.view.setScrollTop(a-this.view.renderHeight))}}getRelativeTop(e,t=0){if(e<0||e>=this.length)throw new G_(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(si+this.view.renderHeight)return null;const r=o-this.view.renderHeight+t;return Math.abs((i+t-s)/r)}getHTMLElement(){return this.view.domNode}getScrollableElement(){return this.view.scrollableElementDomNode}getElementID(e){return this.view.getElementDomId(e)}getElementTop(e){return this.view.elementTop(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var t;const e=this.focus.get();if(e.length>0){let i;(t=this.accessibilityProvider)!=null&&t.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(e[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(e[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}y_([wn],pl.prototype,"onDidChangeFocus",null);y_([wn],pl.prototype,"onDidChangeSelection",null);y_([wn],pl.prototype,"onContextMenu",null);y_([wn],pl.prototype,"onKeyDown",null);y_([wn],pl.prototype,"onDidFocus",null);y_([wn],pl.prototype,"onDidBlur",null);const hv=me,eve="selectOption.entry.template";class dKe{get templateId(){return eve}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=he(e,hv(".option-text")),t.detail=he(e,hv(".option-detail")),t.decoratorRight=he(e,hv(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.textContent=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}const Fh=class Fh extends G{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._selectionDetailsDisposables=this._register(new ne),this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Fh.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new q,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}setTitle(e){!this._hover&&e?this._hover=this._register(td().setupManagedHover(Pu("mouse"),this.selectElement,e)):this._hover&&this._hover.update(e)}getHeight(){return 22}getTemplateId(){return eve}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=me(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=he(this.selectDropDownContainer,hv(".select-box-details-pane"));const t=he(this.selectDropDownContainer,hv(".select-box-dropdown-container-width-control")),i=he(t,hv(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",he(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=sc(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(J(this.selectDropDownContainer,_e.DRAG_START,s=>{Ht.stop(s,!0)}))}registerListeners(){this._register(kn(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)})),this._register(J(this.selectElement,_e.CLICK,t=>{Ht.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(J(this.selectElement,_e.MOUSE_DOWN,t=>{Ht.stop(t)}));let e;this._register(J(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(J(this.selectElement,"touchend",t=>{Ht.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(J(this.selectElement,_e.KEY_DOWN,t=>{const i=new ui(t);let s=!1;yt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),Ht.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Fi(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)==null||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&this.setTitle(this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){const e=this.styles.selectBackground??"",t=this.styles.selectForeground??"",i=this.styles.selectBorder??"";this.selectElement.style.backgroundColor=e,this.selectElement.style.color=t,this.selectElement.style.borderColor=i}styleList(){const e=this.styles.selectBackground??"",t=dg(this.styles.selectListBackground,e);this.selectDropDownListContainer.style.backgroundColor=t,this.selectionDetailsPane.style.backgroundColor=t;const i=this.styles.focusBorder??"";this.selectDropDownContainer.style.outlineColor=i,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.textContent="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{this.selectDropDownContainer.remove()}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Pe(this.selectElement),i=dn(this.selectElement),s=Pe(this.selectElement).getComputedStyle(this.selectElement),o=parseFloat(s.getPropertyValue("--dropdown-padding-top"))+parseFloat(s.getPropertyValue("--dropdown-padding-bottom")),r=t.innerHeight-i.top-i.height-(this.selectBoxOptions.minBottomMargin||0),a=i.top-Fh.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,l=this.selectElement.offsetWidth,c=this.setWidthControlElement(this.widthControlElement),d=Math.max(c,Math.round(l)).toString()+"px";this.selectDropDownContainer.style.width=d,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,f=h+o+u,g=Math.floor((r-o-u)/this.getHeight()),p=Math.floor((a-o-u)/this.getHeight());if(e)return i.top+i.height>t.innerHeight-22||i.topg&&this.options.length>g?(this._dropDownPosition=1,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownListContainer.remove(),this.selectionDetailsPane.remove(),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(i.top+i.height>t.innerHeight-22||i.topr&&(h=g*this.getHeight())}else f>a&&(h=p*this.getHeight());return this.selectList.layout(h),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=h+o+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+o+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=d,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=aa(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=he(e,hv(".select-box-dropdown-list-container")),this.listRenderer=new dKe,this.selectList=this._register(new pl("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>_(16,"Select Box"),getRole:()=>yt?"":"option",getWidgetRole:()=>"listbox"}})),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ti(this.selectDropDownListContainer,"keydown")),i=ve.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new ui(o)));this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ve.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(J(this.selectList.getHTMLElement(),_e.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(J(this.selectDropDownContainer,_e.FOCUS_OUT,s=>{!this._isVisible||ys(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Ht.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Ht.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Ht.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Ht.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Ht.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Tf.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(J(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(kn(this.selectElement,"click",e=>{Ht.stop(e,!0)})),this._register(kn(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(kn(this.selectElement,"keydown",e=>{let t=!1;yt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Fi(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new J1)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Eo.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,qr&&this._register(J(e,_e.DRAG_START,s=>{var o;return(o=s.dataTransfer)==null?void 0:o.setData(cw.TEXT,this._action.label)}))),this._register(J(t,xi.Tap,s=>this.onClick(s,!0))),this._register(J(t,_e.MOUSE_DOWN,s=>{i||Ht.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),yt&&this._register(J(t,_e.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(J(t,_e.CLICK,s=>{Ht.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(J(t,_e.DBLCLICK,s=>{Ht.stop(s,!0)})),[_e.MOUSE_UP,_e.MOUSE_OUT].forEach(s=>{this._register(J(t,s,o=>{Ht.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var s;Ht.stop(e,!0);const i=Ol(this._context)?(s=this.options)!=null&&s.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,i)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getClass(){return this.action.class}getTooltip(){return this.action.tooltip}getHoverContents(){return this.getTooltip()}updateTooltip(){if(!this.element)return;const e=this.getHoverContents()??"";if(this.updateAriaLabel(),!this.customHover&&e!==""){const t=this.options.hoverDelegate??Pu("element");this.customHover=this._store.add(td().setupManagedHover(t,this.element,e))}else this.customHover&&this.customHover.update(e)}updateAriaLabel(){if(this.element){const e=this.getTooltip()??"";this.element.setAttribute("aria-label",e)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class xS extends Td{constructor(e,t,i){i={...i,icon:i.icon!==void 0?i.icon:!1,label:i.label!==void 0?i.label:!0},super(e,t,i),this.options=i,this.cssClass=""}render(e){super.render(e),Ft(this.element);const t=document.createElement("a");if(t.classList.add("action-label"),t.setAttribute("role",this.getDefaultAriaRole()),this.label=t,this.element.appendChild(t),this.options.label&&this.options.keybinding&&!this.options.keybindingNotRenderedWithLabel){const i=document.createElement("span");i.classList.add("keybinding"),i.textContent=this.options.keybinding,this.element.appendChild(i)}this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Zn.ID?"presentation":this.options.isMenu?"menuitem":this.options.isTabList?"tab":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label,this.options.keybinding&&(e=_(0,"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.getClass(),this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)==null||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)==null||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)==null||t.classList.add("disabled"))}updateAriaLabel(){if(this.label){const e=this.getTooltip()??"";this.label.setAttribute("aria-label",e)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.options.isTabList?this.label.setAttribute("aria-selected",this.action.checked?"true":"false"):(this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox"))):(this.label.classList.remove("checked"),this.label.removeAttribute(this.options.isTabList?"aria-selected":"aria-checked"),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class fKe extends Td{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new uKe(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)==null||e.focus()}blur(){var e;(e=this.selectBox)==null||e.blur()}render(e){this.selectBox.render(e)}}class gKe extends J1{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new q),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=he(e,me(".monaco-dropdown")),this._label=he(this._element,me(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[_e.CLICK,_e.MOUSE_DOWN,xi.Tap])this._register(J(this.element,o,r=>Ht.stop(r,!0)));for(const o of[_e.MOUSE_DOWN,xi.Tap])this._register(J(this._label,o,r=>{JG(r)&&r.button!==0||(this.visible?this.hide():this.show())}));this._register(J(this._label,_e.KEY_DOWN,o=>{const r=new ui(o);(r.equals(3)||r.equals(10))&&(Ht.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Eo.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}dispose(){super.dispose(),this.hide(),this.boxContainer&&(this.boxContainer.remove(),this.boxContainer=void 0),this.contents&&(this.contents.remove(),this.contents=void 0),this._label&&(this._label.remove(),this._label=void 0)}}class pKe extends gKe{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class wP extends Td{get onDidChangeVisibility(){return this._onDidChangeVisibility.event}constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new q),this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>(this.element=he(o,me("a.action-label")),this.renderLabel(this.element)),i=Array.isArray(this.menuActionsOrProvider),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new pKe(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)==null||r.setAttribute("aria-expanded",`${o}`),this._onDidChangeVisibility.fire(o)})),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const o=this;this.dropdownMenu.menuOptions={...this.dropdownMenu.menuOptions,get anchorAlignment(){return o.options.anchorAlignmentProvider()}}}this.updateTooltip(),this.updateEnabled()}renderLabel(e){let t=[];return typeof this.options.classNames=="string"?t=this.options.classNames.split(/\s+/g).filter(i=>!!i):this.options.classNames&&(t=this.options.classNames),t.find(i=>i==="icon")||t.push("codicon"),e.classList.add(...t),this._action.label&&this._register(td().setupManagedHover(this.options.hoverDelegate??Pu("mouse"),e,this._action.label)),null}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)==null||e.show()}updateEnabled(){var t,i;const e=!this.action.enabled;(t=this.actionItem)==null||t.classList.toggle("disabled",e),(i=this.element)==null||i.classList.toggle("disabled",e)}}function mKe(n){return!!n&&typeof n=="object"&&typeof n.original=="string"&&typeof n.value=="string"}function _Ke(n){return n?n.condition!==void 0:!1}function bKe(n,e){const t={...e};for(const i in n){const s=n[i];t[i]=s!==void 0?ge(s):void 0}return t}const tve={keybindingLabelBackground:ge(s7e),keybindingLabelForeground:ge(o7e),keybindingLabelBorder:ge(r7e),keybindingLabelBottomBorder:ge(a7e),keybindingLabelShadow:ge(ix)},vKe={buttonForeground:ge(f3),buttonSeparator:ge(U8e),buttonBackground:ge(lv),buttonHoverBackground:ge(q8e),buttonSecondaryForeground:ge(ume),buttonSecondaryBackground:ge(FA),buttonSecondaryHoverBackground:ge(G8e),buttonBorder:ge(K8e)},wKe={progressBarBackground:ge(a8e)},CP={inputActiveOptionBorder:ge(mD),inputActiveOptionForeground:ge(_D),inputActiveOptionBackground:ge(nx)};ge(DL),ge(Y8e),ge(Z8e),ge(X8e),ge(Q8e),ge(J8e),ge(e7e);const TZ={checkboxBackground:ge(IY),checkboxBorder:ge(t7e),checkboxForeground:ge(EY),checkboxDisabledBackground:ge(i7e),checkboxDisabledForeground:ge(n7e)};ge(el),ge(c3),ge(ix),ge(SY),ge(k8e),ge(I8e),ge(E8e),ge(o8e);const yP={inputBackground:ge(eV),inputForeground:ge(dme),inputBorder:ge(hme),inputValidationInfoBorder:ge(F8e),inputValidationInfoBackground:ge(P8e),inputValidationInfoForeground:ge(O8e),inputValidationWarningBorder:ge(H8e),inputValidationWarningBackground:ge(B8e),inputValidationWarningForeground:ge(W8e),inputValidationErrorBorder:ge(j8e),inputValidationErrorBackground:ge(V8e),inputValidationErrorForeground:ge(z8e)},CKe={listFilterWidgetBackground:ge(w7e),listFilterWidgetOutline:ge(C7e),listFilterWidgetNoMatchesOutline:ge(y7e),listFilterWidgetShadow:ge(S7e),inputBoxStyles:yP,toggleStyles:CP},ive={badgeBackground:ge(PR),badgeForeground:ge(r8e),badgeBorder:ge(Tt)};ge(x8e),ge(S8e),ge(wne),ge(wne),ge(L8e);const lx={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:ge(l7e),listFocusForeground:ge(c7e),listFocusOutline:ge(d7e),listActiveSelectionBackground:ge(ew),listActiveSelectionForeground:ge(IE),listActiveSelectionIconForeground:ge(fme),listFocusAndSelectionOutline:ge(h7e),listFocusAndSelectionBackground:ge(ew),listFocusAndSelectionForeground:ge(IE),listInactiveSelectionBackground:ge(u7e),listInactiveSelectionIconForeground:ge(g7e),listInactiveSelectionForeground:ge(f7e),listInactiveFocusBackground:ge(p7e),listInactiveFocusOutline:ge(m7e),listHoverBackground:ge(gme),listHoverForeground:ge(pme),listDropOverBackground:ge(_7e),listDropBetweenBackground:ge(b7e),listSelectionOutline:ge(Hi),listHoverOutline:ge(Hi),treeIndentGuidesStroke:ge(mme),treeInactiveIndentGuidesStroke:ge(x7e),treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:ge(l3),tableColumnsBorder:ge(L7e),tableOddRowsBackgroundColor:ge(k7e)};function Ww(n){return bKe(n,lx)}const yKe={selectBackground:ge(u3),selectListBackground:ge($8e),selectForeground:ge(LY),decoratorRightForeground:ge(_me),selectBorder:ge(kY),focusBorder:ge(Cu),listFocusBackground:ge(NE),listInactiveSelectionIconForeground:ge(NY),listFocusForeground:ge(EE),listFocusOutline:Jpe(Hi,se.transparent.toString()),listHoverBackground:ge(gme),listHoverForeground:ge(pme),listHoverOutline:ge(Hi),selectListBorder:ge(bY),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropOverBackground:void 0,listDropBetweenBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0,treeStickyScrollBackground:void 0,treeStickyScrollBorder:void 0,treeStickyScrollShadow:void 0},SKe={shadowColor:ge(ix),borderColor:ge(E7e),foregroundColor:ge(N7e),backgroundColor:ge(D7e),selectionForegroundColor:ge(T7e),selectionBackgroundColor:ge(R7e),selectionBorderColor:ge(M7e),separatorColor:ge(A7e),scrollbarShadow:ge(l3),scrollbarSliderBackground:ge(sme),scrollbarSliderHoverBackground:ge(ome),scrollbarSliderActiveBackground:ge(rme)};function xKe(n,e){if(Tu)return!1;const t=LKe(n,e),i=n.getValue("window");return(i==null?void 0:i.menuStyle)==="native"?!(!yt&&!t):(i==null?void 0:i.menuStyle)==="custom"?!1:t}function LKe(n,e){return e||(e=nve(n)),e==="native"}function nve(n){if(Tu)return"custom";const e=n.getValue("window");if(e){if(yt&&e.nativeTabs===!0||yt&&e.nativeFullScreen===!1)return"native";const s=e.titleBarStyle;if(s==="native"||s==="custom")return s}return"custom"}function kKe(n){if(Tu||yt||nve(n)==="native")return"native";const e=n.getValue("window"),t=e==null?void 0:e.controlsStyle;return t==="custom"||t==="hidden"?t:"native"}var M3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hr=function(n,e){return function(t,i){e(t,i,n)}};function IKe(n,e){const t=[];return EKe(n,t),t}function EKe(n,e,t){const i=jf.getInstance(),s=i.keyStatus.altKey||($s||Ur)&&i.keyStatus.shiftKey;rve(n,e,s,o=>o==="navigation")}function sve(n,e,t,i){const s={primary:[],secondary:[]};return ove(n,s,e,t,i),s}function NKe(n,e,t,i){const s=[];return ove(n,s,e,t,i),s}function ove(n,e,t,i,s){rve(n,e,!1,typeof t=="string"?r=>r===t:t,i,s)}function rve(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let h;i(c)?(h=r,h.length>0&&o&&h.push(new Zn)):(h=a,h.length>0&&h.push(new Zn));for(let u of d){t&&(u=u instanceof rl&&u.alt?u.alt:u);const f=h.push(u);u instanceof cS&&l.add({group:c,action:u,index:f-1})}}for(const{group:c,action:d,index:h}of l){const u=i(c)?r:a,f=d.actions;s(d,c,u.length)&&u.splice(h,1,...f)}}let l_=class extends xS{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate,keybindingNotRenderedWithLabel:t==null?void 0:t.keybindingNotRenderedWithLabel}),this._options=t,this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new Gt),this._altKey=jf.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}async onClick(e){e.preventDefault(),e.stopPropagation();try{await this.actionRunner.run(this._commandAction,this._context)}catch(t){this._notificationService.error(t)}}render(e){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var o;const s=!!((o=this._menuItemAction.alt)!=null&&o.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);s!==this._wantsAltCommand&&(this._wantsAltCommand=s,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(J(e,"mouseleave",s=>{t=!1,i()})),this._register(J(e,"mouseenter",s=>{t=!0,i()})),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var o;const e=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),t=e&&e.getLabel(),i=this._commandAction.tooltip||this._commandAction.label;let s=t?_(1644,"{0} ({1})",i,t):i;if(!this._wantsAltCommand&&((o=this._menuItemAction.alt)!=null&&o.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?_(1645,"{0} ({1})",r,l):r;s=_(1646,`{0} +[{1}] {2}`,s,NZ.modifierLabels[ua].altKey,c)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&_Ke(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if($e.isThemeIcon(s)){const o=$e.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Re(()=>{i.classList.remove(...o)})}else i.style.backgroundImage=Ng(this._themeService.getColorTheme().type)?xu(s.dark):xu(s.light),i.classList.add("icon"),this._itemClassDispose.value=Vc(Re(()=>{i.style.backgroundImage="",i.classList.remove("icon")}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}};l_=M3([hr(2,Vt),hr(3,fn),hr(4,Xe),hr(5,en),hr(6,gl),hr(7,Us)],l_);class RZ extends l_{render(e){var t;this.options.label=!0,this.options.icon=!1,super.render(e),e.classList.add("text-only"),e.classList.toggle("use-comma",((t=this._options)==null?void 0:t.useComma)??!1)}updateLabel(){var t;const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const i=RZ._symbolPrintEnter(e);(t=this._options)!=null&&t.conversational?this.label.textContent=_(1647,"{1} to {0}",this._action.label,i):this.label.textContent=_(1648,"{0} ({1})",this._action.label,i)}}static _symbolPrintEnter(e){var t;return(t=e.getLabel())==null?void 0:t.replace(/\benter\b/gi,"⏎").replace(/\bEscape\b/gi,"Esc")}}let Mz=class extends wP{constructor(e,t,i,s,o){const r={...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!1,classNames:(t==null?void 0:t.classNames)??($e.isThemeIcon(e.item.icon)?$e.asClassName(e.item.icon):void 0),keybindingProvider:(t==null?void 0:t.keybindingProvider)??(a=>i.lookupKeybinding(a.id))};super(e,{getActions:()=>e.actions},s,r),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Ft(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!$e.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=Ng(this._themeService.getColorTheme().type)?xu(i.dark):xu(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};Mz=M3([hr(2,Vt),hr(3,gl),hr(4,en)],Mz);let Az=class extends Td{constructor(e,t,i,s,o,r,a,l){super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._defaultActionDisposables=this._register(new ne),this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let c;const d=t!=null&&t.togglePrimaryAction?l.get(this._storageKey,1):void 0;d&&(c=e.actions.find(u=>d===u.id)),c||(c=e.actions[0]),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(l_,c,{keybinding:this._getDefaultActionKeybindingLabel(c)}));const h={keybindingProvider:u=>this._keybindingService.lookupKeybinding(u.id),...t,menuAsChild:(t==null?void 0:t.menuAsChild)??!0,classNames:(t==null?void 0:t.classNames)??["codicon","codicon-chevron-down"],actionRunner:(t==null?void 0:t.actionRunner)??this._register(new J1)};this._dropdown=this._register(new wP(e,e.actions,this._contextMenuService,h)),t!=null&&t.togglePrimaryAction&&this._register(this._dropdown.actionRunner.onDidRun(u=>{u.action instanceof rl&&this.update(u.action)}))}update(e){var t;(t=this._options)!=null&&t.togglePrimaryAction&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultActionDisposables.clear(),this._defaultAction=this._defaultActionDisposables.add(this._instaService.createInstance(l_,e,{keybinding:this._getDefaultActionKeybindingLabel(e)})),this._defaultAction.actionRunner=this._defaultActionDisposables.add(new class extends J1{async runAction(i,s){await i.run(void 0)}}),this._container&&this._defaultAction.render(V5(this._container,me(".action-container")))}_getDefaultActionKeybindingLabel(e){var i;let t;if((i=this._options)!=null&&i.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(t=`(${s.getLabel()})`)}return t}setActionContext(e){super.setActionContext(e),this._defaultAction.setActionContext(e),this._dropdown.setActionContext(e)}set actionRunner(e){super.actionRunner=e,this._defaultAction.actionRunner=e,this._dropdown.actionRunner=e}get actionRunner(){return super.actionRunner}render(e){this._container=e,super.render(this._container),this._container.classList.add("monaco-dropdown-with-default");const t=me(".action-container");this._defaultAction.render(he(this._container,t)),this._register(J(t,_e.KEY_DOWN,s=>{const o=new ui(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=me(".dropdown-action-container");this._dropdown.render(he(this._container,i)),this._register(J(i,_e.KEY_DOWN,s=>{var r;const o=new ui(s);o.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(r=this._defaultAction.element)==null||r.focus(),o.stopPropagation())}))}focus(e){e?this._dropdown.focus():(this._defaultAction.element.tabIndex=0,this._defaultAction.element.focus())}blur(){this._defaultAction.element.tabIndex=-1,this._dropdown.blur(),this._container.blur()}setFocusable(e){e?this._defaultAction.element.tabIndex=0:(this._defaultAction.element.tabIndex=-1,this._dropdown.setFocusable(!1))}};Az=M3([hr(2,Vt),hr(3,fn),hr(4,gl),hr(5,lc),hr(6,Ae),hr(7,Jo)],Az);let Pz=class extends fKe{constructor(e,t,i){super(null,e,e.actions.map(s=>({text:s.id===Zn.ID?"─────────":s.label,isDisabled:!s.enabled})),0,t,yKe,{ariaLabel:e.tooltip,optionsAsChildren:!0,useCustomDrawn:!xKe(i)}),this.select(Math.max(0,e.actions.findIndex(s=>s.checked)))}render(e){super.render(e),e.style.borderColor=ge(kY)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};Pz=M3([hr(1,zg),hr(2,lt)],Pz);function MZ(n,e,t){return e instanceof rl?n.createInstance(l_,e,t):e instanceof kv?e.item.isSelection?n.createInstance(Pz,e):e.item.isSplitButton?n.createInstance(Az,e,{...t,togglePrimaryAction:typeof e.item.isSplitButton!="boolean"?e.item.isSplitButton.togglePrimaryAction:!1}):n.createInstance(Mz,e,t):void 0}class jr extends G{get onDidBlur(){return this._onDidBlur.event}get onDidCancel(){return this._onDidCancel.event}get onDidRun(){return this._onDidRun.event}get onWillRun(){return this._onWillRun.event}constructor(e,t={}){var o,r;super(),this._actionRunnerDisposables=this._register(new ne),this.viewItemDisposables=this._register(new T5),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new q),this._onDidCancel=this._register(new q({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.cancelHasListener=!1,this._onDidRun=this._register(new q),this._onWillRun=this._register(new q),this.options=t,this._context=t.context??null,this._orientation=this.options.orientation??0,this._triggerKeys={keyDown:((o=this.options.triggerKeys)==null?void 0:o.keyDown)??!1,keys:((r=this.options.triggerKeys)==null?void 0:r.keys)??[3,10]},this._hoverDelegate=t.hoverDelegate??this._register(Kbe()),this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new J1,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(a=>this._onDidRun.fire(a))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(a=>this._onWillRun.fire(a))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar";let i,s;switch(this._orientation){case 0:i=[15],s=[17];break;case 1:i=[16],s=[18],this.domNode.className+=" vertical";break}this._register(J(this.domNode,_e.KEY_DOWN,a=>{const l=new ui(a);let c=!0;const d=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;i&&(l.equals(i[0])||l.equals(i[1]))?c=this.focusPrevious():s&&(l.equals(s[0])||l.equals(s[1]))?c=this.focusNext():l.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():l.equals(14)?c=this.focusFirst():l.equals(13)?c=this.focusLast():l.equals(2)&&d instanceof Td&&d.trapsArrowNavigation?c=this.focusNext(void 0,!0):this.isTriggerKeyEvent(l)?this._triggerKeys.keyDown?this.doTrigger(l):this.triggerKeyDown=!0:c=!1,c&&(l.preventDefault(),l.stopPropagation())})),this._register(J(this.domNode,_e.KEY_UP,a=>{const l=new ui(a);this.isTriggerKeyEvent(l)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(l)),l.preventDefault(),l.stopPropagation()):(l.equals(2)||l.equals(1026)||l.equals(16)||l.equals(18)||l.equals(15)||l.equals(17))&&this.updateFocusedItem()})),this.focusTracker=this._register(tc(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(as()===this.domNode||!ys(as(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=1?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Td&&i.isEnabled());t instanceof Td&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Td&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){var e,t;for(let i=0;it.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])==null?void 0:t.action;if(hn(e)){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l={hoverDelegate:this._hoverDelegate,...t,isTabList:this.options.ariaRole==="tablist"};this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new xS(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,J(r,_e.CONTEXT_MENU,c=>{Ht.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),this.focusable){let o=!1;for(const r of this.viewItems){if(!(r instanceof Td))continue;let a;o||r.action.id===Zn.ID||!r.isEnabled()&&this.options.focusOnlyEnabledItems?a=!1:a=!0,a?(r.setFocusable(!0),o=!0):r.setFocusable(!1)}}typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}getWidth(e){if(e>=0&&e=0&&e"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e,t){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const i=this.focusedItem;let s;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=i,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,s=this.viewItems[this.focusedItem]}while(this.focusedItem!==i&&(this.options.focusOnlyEnabledItems&&!s.isEnabled()||s.action.id===Zn.ID));return this.updateFocus(void 0,void 0,t),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Zn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var o,r;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((o=this.viewItems[this.previouslyFocusedItem])==null||o.blur());const s=this.focusedItem!==void 0?this.viewItems[this.focusedItem]:void 0;if(s){let a=!0;U1(s.focus)||(a=!1),this.options.focusOnlyEnabledItems&&U1(s.isEnabled)&&!s.isEnabled()&&(a=!1),s.action.id===Zn.ID&&(a=!1),a?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0),a&&((r=s.showHover)==null||r.call(s))}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Td){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}async run(e,t){await this._actionRunner.run(e,t)}dispose(){this._context=void 0,this.viewItems=ei(this.viewItems),this.getContainer().remove(),super.dispose()}}const Oz=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,E9=/(&)?(&)([^\s&])/g;var SP;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(SP||(SP={}));var Fz;(function(n){n[n.Above=0]="Above",n[n.Below=1]="Below"})(Fz||(Fz={}));class _y extends jr{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:c=>this.doGetActionViewItem(c,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...yt||Ur?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.initializeOrUpdateStyleSheet(e,s),this._register(Eo.addTarget(o)),this._register(J(o,_e.KEY_DOWN,c=>{new ui(c).equals(2)&&c.preventDefault()})),i.enableMnemonics&&this._register(J(o,_e.KEY_DOWN,c=>{const d=c.key.toLocaleLowerCase();if(this.mnemonics.has(d)){Ht.stop(c,!0);const h=this.mnemonics.get(d);if(h.length===1&&(h[0]instanceof qoe&&h[0].container&&this.focusItemByElement(h[0].container),h[0].onClick(c)),h.length>1){const u=h.shift();u&&u.container&&(this.focusItemByElement(u.container),h.push(u)),this.mnemonics.set(d,h)}}})),Ur&&this._register(J(o,_e.KEY_DOWN,c=>{const d=new ui(c);d.equals(14)||d.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Ht.stop(c,!0)):(d.equals(13)||d.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Ht.stop(c,!0))})),this._register(J(this.domNode,_e.MOUSE_OUT,c=>{const d=c.relatedTarget;ys(d,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),c.stopPropagation())})),this._register(J(this.actionsList,_e.MOUSE_OVER,c=>{let d=c.target;if(!(!d||!ys(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}})),this._register(Eo.addTarget(this.actionsList)),this._register(J(this.actionsList,xi.Tap,c=>{let d=c.initialTarget;if(!(!d||!ys(d,this.actionsList)||d===this.actionsList)){for(;d.parentElement!==this.actionsList&&d.parentElement!==null;)d=d.parentElement;if(d.classList.contains("action-item")){const h=this.focusedItem;this.setFocusedItem(d),h!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new wD(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(J(o,xi.Change,c=>{Ht.stop(c,!0);const d=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:d-c.translationY})})),this._register(J(a,_e.MOUSE_UP,c=>{c.preventDefault()}));const l=Pe(e);o.style.maxHeight=`${Math.max(10,l.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((c,d)=>{var h;return(h=i.submenuIds)!=null&&h.has(c.id)?(console.warn(`Found submenu cycle: ${c.id}`),!1):!(c instanceof Zn&&(d===t.length-1||d===0||t[d-1]instanceof Zn))}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(c=>!(c instanceof Koe)).forEach((c,d,h)=>{c.updatePositionInSet(d+1,h.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(pA(e)?this.styleSheet=sc(e):(_y.globalStyleSheet||(_y.globalStyleSheet=sc()),this.styleSheet=_y.globalStyleSheet)),this.styleSheet.textContent=TKe(t,pA(e))}styleScrollElement(e,t){const i=t.foregroundColor??"",s=t.backgroundColor??"",o=t.borderColor?`1px solid ${t.borderColor}`:"",r="5px",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=o,e.style.borderRadius=r,e.style.color=i,e.style.backgroundColor=s,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(J(this.element,_e.MOUSE_UP,o=>{if(Ht.stop(o,!0),qr){if(new lo(Pe(this.element),o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(J(this.element,_e.CONTEXT_MENU,o=>{Ht.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=he(this.element,me("a.action-menu-item")),this._action.id===Zn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=he(this.item,me("span.menu-item-check"+$e.asCSSSelector(de.menuSelection))),this.check.setAttribute("role","none"),this.label=he(this.item,me("span.action-label")),this.options.label&&this.options.keybinding&&(he(this.item,me("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)==null||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){js(this.label);let t=vZ(this.action.label);if(t){const i=DKe(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=Oz.exec(t);if(s){t=zc(t),E9.lastIndex=0;let o=E9.exec(t);for(;o&&o[1];)o=E9.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(rD(r(t.substr(0,o.index))," "),me("u",{"aria-hidden":"true"},o[3]),Ege(r(t.substr(o.index+o[0].length))," ")):this.label.textContent=r(t).trim(),(e=this.item)==null||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.textContent=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class qoe extends ave{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new ne),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:{horizontal:SP.Right,vertical:Fz.Below},this.showScheduler=new ai(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new ai(()=>{this.element&&!ys(as(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=he(this.item,me("span.submenu-indicator"+$e.asCSSSelector(de.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(J(this.element,_e.KEY_UP,t=>{const i=new ui(t);(i.equals(17)||i.equals(3))&&(Ht.stop(t,!0),this.createSubmenu(!0))})),this._register(J(this.element,_e.KEY_DOWN,t=>{const i=new ui(t);as()===this.item&&(i.equals(17)||i.equals(3))&&Ht.stop(t,!0)})),this._register(J(this.element,_e.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(J(this.element,_e.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(J(this.element,_e.FOCUS_OUT,t=>{this.element&&!ys(as(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Ht.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=p0(e.width,t.width,{position:s.horizontal===SP.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new ui(d).equals(15)&&(Ht.stop(d,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(J(this.submenuContainer,_e.KEY_DOWN,d=>{new ui(d).equals(15)&&Ht.stop(d,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)==null||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Koe extends xS{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function DKe(n){const e=Oz,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function Goe(n){const e=Sge()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function TKe(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${Zoe(de.menuSelection)} -${Zoe(de.menuSubmenu)} +${Goe(de.menuSelection)} +${Goe(de.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -1104,105 +1099,105 @@ ${Zoe(de.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class AKe{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=os();let i;const s=hn(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:o=>{var d;this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(me(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=J(this.block,_e.MOUSE_DOWN,h=>h.stopPropagation()));const a=new ne,l=e.actionRunner||a.add(new iw);l.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new vy(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},LKe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=Oe(o);return a.add(J(c,_e.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(J(c,_e.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new ao(c,h);let f=u.target;if(!u.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),Hc(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(os()===this.lastContainer||Cs(os(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!fl(e.error)&&this.notificationService.error(e.error)}}var PKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},SC=function(n,e){return function(t,i){e(t,i,n)}};let Wz=class extends G{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new AKe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new q),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new q),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Hz.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),jf.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Wz=PKe([SC(0,Ro),SC(1,fn),SC(2,zg),SC(3,Ht),SC(4,uc),SC(5,Xe)],Wz);var Hz;(function(n){function e(i){return i&&i.menuId instanceof Te}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{let c=[];if(r){const d=s.getMenuActions(r,l??o,a);c=NKe(d)}return i.getActions?Xn.join(i.getActions(),c):c}}}n.transform=t})(Hz||(Hz={}));var xP;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(xP||(xP={}));var PZ=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},LP=function(n,e){return function(t,i){e(t,i,n)}};let Vz=class{constructor(e){this._commandService=e}async open(e,t){if(!O5(e,Ge.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=He.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=lz(decodeURIComponent(e.query))}catch{try{i=lz(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Vz=PZ([LP(0,Ei)],Vz);let zz=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=He.parse(e));const{selection:i,uri:s}=MUe(e);return e=s,e.scheme===Ge.file&&(e=Y4e(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?xP.USER:xP.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};zz=PZ([LP(0,Ft)],zz);let jz=class{constructor(e,t){this._openers=new Uo,this._validators=new Uo,this._resolvers=new Uo,this._resolvedUriTargets=new kn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Uo,this._defaultExternalOpener={openExternal:async i=>(fH(i,Ge.http,Ge.https)?cpe(i):ri.location.href=i,!0)},this._openers.push({open:async(i,s)=>s!=null&&s.openExternal||fH(i,Ge.mailto,Ge.http,Ge.https,Ge.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new Vz(t)),this._openers.push(new zz(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!(t!=null&&t.skipValidation)){const i=typeof e=="string"?He.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(s,t))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?He.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},vt.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},vt.None)}dispose(){this._validators.clear()}};jz=PZ([LP(0,Ft),LP(1,Ei)],jz);const Zr=mt("editorWorkerService");var Xi;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Xi||(Xi={}));(function(n){function e(l,c){return c-l}n.compare=e;const t=Object.create(null);t[n.Error]=_(1732,"Error"),t[n.Warning]=_(1733,"Warning"),t[n.Info]=_(1734,"Info");function i(l){return t[l]||""}n.toString=i;const s=Object.create(null);s[n.Error]=_(1735,"Errors"),s[n.Warning]=_(1736,"Warnings"),s[n.Info]=_(1737,"Infos");function o(l){return s[l]||""}n.toStringPlural=o;function r(l){switch(l){case Yi.Error:return n.Error;case Yi.Warning:return n.Warning;case Yi.Info:return n.Info;case Yi.Ignore:return n.Hint}}n.fromSeverity=r;function a(l){switch(l){case n.Error:return Yi.Error;case n.Warning:return Yi.Warning;case n.Info:return Yi.Info;case n.Hint:return Yi.Ignore}}n.toSeverity=a})(Xi||(Xi={}));var kP;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Xi.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(kP||(kP={}));const Pu=mt("markerService");var OKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xoe=function(n,e){return function(t,i){e(t,i,n)}};let $z=class extends G{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new q),this._suppressedRanges=new kn,this._markerDecorations=new kn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new FKe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ge.inMemory||e.uri.scheme===Ge.internal||e.uri.scheme===Ge.vscode)&&((i=this._markerService)==null||i.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(s=>!Nt.some(i,o=>D.areIntersectingOrTouching(o,s)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};$z=OKe([Xoe(0,qi),Xoe(1,Pu)],$z);class FKe extends G{constructor(e){super(),this.model=e,this._map=new j4e,this._register(Re(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=CVe(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new D(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var BKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},C2=function(n,e){return function(t,i){e(t,i,n)}},FC;function X_(n){return n.toString()}class WKe{constructor(e,t,i){this.model=e,this._modelEventListeners=new ne,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const HKe=jr||wt?1:2;class VKe{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}var $v;let Uz=($v=class extends G{constructor(e,t,i,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=s,this._onModelAdded=this._register(new q),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new q),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new q),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(o=>this._updateModelOptions(o))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var u;let i=io.tabSize;e.editor&&typeof e.editor.tabSize<"u"&&(i=xf(e.editor.tabSize,io.tabSize,1,100));let s="tabSize";e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"&&(s=xf(e.editor.indentSize,"tabSize",1,100));let o=io.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=HKe;const a=e.eol;a===`\r + `)}return t}class RKe{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=as();let i;const s=hn(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,layer:e.layer,render:o=>{var d;this.lastContainer=o;const r=e.getMenuClassName?e.getMenuClassName():"";r&&(o.className+=" "+r),this.options.blockMouse&&(this.block=o.appendChild(me(".context-view-block")),this.block.style.position="fixed",this.block.style.cursor="initial",this.block.style.left="0",this.block.style.top="0",this.block.style.width="100%",this.block.style.height="100%",this.block.style.zIndex="-1",(d=this.blockDisposable)==null||d.dispose(),this.blockDisposable=J(this.block,_e.MOUSE_DOWN,h=>h.stopPropagation()));const a=new ne,l=e.actionRunner||a.add(new J1);l.onWillRun(h=>this.onActionRun(h,!e.skipTelemetry),this,a),l.onDidRun(this.onDidActionRun,this,a),i=new _y(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:l,getKeyBinding:e.getKeyBinding?e.getKeyBinding:h=>this.keybindingService.lookupKeybinding(h.id)},SKe),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,a),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,a);const c=Pe(o);return a.add(J(c,_e.BLUR,()=>this.contextViewService.hideContextView(!0))),a.add(J(c,_e.MOUSE_DOWN,h=>{if(h.defaultPrevented)return;const u=new lo(c,h);let f=u.target;if(!u.rightButton){for(;f;){if(f===o)return;f=f.parentElement}this.contextViewService.hideContextView(!0)}})),Vc(a,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)==null||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)==null||a.dispose(),this.blockDisposable=null,this.lastContainer&&(as()===this.lastContainer||ys(as(),this.lastContainer))&&((l=this.focusToReturn)==null||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!fl(e.error)&&this.notificationService.error(e.error)}}var MKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bC=function(n,e){return function(t,i){e(t,i,n)}};let Bz=class extends G{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new RKe(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new q),this.onDidShowContextMenu=this._onDidShowContextMenu.event,this._onDidHideContextMenu=this._store.add(new q),this.onDidHideContextMenu=this._onDidHideContextMenu.event}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=Wz.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu({...e,onHide:t=>{var i;(i=e.onHide)==null||i.call(e,t),this._onDidHideContextMenu.fire()}}),jf.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};Bz=MKe([bC(0,To),bC(1,fn),bC(2,zg),bC(3,Vt),bC(4,lc),bC(5,Xe)],Bz);var Wz;(function(n){function e(i){return i&&i.menuId instanceof Te}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return{...i,getActions:()=>{let c=[];if(r){const d=s.getMenuActions(r,l??o,a);c=IKe(d)}return i.getActions?Zn.join(i.getActions(),c):c}}}n.transform=t})(Wz||(Wz={}));var xP;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(xP||(xP={}));var AZ=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},LP=function(n,e){return function(t,i){e(t,i,n)}};let Hz=class{constructor(e){this._commandService=e}async open(e,t){if(!O5(e,Ge.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=He.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=az(decodeURIComponent(e.query))}catch{try{i=az(e.query)}catch{}}return Array.isArray(i)||(i=[i]),await this._commandService.executeCommand(e.path,...i),!0}};Hz=AZ([LP(0,ki)],Hz);let Vz=class{constructor(e){this._editorService=e}async open(e,t){typeof e=="string"&&(e=He.parse(e));const{selection:i,uri:s}=TUe(e);return e=s,e.scheme===Ge.file&&(e=K4e(e)),await this._editorService.openCodeEditor({resource:e,options:{selection:i,source:t!=null&&t.fromUserGesture?xP.USER:xP.API,...t==null?void 0:t.editorOptions}},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0}};Vz=AZ([LP(0,Bt)],Vz);let zz=class{constructor(e,t){this._openers=new qo,this._validators=new qo,this._resolvers=new qo,this._resolvedUriTargets=new En(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new qo,this._defaultExternalOpener={openExternal:async i=>(uH(i,Ge.http,Ge.https)?ope(i):ri.location.href=i,!0)},this._openers.push({open:async(i,s)=>s!=null&&s.openExternal||uH(i,Ge.mailto,Ge.http,Ge.https,Ge.vsls)?(await this._doOpenExternal(i,s),!0):!1}),this._openers.push(new Hz(t)),this._openers.push(new Vz(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}async open(e,t){if(!(t!=null&&t.skipValidation)){const i=typeof e=="string"?He.parse(e):e,s=this._resolvedUriTargets.get(i)??e;for(const o of this._validators)if(!await o.shouldOpen(s,t))return!1}for(const i of this._openers)if(await i.open(e,t))return!0;return!1}async resolveExternalUri(e,t){for(const i of this._resolvers)try{const s=await i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())}async _doOpenExternal(e,t){const i=typeof e=="string"?He.parse(e):e;let s;try{s=(await this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(await a.openExternal(o,{sourceUri:i,preferredOpenerId:r},wt.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},wt.None)}dispose(){this._validators.clear()}};zz=AZ([LP(0,Bt),LP(1,ki)],zz);const Qr=mt("editorWorkerService");var Xi;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(Xi||(Xi={}));(function(n){function e(l,c){return c-l}n.compare=e;const t=Object.create(null);t[n.Error]=_(1732,"Error"),t[n.Warning]=_(1733,"Warning"),t[n.Info]=_(1734,"Info");function i(l){return t[l]||""}n.toString=i;const s=Object.create(null);s[n.Error]=_(1735,"Errors"),s[n.Warning]=_(1736,"Warnings"),s[n.Info]=_(1737,"Infos");function o(l){return s[l]||""}n.toStringPlural=o;function r(l){switch(l){case Yi.Error:return n.Error;case Yi.Warning:return n.Warning;case Yi.Info:return n.Info;case Yi.Ignore:return n.Hint}}n.fromSeverity=r;function a(l){switch(l){case n.Error:return Yi.Error;case n.Warning:return Yi.Warning;case n.Info:return Yi.Info;case n.Hint:return Yi.Ignore}}n.toSeverity=a})(Xi||(Xi={}));var kP;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(Xi.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(kP||(kP={}));const Ou=mt("markerService");var AKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yoe=function(n,e){return function(t,i){e(t,i,n)}};let jz=class extends G{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new q),this._suppressedRanges=new En,this._markerDecorations=new En,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new PKe(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var i;const t=this._markerDecorations.get(e.uri);t&&(t.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===Ge.inMemory||e.uri.scheme===Ge.internal||e.uri.scheme===Ge.vscode)&&((i=this._markerService)==null||i.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){let t=this._markerService.read({resource:e.model.uri,take:500});const i=this._suppressedRanges.get(e.model.uri);i&&(t=t.filter(s=>!Dt.some(i,o=>D.areIntersectingOrTouching(o,s)))),e.update(t)&&this._onDidChangeMarker.fire(e.model)}};jz=AKe([Yoe(0,Ui),Yoe(1,Ou)],jz);class PKe extends G{constructor(e){super(),this.model=e,this._map=new V4e,this._register(Re(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=vVe(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new D(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var OKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},y2=function(n,e){return function(t,i){e(t,i,n)}},RC;function Z_(n){return n.toString()}class FKe{constructor(e,t,i){this.model=e,this._modelEventListeners=new ne,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const BKe=Ur||yt?1:2;class WKe{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}var Vv;let $z=(Vv=class extends G{constructor(e,t,i,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._instantiationService=s,this._onModelAdded=this._register(new q),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new q),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new q),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(o=>this._updateModelOptions(o))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var u;let i=no.tabSize;e.editor&&typeof e.editor.tabSize<"u"&&(i=Lf(e.editor.tabSize,no.tabSize,1,100));let s="tabSize";e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"&&(s=Lf(e.editor.indentSize,"tabSize",1,100));let o=no.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(o=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let r=BKe;const a=e.eol;a===`\r `?r=2:a===` -`&&(r=1);let l=io.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=io.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=io.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=io.bracketPairColorizationOptions;if((u=e.editor)!=null&&u.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"){const f=e.editor.bracketPairColorization;h={enabled:!!f.enabled,independentColorPoolPerBracketType:!!f.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:o,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:ha===3||ha===2?` +`&&(r=1);let l=no.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(l=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let c=no.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(c=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let d=no.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(d=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=no.bracketPairColorizationOptions;if((u=e.editor)!=null&&u.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"){const f=e.editor.bracketPairColorization;h={enabled:!!f.enabled,independentColorPoolPerBracketType:!!f.independentColorPoolPerBracketType}}return{isForSimpleWidget:t,tabSize:i,indentSize:s,insertSpaces:o,detectIndentation:c,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:ua===3||ua===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=FC._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=this._instantiationService.createInstance(aw,e,t,o,i);if(i&&this._disposedModels.has(X_(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const f of d.past)Ef(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Ef(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Ef(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=X_(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new WKe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,al,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)Ef(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Ef(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=FC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Ef(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new VKe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);FC._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new qz}},FC=$v,$v.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,$v);Uz=FC=BKe([C2(0,lt),C2(1,Ype),C2(2,oZ),C2(3,Ae)],Uz);const K4=class K4{canComputeSHA1(e){return e.getValueLength()<=K4.MAX_MODEL_SIZE}computeSHA1(e){const t=new mH,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};K4.MAX_MODEL_SIZE=10*1024*1024;let qz=K4;var Kz;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(Kz||(Kz={}));const jw={Quickaccess:"workbench.contributions.quickaccess"};class zKe{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Re(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return rh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Ji.add(jw.Quickaccess,new zKe);var jKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qoe=function(n,e){return function(t,i){e(t,i,n)}};let Gz=class extends G{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ji.as(jw.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(Re(()=>{var i;for(const s of this.mapProviderToDescriptor.values())Rw(s)&&s.dispose();(i=this.visibleQuickAccess)==null||i.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var g,p;const[s,o]=this.getOrInstantiateProvider(e,i==null?void 0:i.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r==null?void 0:r.descriptor;if(r&&o&&a===o){e!==o.prefix&&!(i!=null&&i.preserveValue)&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!(i!=null&&i.preserveValue)){let m;if(r&&a&&a!==o){const b=r.value.substr(a.prefix.length);b&&(m=`${o.prefix}${b}`)}if(!m){const b=s==null?void 0:s.defaultFilterValue;b===Kz.LAST?m=this.lastAcceptedPickerValues.get(o):typeof b=="string"&&(m=`${o.prefix}${b}`)}typeof m=="string"&&(e=m)}const l=(g=r==null?void 0:r.picker)==null?void 0:g.valueSelection,c=(p=r==null?void 0:r.picker)==null?void 0:p.value,d=new ne,h=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=(i==null?void 0:i.placeholder)??(o==null?void 0:o.placeholder),h.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(h.itemActivation=(i==null?void 0:i.itemActivation)??Sd.SECOND),h.contextKey=o==null?void 0:o.contextKey,h.filterValue=m=>m.substring(o?o.prefix.length:0);let u;t&&(u=new Mw,d.add(ve.once(h.onWillAccept)(m=>{m.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,s,o,e,i));const f=d.add(new Wi);if(s&&d.add(s.provide(h,f.token,i==null?void 0:i.providerOptions)),ve.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u==null||u.complete(h.selectedItems.slice(0))}),h.show(),l&&c===e&&(h.valueSelection=l),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){let s;i!=null&&i.preserveValue?s=[e.value.length,e.value.length]:s=[(t==null?void 0:t.prefix.length)??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,o){const r=new ne,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Re(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,o==null?void 0:o.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:o==null?void 0:o.enabledProviderPrefixes,preserveValue:!0,providerOptions:o==null?void 0:o.providerOptions}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!(t!=null&&t.includes(i.prefix)))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};Gz=jKe([Qoe(0,Do),Qoe(1,Ae)],Gz);const uve={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class Ug extends Na{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new q),this._onKeyDown=this._register(new q),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Ue.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(ed().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(this.enabled){if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)}})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...Ue.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...Ue.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const yQ=class yQ extends Na{constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new q),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}};yQ.CLASS_NAME="monaco-checkbox";let QI=yQ;class fve extends QI{constructor(e,t,i){const s=new Ug({title:e,isChecked:t,icon:de.check,actionClassName:QI.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...uve});super(s,s.domNode,i),this._register(s),this._register(this.checkbox.onChange(o=>{this.applyStyles(),this._onChange.fire(o)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(de.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class gve extends QI{constructor(e,t,i){let s;switch(t){case!0:s=de.check;break;case"mixed":s=de.dash;break;case!1:s=void 0;break}const o=new Ug({title:e,isChecked:t===!0,icon:s,actionClassName:fve.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...uve});super(o,o.domNode,i),this._state=t,this._register(o),this._register(this.checkbox.onChange(r=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(r)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=e===!0,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(de.check);break;case"mixed":this.checkbox.setIcon(de.dash);break;case!1:this.checkbox.setIcon(void 0);break}super.applyStyles(e)}}var $Ke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class pve{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}$Ke([wn],pve.prototype,"toString",null);const UKe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function qKe(n){const e=[];let t=0,i;for(;i=UKe.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{e4e(f)&&Wt.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new ti(a,_e.CLICK)).event,d=t.disposables.add(new ti(a,_e.KEY_DOWN)).event,h=ve.chain(d,f=>f.filter(g=>{const p=new ui(g);return p.equals(10)||p.equals(3)}));t.disposables.add(No.addTarget(a));const u=t.disposables.add(new ti(a,Li.Tap)).event;ve.any(c,u,h)(l,null,t.disposables),e.appendChild(a)}}var ZKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Joe=function(n,e){return function(t,i){e(t,i,n)}};const mve="inQuickInput",XKe=new Se(mve,!1,_(1748,"Whether keyboard focus is inside the quick input control")),A3=le.has(mve),QKe="quickInputAlignment",JKe=new Se(QKe,"top",_(1749,"The alignment of the quick input")),JI="quickInputType",eGe=new Se(JI,void 0,_(1750,"The type of the currently visible quick input")),_ve="cursorAtEndOfQuickInputBox",tGe=new Se(_ve,!1,_(1751,"Whether the cursor in the quick input is at the end of the input box")),iGe=le.has(_ve),Yz={iconClass:Ue.asClassName(de.quickInputBack),tooltip:_(1752,"Back")},G4=class G4 extends G{constructor(e){super(),this.ui=e,this._visible=Ze("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=G4.noPromptMessage,this._severity=Yi.Ignore,this.onDidTriggerButtonEmitter=this._register(new q),this.onDidHideEmitter=this._register(new q),this.onWillHideEmitter=this._register(new q),this.onDisposeEmitter=this._register(new q),this.visibleDisposables=this._register(new ne),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!nc;this._ignoreFocusOut=e&&!nc,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===Yz),this._rightButtons=e.filter(t=>t!==Yz&&t.location!==gP.Inline),this._inlineButtons=e.filter(t=>t.location===gP.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=GI.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=GI.Other){this.onWillHideEmitter.fire({reason:e})}update(){var s;if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ys(this.ui.widget,this._widget):ys(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Ca,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const o=this._leftButtons.map((l,c)=>wy(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(o,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const r=this._rightButtons.map((l,c)=>wy(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(r,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const a=this._inlineButtons.map((l,c)=>wy(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.inlineActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const o=((s=this.toggles)==null?void 0:s.filter(a=>a instanceof Ug))??[];this.ui.inputBox.toggles=o;const r=o.length*22;this.ui.countContainer.style.right=r>0?`${4+r}px`:"4px",this.ui.visibleCountContainer.style.right=r>0?`${4+r}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,ys(this.ui.message),i&&YKe(i,this.ui.message,{callback:o=>{this.ui.linkOpenerDelegate(o)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?_(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Yi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};G4.noPromptMessage=_(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel");let eN=G4;const Y4=class Y4 extends eN{constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new q),this.onWillAcceptEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Sd.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new q),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new q),this.onDidTriggerItemButtonEmitter=this._register(new q),this.onDidTriggerSeparatorButtonEmitter=this._register(new q),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new oD,this.type="quickPick",this.filterValue=t=>t,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?YUe:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??_(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Ni.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Bi(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany&&!e.some(i=>i.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Bi(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(eY(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&Bi(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return J(this.ui.container,_e.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new ui(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder,this.title&&(s=s?`${s} - ${this.title}`:this.title),s||(s=Y4.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.inputBox.ariaLabel!==s&&(this.ui.inputBox.ariaLabel=s??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case Sd.NONE:this._itemActivation=Sd.FIRST;break;case Sd.SECOND:this.ui.list.focus(Ni.Second),this._itemActivation=Sd.FIRST;break;case Sd.LAST:this.ui.list.focus(Ni.Last),this._itemActivation=Sd.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ni.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}};Y4.DEFAULT_ARIA_LABEL=_(1755,"Type to narrow down results.");let Fk=Y4,nGe=class extends eN{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?_(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):eN.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}},Zz=class extends SS{constructor(e,t){super("mouse",void 0,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(hn(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` -`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};Zz=ZKe([Joe(0,lt),Joe(1,Cr)],Zz);se.white.toString(),se.white.toString();const sGe=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class EP extends G{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new q),this._onDidEscape=this._register(new q),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(No.addTarget(this._element)),[_e.CLICK,Li.Tap].forEach(o=>{this._register(J(this._element,o,r=>{if(!this.enabled){Wt.stop(r);return}this._onDidClick.fire(r)}))}),this._register(J(this._element,_e.KEY_DOWN,o=>{const r=new ui(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&Wt.stop(r,!0)})),this._register(J(this._element,_e.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(J(this._element,_e.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(oc(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of Lm(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var s;if(this._label===e||cg(this._label)&&cg(e)&&Kje(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(cg(e)){const o=ED(e,void 0,document.createElement("span"));o.dispose();const r=(s=o.element.querySelector("p"))==null?void 0:s.innerHTML;r?Wbe(t,r,sGe):ys(t)}else this.options.supportIcons?ys(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=fUe(e)),this.setTitle(i),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):typeof this.options.title=="string"&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter(i=>i.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...Ue.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(ed().setupManagedHover(this.options.hoverDelegate??Au("element"),this._element,e)):this._hover&&this._hover.update(e)}}class Xz extends G{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new Kt),this.element=ue(e,me(".monaco-count-badge")),this._register(Re(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){this.titleFormat!==""&&!this.hover.value?this.hover.value=ed().setupDelayedHoverAtMouse(this.element,()=>({content:J1(this.titleFormat,this.count),appearance:{compact:!0}})):this.titleFormat===""&&this.hover.value&&(this.hover.value=void 0)}render(){this.element.textContent=J1(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const ere="done",tre="active",D9="infinite",T9="infinite-long-running",ire="discrete",Z4=class Z4 extends G{constructor(e,t){super(),this.progressSignal=this._register(new Kt),this.workedVal=0,this.showDelayedScheduler=this._register(new ai(()=>la(this.element),0)),this.longRunningScheduler=this._register(new ai(()=>this.infiniteLongRunning(),Z4.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(tre,D9,T9,ire),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(ere),this.element.classList.contains(D9)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(ire,ere,T9),this.element.classList.add(tre,D9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(T9)}getContainer(){return this.element}};Z4.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let Qz=Z4;const oGe=_(2,"Match Case"),rGe=_(3,"Match Whole Word"),aGe=_(4,"Use Regular Expression");class bve extends Ug{constructor(e){super({icon:de.caseSensitive,title:oGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class vve extends Ug{constructor(e){super({icon:de.wholeWord,title:rGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class wve extends Ug{constructor(e){super({icon:de.regex,title:aGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}function lGe(n,e,t){const i=t??document.createElement("div");return i.textContent=n,i}function cGe(n,e,t){const i=t??document.createElement("div");return i.textContent="",Cve(i,hGe(n),e==null?void 0:e.actionHandler,e==null?void 0:e.renderCodeSegments),i}class dGe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function Cve(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(xn(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{Cve(s,o,t,i)})}function hGe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new dGe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&Jz(r.peek())!==0;if(l&&(a=r.next()),!l&&uGe(a)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=Jz(a);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` -`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function uGe(n,e){return Jz(n)!==0}function Jz(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class fGe{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class gGe{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new fGe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const xC=me;class pGe extends Na{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new Kt),this._onDidChange=this._register(new q),this._onDidHeightChange=this._register(new q),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ue(e,xC(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=ue(this.element,xC(".ibwrapper"));if(this.input=ue(o,xC(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ue(o,xC("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Nme(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ue(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const r=this._register(new ti(e.ownerDocument,"selectionchange")),a=ve.filter(r.event,()=>{const l=e.ownerDocument.getSelection();return(l==null?void 0:l.anchorNode)===o});this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new Vr(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(ed().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:zf(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return H5(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&ma(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${dg(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ra(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{if(!this.message)return null;e=ue(s,xC(".monaco-inputbox-container")),t();const o=xC("span.monaco-inputbox-message");this.message.formatContent?cGe(this.message.content,void 0,o):lGe(this.message.content,void 0,o),o.classList.add(this.classForType(this.message.type));const r=this.stylesForType(this.message.type);return o.style.backgroundColor=r.background??"",o.style.color=r.foreground??"",o.style.border=r.border?`1px solid ${r.border}`:"",ue(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=_(9,"Error: {0}",this.message.content):this.message.type===2?i=_(10,"Warning: {0}",this.message.content):i=_(11,"Info: {0}",this.message.content),_r(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${dg(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=zf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)==null||e.dispose(),super.dispose()}}class yve extends pGe{constructor(e,t,i){const s=_(12," or {0} for history","⇅"),o=_(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new q),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new q),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new gGe(i.history,100));const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:o,l=this.placeholder+a;i.showPlaceholderOnFocus&&!H5(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Xd(this.value?this.value:_(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Xd(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const mGe=_(1,"input");class Sve extends Na{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Kt),this.additionalToggles=[],this._onDidOptionChange=this._register(new q),this._onKeyDown=this._register(new q),this._onMouseDown=this._register(new q),this._onInput=this._register(new q),this._onKeyUp=this._register(new q),this._onCaseSensitiveKeyDown=this._register(new q),this._onRegexKeyDown=this._register(new q),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||mGe,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=!!i.flexibleHeight,l=!!i.flexibleWidth,c=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new yve(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){const d=(i==null?void 0:i.hoverLifecycleOptions)||{groupId:"find-input"};this.regex=this._register(new wve({appendTitle:r,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.regex.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(u=>{this._onRegexKeyDown.fire(u)})),this.wholeWords=this._register(new vve({appendTitle:o,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.wholeWords.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new bve({appendTitle:s,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(u=>{this._onCaseSensitiveKeyDown.fire(u)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const f=h.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%h.length:u.equals(15)&&(f===0?g=h.length-1:g=f-1),u.equals(9)?(h[f].blur(),this.inputBox.focus()):g>=0&&h[g].focus(),Wt.stop(u,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(J(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(J(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)==null||e.enable(),(t=this.wholeWords)==null||t.enable(),(i=this.caseSensitive)==null||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)==null||e.disable(),(t=this.wholeWords)==null||t.disable(),(i=this.caseSensitive)==null||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new ne;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(((t=this.caseSensitive)==null?void 0:t.width())??0)+(((i=this.wholeWords)==null?void 0:i.width())??0)+(((s=this.regex)==null?void 0:s.width())??0)+this.additionalToggles.reduce((o,r)=>o+r.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e;return((e=this.caseSensitive)==null?void 0:e.checked)??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e;return((e=this.wholeWords)==null?void 0:e.checked)??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e;return((e=this.regex)==null?void 0:e.checked)??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)==null||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const _Ge=me;class bGe extends G{constructor(e,t,i){super(),this.parent=e,this.onDidChange=o=>this.findInput.onDidChange(o),this.container=ue(this.parent,_Ge(".quick-input-box")),this.findInput=this._register(new Sve(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="textbox",s.ariaHasPopup="menu",s.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Yi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Yi.Info?1:e===Yi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Yi.Info?1:e===Yi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Im extends G{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=ue(e,me("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s,o){e||(e=""),s&&(e=Im.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&ma(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render(o))}render(e){var s;const t=[];let i=0;for(const o of this.highlights){if(o.end===o.start)continue;if(i{s=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class oL{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||ma(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class tN extends G{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new oL(ue(e,me(".monaco-icon-label")))),this.labelContainer=ue(this.domNode.element,me(".monaco-icon-label-container")),this.nameContainer=ue(this.labelContainer,me("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new CGe(this.nameContainer,!!t.supportIcons)):this.nameNode=new vGe(this.nameContainer),this.hoverDelegate=(t==null?void 0:t.hoverDelegate)??Au("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var l;const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.bold&&s.push("bold"),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let c;if(!a||!hn(a)?(c=me(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,Ue.isThemeIcon(i.iconPath)){const d=Ue.asClassName(i.iconPath);c.className=`monaco-icon-label-iconpath ${d}`,c.style.backgroundImage=""}else c.style.backgroundImage=Su(i==null?void 0:i.iconPath);c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.backgroundSize="contain"}else a&&a.remove();if(this.domNode.classNames=s,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...o),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();if(c instanceof Im){const d=(i==null?void 0:i.supportIcons)??((l=this.creationOptions)==null?void 0:l.supportIcons);c.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines,d),this.setupHover(c.element,i==null?void 0:i.descriptionTitle)}else c.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Im.escapeNewLines(t,[]):t||"",this.setupHover(c.element,(i==null?void 0:i.descriptionTitle)||""),c.empty=!t}if(i!=null&&i.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=(i==null?void 0:i.suffix)??""}}setupHover(e,t){var r;const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let s=e;if((r=this.creationOptions)!=null&&r.hoverTargetOverride){if(!Cs(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");s=this.creationOptions.hoverTargetOverride}const o=ed().setupManagedHover(this.hoverDelegate,s,t);o&&this.customHovers.set(e,o)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new oL(s4e(this.nameContainer,me("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new oL(ue(e.element,me("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new oL(ue(this.labelContainer,me("span.monaco-icon-description-container"))));(e=this.creationOptions)!=null&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new Im(ue(t.element,me("span.label-description")))):this.descriptionNode=this._register(new oL(ue(t.element,me("span.label-description"))))}return this.descriptionNode}}class vGe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&ma(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=ue(this.container,me("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>_o.intersect(o,a)).filter(a=>!_o.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class CGe extends G{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&ma(this.options,t))return;this.label=e,this.options=t;const i=(t==null?void 0:t.supportIcons)??this.supportIcons;if(typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new Im(ue(this.container,me("a.label-name",{id:t==null?void 0:t.domId}))))),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const s=(t==null?void 0:t.separator)||"/",o=wGe(e,s,t==null?void 0:t.matches);for(let r=0;r"u"?!1:i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=typeof i.autoExpandSingleChildren>"u"?!1:i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Nt.empty(),s={}){if(e.length===0)throw new Ya(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=Nt.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,o);const l=[...s],c=t[t.length-1],d=new Zh({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(p=>e.getId(p.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const h=t.slice(0,-1),u=(p,m,b)=>{if(r>0)for(let v=0;vb.originalStart-m.originalStart))u(f,g,f-(p.originalStart+p.originalLength)),f=p.originalStart,g=p.modifiedStart-c,this.spliceSimple([...h,f],p.originalLength,Nt.slice(l,g,g+p.modifiedLength),o);u(f,g,f)}spliceSimple(e,t,i=Nt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=Nt.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,h,s)),f=e[e.length-1];let g=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of v)S.visible&&w++;if(w!==0)for(let S=f+p.length;S0&&o){const S=L=>{o(L),L.children.forEach(S)};v.forEach(S)}if(c&&d){const S=v.reduce((L,x)=>L+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this._onDidSpliceRenderedNodes.fire({start:l,deleteCount:S,elements:h})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:v});let C=a;for(;C;){if(C.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Ya(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!R9(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:l,elements:a.slice(1)}),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(R9(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!R9(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||Nt.empty(),d=s&&l!==0&&!a.collapsed;let h=0,u=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=l===2?h>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):TD(i)?(e.filterData=i.data,fw(i.visibility)):(e.filterData=void 0,fw(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Ya(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Ya(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Ya(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function M9(n){return n instanceof ND?new xGe(n):n}class LGe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=G.None,this.disposables=new ne}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,M9(e),t)}onDragOver(e,t,i,s,o,r=!0){const a=this.dnd.onDragOver(M9(e),t&&t.element,i,s,o),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=kg(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[i]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),m=f.getNode(p),b=p&&f.getListIndex(p);return this.onDragOver(e,m,b,s,o,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),h=c.getListIndex(d),u=c.getListRenderCount(d);return{...a,feedback:or(h,h+u)}}drop(e,t,i,s,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(M9(e),t&&t.element,i,s,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function kGe(n,e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(i.element)}},dnd:t.dnd&&e.add(new LGe(n,t.dnd)),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(i){return t.multipleSelectionController.isSelectionSingleChangeEvent({...i,element:i.element})},isSelectionRangeChangeEvent(i){return t.multipleSelectionController.isSelectionRangeChangeEvent({...i,element:i.element})}},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(i){const s=n(),o=s.getNodeLocation(i),r=s.getParentNodeLocation(o);return s.getNode(r).visibleChildrenCount},getPosInSet(i){return i.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?i=>t.accessibilityProvider.isChecked(i.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?i=>t.accessibilityProvider.getRole(i.element):()=>"treeitem",getAriaLabel(i){return t.accessibilityProvider.getAriaLabel(i.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?i=>t.accessibilityProvider.getAriaLevel(i.element):i=>i.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(i=>t.accessibilityProvider.getActiveDescendantId(i.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(i){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i.element)}}}}class FZ{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)==null||s.call(i,e.element,t)}}var gw;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(gw||(gw={}));class EGe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new ne,this.onDidChange=ve.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const V0=class V0{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.model=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=V0.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=G.None,this.disposables=new ne,this.templateId=e.templateId,this.updateOptions(r),ve.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)==null||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=rr(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)s.indentSize=V0.DefaultIndent+(i.depth-1)*this.indent,this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==gw.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new ne;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ue(e,me(".monaco-tl-row")),i=ue(t,me(".monaco-tl-indent")),s=ue(t,me(".monaco-tl-twistie")),o=ue(t,me(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:G.None,indentSize:0,templateData:r}}renderElement(e,t,i,s){i.indentSize=V0.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...s,indent:i.indentSize})}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)==null||r.call(o,e,t,i.templateData,{...s,indent:i.indentSize}),typeof(s==null?void 0:s.height)=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=`${t.indentSize+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Ue.asClassNameArray(de.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...Ue.asClassNameArray(de.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(js(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new ne;for(;;){const s=this.model.getNodeLocation(e),o=this.model.getParentNodeLocation(s);if(!o)break;const r=this.model.getNode(o),a=me(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(Re(()=>this.renderedIndentGuides.delete(r,a))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach(i=>{const s=this.model.getNodeLocation(i);try{const o=this.model.getParentNodeLocation(s);i.collapsible&&i.children.length>0&&!i.collapsed?t.add(i):o&&t.add(this.model.getNode(o))}catch{}}),this.activeIndentNodes.forEach(i=>{t.has(i)||this.renderedIndentGuides.forEach(i,s=>s.classList.remove("active"))}),t.forEach(i=>{this.activeIndentNodes.has(i)||this.renderedIndentGuides.forEach(i,s=>s.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Jt(this.disposables)}};V0.DefaultIndent=8;let ej=V0;function IGe(n,e){const t=e.toLowerCase().indexOf(n);let i;if(t>-1){i=[Number.MAX_SAFE_INTEGER,0];for(let s=n.length;s>0;s--)i.push(t+s-1)}return i}class xve{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=Pd.Fuzzy,this._findMode=Za.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new ne}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:TD(r)?i=fw(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:jc.Default,visibility:i};const s=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:jc.Default,visibility:i};let l;if(this._findMatchType===Pd.Contiguous?l=IGe(this._lowercasePattern,a.toLowerCase()):l=cw(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this._findMode===Za.Filter?typeof this._defaultFindVisibility=="number"?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:jc.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Jt(this.disposables)}}class NGe{constructor(e){this.stateMap=new Map(e.map(t=>[t.id,{...t}]))}get(e){const t=this.stateMap.get(e);if(t===void 0)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(i===void 0)throw new Error(`No state found for toggle id ${e}`);return i.isChecked===t?!1:(i.isChecked=t,!0)}}var Za;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Za||(Za={}));var Pd;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Pd||(Pd={}));var xp;(function(n){n.Mode="mode",n.MatchType="matchType"})(xp||(xp={}));class DGe{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){var t;this._placeholder=e,(t=this.widget)==null||t.setPlaceHolder(e)}constructor(e,t,i,s={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=s,this._pattern="",this._onDidChangePattern=new q,this._onDidChangeOpenState=new q,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new ne,this.disposables=new ne,this.toggles=new NGe(s.toggles??[]),this._placeholder=s.placeholder??_(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){var i;this.toggles.set(e,t),(i=this.widget)==null||i.setToggleState(e,t)}renderMessage(e,t){var i,s,o;e?this.tree.options.showNotFoundMessage??!0?(i=this.widget)==null||i.showMessage({type:2,content:t??_(21,"No results found.")}):(s=this.widget)==null||s.showMessage({type:2}):(o=this.widget)==null||o.clearMessage()}alertResults(e){_r(e?_(23,"{0} results",e):_(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}let Lve=class extends DGe{get mode(){return this.toggles.get(xp.Mode)?Za.Filter:Za.Highlight}set mode(e){if(e===this.mode)return;const t=e===Za.Filter;this.updateToggleState(xp.Mode,t),this.placeholder=t?_(24,"Type to filter"):_(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(xp.MatchType)?Pd.Fuzzy:Pd.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(xp.MatchType,e===Pd.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s={}){const o=s.defaultFindMode??Za.Highlight,r=s.defaultFindMatchType??Pd.Fuzzy,a=[{id:xp.Mode,icon:de.listFilter,title:_(26,"Filter"),isChecked:o===Za.Filter},{id:xp.MatchType,icon:de.searchFuzzy,title:_(27,"Fuzzy Match"),isChecked:r===Pd.Fuzzy}];t.findMatchType=r,t.findMode=o,super(e,t,i,{...s,toggles:a}),this.filter=t,this._onDidChangeMode=new q,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new q,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(this.pattern.length!==0&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!jc.isDefault(e.filterData)}render(){const t=this.filter.matchCount===0&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(t),this.pattern.length&&this.alertResults(this.filter.matchCount)}};function TGe(n,e){return n.position===e.position&&kve(n,e)}function kve(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class RGe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Bi(this.stickyNodes,e.stickyNodes,TGe)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Bi(this.stickyNodes,e.stickyNodes,kve)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class MGe{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let nre=class extends G{constructor(e,t,i,s,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new MGe,this.paddingTop=r.paddingTop??0,this._widget=this._register(new AGe(i.getScrollableElement(),i,e,s,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(l=>{const c=this._widget.state;if(!c)return;if(l.deleteCount>0&&c.stickyNodes.some(u=>!this.model.has(this.model.getNodeLocation(u.node)))){this.update();return}c.stickyNodes.some(u=>{const f=this.model.getListIndex(this.model.getNodeLocation(u.node));return f>=l.start&&f=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,o=this.getNextStickyNode(i,void 0,s);for(;o&&(t.push(o),s+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,s);const r=this.constrainStickyNodes(t);return r.length?new RGe(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),o=t;return this.view.scrollTop===s-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:s,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const o=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),o=i+s-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let o=0;o0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${s.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const s=e.stickyNodes[i],{element:o,disposable:r}=this.createElement(s,i,e.count);t[i]=o,this._rootDomNode.appendChild(o),this._previousStateDisposables.add(r)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const s=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${s}`),o.setAttribute("data-parity",s%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(s));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(u=>u.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(o);l.renderElement(c,e.startIndex,d,{height:e.height});const h=Re(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,{height:e.height}),l.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return G.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:Ci(o),a=qe(c=>{const d=c.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class PGe extends G{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new q,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new q,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(J(this.container,"focus",()=>this.onFocus())),this._register(J(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!XI(t)&&!Ok(t)){this.focusedLast()&&this.view.domFocus();return}if(!Lf(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)==null?void 0:l.element)});if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!XI(t)&&!Ok(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=rr(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=s?s.position+s.height+i.height:i.height;this.view.scrollTop=o-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function S2(n){let e=pv.Unknown;return y7(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=pv.Twistie:y7(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=pv.Element:y7(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=pv.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function OGe(n){const e=XI(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function qR(n,e){e(n),n.children.forEach(t=>qR(t,e))}class A9{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new q,this.onDidChange=this._onDidChange.event}set(e,t){const i=t;!(i!=null&&i.__forceEvent)&&Bi(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>qR(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>qR(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>qR(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const h=o.get(c);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class FGe extends nve{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Jbe(e.browserEvent.target)||$d(e.browserEvent.target)||PL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=Ok(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||s)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Qqe(e.browserEvent.target)||Jqe(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),o=this.list.getElementTop(s),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!XI(t)&&!Ok(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!XI(t)&&!Ok(t)){super.onContextMenu(e);return}}}class BGe extends pl{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new FGe(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(bg([...super.getFocus(),...s])),o.length>0&&super.setSelection(bg([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class Eve{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ve.filter(ve.map(this.view.onMouseDblClick,S2),e=>e.target!==pv.Filter)}get onMouseOver(){return ve.map(this.view.onMouseOver,S2)}get onMouseOut(){return ve.map(this.view.onMouseOut,S2)}get onContextMenu(){var e;return ve.any(ve.filter(ve.map(this.view.onContextMenu,OGe),t=>!t.isStickyScroll),((e=this.stickyScrollController)==null?void 0:e.onContextMenu)??ve.None)}get onPointer(){return ve.map(this.view.onPointer,S2)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ve.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){this._user=e,this._options=o,this.eventBufferer=new oD,this.onDidChangeFindOpenState=ve.None,this.onDidChangeStickyScrollFocused=ve.None,this.disposables=new ne,this.onDidSwapModel=this.disposables.add(new q),this.onDidChangeModelRelay=this.disposables.add(new Bx),this.onDidSpliceModelRelay=this.disposables.add(new Bx),this.onDidChangeCollapseStateRelay=this.disposables.add(new Bx),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new Bx),this.onDidChangeActiveNodesRelay=this.disposables.add(new Bx),this._onWillRefilter=new q,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new q,this.modelDisposables=new ne,o.keyboardNavigationLabelProvider&&(o.findWidgetEnabled??!0)&&(this.findFilter=new xve(o.keyboardNavigationLabelProvider,o.filter,o.defaultFindVisibility),o={...o,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,o),this.treeDelegate=new FZ(i);const r=this.disposables.add(new EGe(this.onDidChangeActiveNodesRelay.event)),a=new ppe;this.renderers=s.map(l=>new ej(l,this.model,this.onDidChangeCollapseStateRelay.event,r,a,o));for(const l of this.renderers)this.disposables.add(l);if(this.focus=new A9(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new A9(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new A9(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new BGe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...kGe(()=>this.model,this.disposables,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),o.keyboardSupport!==!1){const l=ve.chain(this.view.onKeyDown,c=>c.filter(d=>!$d(d.target)).map(d=>new ui(d)));ve.chain(l,c=>c.filter(d=>d.keyCode===15))(this.onLeftArrow,this,this.disposables),ve.chain(l,c=>c.filter(d=>d.keyCode===17))(this.onRightArrow,this,this.disposables),ve.chain(l,c=>c.filter(d=>d.keyCode===10))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const l={styles:o.findWidgetStyles,defaultFindMode:o.defaultFindMode,defaultFindMatchType:o.defaultFindMatchType,showNotFoundMessage:o.showNotFoundMessage};this.findController=this.disposables.add(new Lve(this,this.findFilter,o.contextViewProvider,l)),this.focusNavigationFilter=c=>this.findController.shouldAllowFocus(c),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=ve.None,this.onDidChangeFindMatchType=ve.None;o.enableStickyScroll&&(this.stickyScrollController=new nre(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=lc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===gw.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)==null||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===gw.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new nre(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=ve.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)==null||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;(e=this.stickyScrollController)!=null&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=dg(e.listFocusAndSelectionOutline,dg(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)})}focusNext(e=1,t=!1,i,s=Lf(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}focusPrevious(e=1,t=!1,i,s=Lf(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,s)}focusNextPage(e,t=Lf(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=Lf(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i;return((i=this.stickyScrollController)==null?void 0:i.height)??0})}focusLast(e,t=Lf(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=Lf(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const s=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,s)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:o,deleteCount:r,elements:a})=>this.view.splice(o,r,a)));const t=ve.forEach(e.onDidSpliceModel,o=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(o),this.selection.onDidModelSplice(o)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new q),s=this.modelDisposables.add(new sc(0));this.modelDisposables.add(ve.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{s.trigger(()=>{const o=new Set;for(const r of this.focus.getNodes())o.add(r);for(const r of this.selection.getNodes())o.add(r);i.fire([...o.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=ve.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){var e;Jt(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}const sre=new oo(()=>{const n=Fw.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});new oo(()=>({collator:Fw.Collator(void 0,{numeric:!0}).value}));new oo(()=>({collator:Fw.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function WGe(n,e,t=!1){const i=n||"",s=e||"",o=sre.value.collator.compare(i,s);return sre.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}class zGe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:G.None}}renderElement(e,t,i,s){var l;if((l=i.disposable)==null||l.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new Wi,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class jGe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function $Ge(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new jGe(n,e.accessibilityProvider)}}class UGe{constructor(e,t,i,s,o={}){this.modelDisposables=new ne;const r=()=>this.model,a=s.map(l=>new zGe(l,r));this.list=new pl(e,t,i,a,$Ge(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ve.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return ve.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return ve.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,or(e.length)),this.modelDisposables.add(e.onDidIncrementLength(t=>this.list.splice(this.list.length,0,or(this.list.length,t))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}var ux=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const qGe=!1;var IP;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(IP||(IP={}));let KGe=4;const GGe=new q;let YGe=300;const ZGe=new q;class BZ{constructor(e){this.el=e,this.disposables=new ne}get onPointerMove(){return this.disposables.add(new ti(Oe(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ti(Oe(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}ux([wn],BZ.prototype,"onPointerMove",null);ux([wn],BZ.prototype,"onPointerUp",null);class WZ{get onPointerMove(){return this.disposables.add(new ti(this.el,Li.Change)).event}get onPointerUp(){return this.disposables.add(new ti(this.el,Li.End)).event}constructor(e){this.el=e,this.disposables=new ne}dispose(){this.disposables.dispose()}}ux([wn],WZ.prototype,"onPointerMove",null);ux([wn],WZ.prototype,"onPointerUp",null);class NP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}ux([wn],NP.prototype,"onPointerMove",null);ux([wn],NP.prototype,"onPointerUp",null);const ore="pointer-events-disabled";class bo extends G{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=ue(this.el,me(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Re(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(J(this._orthogonalStartDragHandle,"mouseenter",()=>bo.onMouseEnter(e))),this.orthogonalStartDragHandleDisposables.add(J(this._orthogonalStartDragHandle,"mouseleave",()=>bo.onMouseLeave(e))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=ue(this.el,me(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Re(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(J(this._orthogonalEndDragHandle,"mouseenter",()=>bo.onMouseEnter(e))),this.orthogonalEndDragHandleDisposables.add(J(this._orthogonalEndDragHandle,"mouseleave",()=>bo.onMouseLeave(e))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=YGe,this.hoverDelayer=this._register(new sc(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new q),this._onDidStart=this._register(new q),this._onDidChange=this._register(new q),this._onDidReset=this._register(new q),this._onDidEnd=this._register(new q),this.orthogonalStartSashDisposables=this._register(new ne),this.orthogonalStartDragHandleDisposables=this._register(new ne),this.orthogonalEndSashDisposables=this._register(new ne),this.orthogonalEndDragHandleDisposables=this._register(new ne),this.linkedSash=void 0,this.el=ue(e,me(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),wt&&this.el.classList.add("mac"),this._register(J(this.el,"mousedown",o=>this.onPointerStart(o,new BZ(e)))),this._register(J(this.el,"dblclick",o=>this.onPointerDoublePress(o))),this._register(J(this.el,"mouseenter",()=>bo.onMouseEnter(this))),this._register(J(this.el,"mouseleave",()=>bo.onMouseLeave(this))),this._register(No.addTarget(this.el)),this._register(J(this.el,Li.Start,o=>this.onPointerStart(o,new WZ(this.el))));let s;this._register(J(this.el,Li.Tap,o=>{if(s){clearTimeout(s),s=void 0,this.onPointerDoublePress(o);return}clearTimeout(s),s=setTimeout(()=>s=void 0,250)})),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=KGe,this._register(GGe.event(o=>{this.size=o,this.layout()}))),this._register(ZGe.event(o=>this.hoverDelay=o)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",qGe),this.layout()}onPointerStart(e,t){Wt.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new NP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new NP(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of s)g.classList.add(ore);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=lc(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=wt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=wt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},h=new ne;d(),i||this.onDidEnablementChange.event(d,null,h);const u=g=>{Wt.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{Wt.stop(g,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const p of s)p.classList.remove(ore)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&bo.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&bo.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){bo.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!hn(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const XGe={separatorBorder:se.transparent};class Ive{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;if(e!==this.visible){e?(this.size=rr(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(s=(i=this.view).setVisible)==null||s.call(i,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class QGe extends Ive{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class JGe extends Ive{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var pf;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(pf||(pf={}));var DP;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(DP||(DP={}));class Nve extends G{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=pf.Idle,this._onDidSashChange=this._register(new q),this._onDidSashReset=this._register(new q),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ue(this.el,me(".sash-container")),this.viewContainer=me(".split-view-container"),this.scrollable=this._register(new rx({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>Ur(Oe(this.el),s)})),this.scrollableElement=this._register(new m3(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new ti(this.viewContainer,"scroll")).event;this._register(i(s=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),ue(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||XGe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,o)=>{const r=ko(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((s,o)=>s+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;o0&&(r.size=rr(Math.round(a*e/s),r.minimumSize,r.maximumSize))}}else{const s=or(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=Hc(J(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),J(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,h=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,h=(p.size-p.minimumSize)/2}let u,f;if(!l){const g=or(s,-1),p=or(s+1,this.viewItems.length),m=g.reduce((E,I)=>E+(this.viewItems[I].minimumSize-c[I]),0),b=g.reduce((E,I)=>E+(this.viewItems[I].viewMaximumSize-c[I]),0),v=p.length===0?Number.POSITIVE_INFINITY:p.reduce((E,I)=>E+(c[I]-this.viewItems[I].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((E,I)=>E+(c[I]-this.viewItems[I].viewMaximumSize),0),C=Math.max(m,w),S=Math.min(v,b),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const E=this.viewItems[L],I=Math.floor(E.viewMinimumSize/2);u={index:L,limitDelta:E.visible?C-I:C+I,size:E.size}}if(typeof x=="number"){const E=this.viewItems[x],I=Math.floor(E.viewMinimumSize/2);f={index:x,limitDelta:E.visible?S+I:S-I,size:E.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:h,alt:l,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=u?t:t+1,p=this.viewItems[g],m=p.size-p.maximumSize,b=p.size-p.minimumSize,v=u?t-1:t+1;this.resize(v,-h,f,void 0,void 0,m,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=rr(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==pf.Idle)throw new Error("Cant modify splitview");this.state=pf.Busy;try{const i=or(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=rr(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o)}finally{this.state=pf.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=rr(i,a.minimumSize,a.maximumSize);const s=or(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==pf.Idle)throw new Error("Cant modify splitview");this.state=pf.Busy;try{const o=me(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Re(()=>o.remove()),l=Hc(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new QGe(o,e,c,l):new JGe(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new bo(this.sashContainer,{getHorizontalSashTop:E=>this.getSashPosition(E),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:1}):new bo(this.sashContainer,{getVerticalSashLeft:E=>this.getSashPosition(E),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:0}),g=this.orientation===0?E=>({sash:f,start:E.startY,current:E.currentY,alt:E.altKey}):E=>({sash:f,start:E.startX,current:E.currentX,alt:E.altKey}),m=ve.map(f.onDidStart,g)(this.onSashStart,this),v=ve.map(f.onDidChange,g)(this.onSashChange,this),C=ve.map(f.onDidEnd,()=>this.sashItems.findIndex(E=>E.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const E=this.sashItems.findIndex(W=>W.sash===f),I=or(E,-1),R=or(E+1,this.viewItems.length),M=this.findFirstSnapIndex(I),A=this.findFirstSnapIndex(R);typeof M=="number"&&!this.viewItems[M].visible||typeof A=="number"&&!this.viewItems[A].visible||this._onDidSashReset.fire(E)}),L=Hc(m,v,C,S,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),s||this.relayout([i],h),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=pf.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=or(e,-1),h=or(e+1,this.viewItems.length);if(o)for(const x of o)l7(d,x),l7(h,x);if(s)for(const x of s)DT(d,x),DT(h,x);const u=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=h.map(x=>this.viewItems[x]),p=h.map(x=>i[x]),m=d.reduce((x,E)=>x+(this.viewItems[E].minimumSize-i[E]),0),b=d.reduce((x,E)=>x+(this.viewItems[E].maximumSize-i[E]),0),v=h.length===0?Number.POSITIVE_INFINITY:h.reduce((x,E)=>x+(i[E]-this.viewItems[E].minimumSize),0),w=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((x,E)=>x+(i[E]-this.viewItems[E].maximumSize),0),C=Math.max(m,w,r),S=Math.min(v,b,a);let L=!1;if(l){const x=this.viewItems[l.index],E=t>=l.limitDelta;L=E!==x.visible,x.setVisible(E,l.size)}if(!L&&c){const x=this.viewItems[c.index],E=ta+l.size,0);let i=this.size-t;const s=or(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)l7(s,a);for(const a of o)DT(s,a);typeof e=="number"&&DT(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:v&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)==null||e.disposable.dispose(),Jt(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}const X4=class X4{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=X4.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=ue(e,me(".monaco-table-tr")),i=[],s=[];for(let r=0;rthis.disposables.add(new tYe(d,h))),l={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new Nve(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new TP(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new pl(e,this.domNode,eYe(i),[c],r)),ve.any(...a.map(d=>d.onDidLayout))(([d,h])=>c.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((f,g)=>f+g.weight,0),u=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=lc(this.domNode),this.style(oKe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=RC._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=this._instantiationService.createInstance(sw,e,t,o,i);if(i&&this._disposedModels.has(Z_(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),h=this._getSHA1Computer(),u=h.canComputeSHA1(r)?h.computeSHA1(r)===c.sha1:!1;if(u||c.sharesUndoRedoStack){for(const f of d.past)Ef(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Ef(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Ef(f)&&f.matchesResource(i)),u&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Z_(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new FKe(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,al,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)Ef(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Ef(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=RC.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Ef(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new WKe(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);RC._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new Uz}},RC=Vv,Vv.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024,Vv);$z=RC=OKe([y2(0,lt),y2(1,Upe),y2(2,sZ),y2(3,Ae)],$z);const K4=class K4{canComputeSHA1(e){return e.getValueLength()<=K4.MAX_MODEL_SIZE}computeSHA1(e){const t=new pH,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}};K4.MAX_MODEL_SIZE=10*1024*1024;let Uz=K4;var qz;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(qz||(qz={}));const Hw={Quickaccess:"workbench.contributions.quickaccess"};class HKe{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Re(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return lh([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}Ji.add(Hw.Quickaccess,new HKe);var VKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Zoe=function(n,e){return function(t,i){e(t,i,n)}};let Kz=class extends G{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=Ji.as(Hw.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0,this._register(Re(()=>{var i;for(const s of this.mapProviderToDescriptor.values())Nw(s)&&s.dispose();(i=this.visibleQuickAccess)==null||i.picker.dispose()}))}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var g,p;const[s,o]=this.getOrInstantiateProvider(e,i==null?void 0:i.enabledProviderPrefixes),r=this.visibleQuickAccess,a=r==null?void 0:r.descriptor;if(r&&o&&a===o){e!==o.prefix&&!(i!=null&&i.preserveValue)&&(r.picker.value=e),this.adjustValueSelection(r.picker,o,i);return}if(o&&!(i!=null&&i.preserveValue)){let m;if(r&&a&&a!==o){const b=r.value.substr(a.prefix.length);b&&(m=`${o.prefix}${b}`)}if(!m){const b=s==null?void 0:s.defaultFilterValue;b===qz.LAST?m=this.lastAcceptedPickerValues.get(o):typeof b=="string"&&(m=`${o.prefix}${b}`)}typeof m=="string"&&(e=m)}const l=(g=r==null?void 0:r.picker)==null?void 0:g.valueSelection,c=(p=r==null?void 0:r.picker)==null?void 0:p.value,d=new ne,h=d.add(this.quickInputService.createQuickPick({useSeparators:!0}));h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=(i==null?void 0:i.placeholder)??(o==null?void 0:o.placeholder),h.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(h.itemActivation=(i==null?void 0:i.itemActivation)??Ld.SECOND),h.contextKey=o==null?void 0:o.contextKey,h.filterValue=m=>m.substring(o?o.prefix.length:0);let u;t&&(u=new Dw,d.add(ve.once(h.onWillAccept)(m=>{m.veto(),h.hide()}))),d.add(this.registerPickerListeners(h,s,o,e,i));const f=d.add(new Bi);if(s&&d.add(s.provide(h,f.token,i==null?void 0:i.providerOptions)),ve.once(h.onDidHide)(()=>{h.selectedItems.length===0&&f.cancel(),d.dispose(),u==null||u.complete(h.selectedItems.slice(0))}),h.show(),l&&c===e&&(h.valueSelection=l),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){let s;i!=null&&i.preserveValue?s=[e.value.length,e.value.length]:s=[(t==null?void 0:t.prefix.length)??0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,s,o){const r=new ne,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Re(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l,o==null?void 0:o.enabledProviderPrefixes);c!==t?this.show(l,{enabledProviderPrefixes:o==null?void 0:o.enabledProviderPrefixes,preserveValue:!0,providerOptions:o==null?void 0:o.providerOptions}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e,t){const i=this.registry.getQuickAccessProvider(e);if(!i||t&&!(t!=null&&t.includes(i.prefix)))return[void 0,void 0];let s=this.mapProviderToDescriptor.get(i);return s||(s=this.instantiationService.createInstance(i.ctor),this.mapProviderToDescriptor.set(i,s)),[s,i]}};Kz=VKe([Zoe(0,No),Zoe(1,Ae)],Kz);const lve={inputActiveOptionBorder:"#007ACC00",inputActiveOptionForeground:"#FFFFFF",inputActiveOptionBackground:"#0E639C50"};class Ug extends Da{get onChange(){return this._onChange.event}get onKeyDown(){return this._onKeyDown.event}constructor(e){super(),this._onChange=this._register(new q),this._onKeyDown=this._register(new q),this._opts=e,this._title=this._opts.title,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...$e.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this._register(td().setupDelayedHover(this.domNode,()=>({content:this._title,style:1}),this._opts.hoverLifecycleOptions)),this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.setTitle(this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(this.enabled){if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)}})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}setIcon(e){this._icon&&this.domNode.classList.remove(...$e.asClassNameArray(this._icon)),this._icon=e,this._icon&&this.domNode.classList.add(...$e.asClassNameArray(this._icon))}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1)),this.domNode.classList.remove("disabled")}disable(){this.domNode.setAttribute("aria-disabled",String(!0)),this.domNode.classList.add("disabled")}setTitle(e){this._title=e,this.domNode.setAttribute("aria-label",e)}set visible(e){this.domNode.style.display=e?"":"none"}get visible(){return this.domNode.style.display!=="none"}}const CQ=class CQ extends Da{constructor(e,t,i){super(),this.checkbox=e,this.domNode=t,this.styles=i,this._onChange=this._register(new q),this.onChange=this._onChange.event,this.applyStyles()}get enabled(){return this.checkbox.enabled}enable(){this.checkbox.enable(),this.applyStyles(!0)}disable(){this.checkbox.disable(),this.applyStyles(!1)}setTitle(e){this.checkbox.setTitle(e)}applyStyles(e=this.enabled){this.domNode.style.color=(e?this.styles.checkboxForeground:this.styles.checkboxDisabledForeground)||"",this.domNode.style.backgroundColor=(e?this.styles.checkboxBackground:this.styles.checkboxDisabledBackground)||"",this.domNode.style.borderColor=(e?this.styles.checkboxBorder:this.styles.checkboxDisabledBackground)||"";const t=this.styles.size||18;this.domNode.style.width=this.domNode.style.height=this.domNode.style.fontSize=`${t}px`,this.domNode.style.fontSize=`${t-2}px`}};CQ.CLASS_NAME="monaco-checkbox";let QE=CQ;class cve extends QE{constructor(e,t,i){const s=new Ug({title:e,isChecked:t,icon:de.check,actionClassName:QE.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...lve});super(s,s.domNode,i),this._register(s),this._register(this.checkbox.onChange(o=>{this.applyStyles(),this._onChange.fire(o)}))}get checked(){return this.checkbox.checked}set checked(e){this.checkbox.checked=e,this.applyStyles()}applyStyles(e){this.checkbox.checked?this.checkbox.setIcon(de.check):this.checkbox.setIcon(void 0),super.applyStyles(e)}}class dve extends QE{constructor(e,t,i){let s;switch(t){case!0:s=de.check;break;case"mixed":s=de.dash;break;case!1:s=void 0;break}const o=new Ug({title:e,isChecked:t===!0,icon:s,actionClassName:cve.CLASS_NAME,hoverLifecycleOptions:i.hoverLifecycleOptions,...lve});super(o,o.domNode,i),this._state=t,this._register(o),this._register(this.checkbox.onChange(r=>{this._state=this.checkbox.checked,this.applyStyles(),this._onChange.fire(r)}))}get checked(){return this._state}set checked(e){this._state!==e&&(this._state=e,this.checkbox.checked=e===!0,this.applyStyles())}applyStyles(e){switch(this._state){case!0:this.checkbox.setIcon(de.check);break;case"mixed":this.checkbox.setIcon(de.dash);break;case!1:this.checkbox.setIcon(void 0);break}super.applyStyles(e)}}var zKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class hve{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}zKe([wn],hve.prototype,"toString",null);const jKe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function $Ke(n){const e=[];let t=0,i;for(;i=jKe.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{QOe(f)&&Ht.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new ti(a,_e.CLICK)).event,d=t.disposables.add(new ti(a,_e.KEY_DOWN)).event,h=ve.chain(d,f=>f.filter(g=>{const p=new ui(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Eo.addTarget(a));const u=t.disposables.add(new ti(a,xi.Tap)).event;ve.any(c,u,h)(l,null,t.disposables),e.appendChild(a)}}var GKe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xoe=function(n,e){return function(t,i){e(t,i,n)}};const uve="inQuickInput",YKe=new Se(uve,!1,_(1748,"Whether keyboard focus is inside the quick input control")),A3=le.has(uve),ZKe="quickInputAlignment",XKe=new Se(ZKe,"top",_(1749,"The alignment of the quick input")),JE="quickInputType",QKe=new Se(JE,void 0,_(1750,"The type of the currently visible quick input")),fve="cursorAtEndOfQuickInputBox",JKe=new Se(fve,!1,_(1751,"Whether the cursor in the quick input is at the end of the input box")),eGe=le.has(fve),Gz={iconClass:$e.asClassName(de.quickInputBack),tooltip:_(1752,"Back")},G4=class G4 extends G{constructor(e){super(),this.ui=e,this._visible=Ze("visible",!1),this._widgetUpdated=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._leftButtons=[],this._rightButtons=[],this._inlineButtons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=G4.noPromptMessage,this._severity=Yi.Ignore,this.onDidTriggerButtonEmitter=this._register(new q),this.onDidHideEmitter=this._register(new q),this.onWillHideEmitter=this._register(new q),this.onDisposeEmitter=this._register(new q),this.visibleDisposables=this._register(new ne),this.onDidHide=this.onDidHideEmitter.event}get visible(){return this._visible.get()}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Jl;this._ignoreFocusOut=e&&!Jl,t&&this.update()}get titleButtons(){return this._leftButtons.length?[...this._leftButtons,this._rightButtons]:this._rightButtons}get buttons(){return[...this._leftButtons,...this._rightButtons,...this._inlineButtons]}set buttons(e){this._leftButtons=e.filter(t=>t===Gz),this._rightButtons=e.filter(t=>t!==Gz&&t.location!==gP.Inline),this._inlineButtons=e.filter(t=>t.location===gP.Inline),this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this._visible.set(!0,void 0),this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=GE.Other){this._visible.set(!1,void 0),this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}willHide(e=GE.Other){this.onWillHideEmitter.fire({reason:e})}update(){var s;if(!this.visible)return;const e=this.getTitle();e&&this.ui.title.textContent!==e?this.ui.title.textContent=e:!e&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const t=this.getDescription();if(this.ui.description1.textContent!==t&&(this.ui.description1.textContent=t),this.ui.description2.textContent!==t&&(this.ui.description2.textContent=t),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?Ss(this.ui.widget,this._widget):Ss(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new ya,this.busyDelay.setIfNotSet(()=>{this.visible&&(this.ui.progressBar.infinite(),this.ui.progressBar.getContainer().removeAttribute("aria-hidden"))},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.ui.progressBar.getContainer().setAttribute("aria-hidden","true"),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const o=this._leftButtons.map((l,c)=>by(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.leftActionBar.push(o,{icon:!0,label:!1}),this.ui.rightActionBar.clear();const r=this._rightButtons.map((l,c)=>by(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.rightActionBar.push(r,{icon:!0,label:!1}),this.ui.inlineActionBar.clear();const a=this._inlineButtons.map((l,c)=>by(l,`id-${c}`,async()=>this.onDidTriggerButtonEmitter.fire(l)));this.ui.inlineActionBar.push(a,{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const o=((s=this.toggles)==null?void 0:s.filter(a=>a instanceof Ug))??[];this.ui.inputBox.toggles=o;const r=o.length*22;this.ui.countContainer.style.right=r>0?`${4+r}px`:"4px",this.ui.visibleCountContainer.style.right=r>0?`${4+r}px`:"4px"}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const i=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==i&&(this._lastValidationMessage=i,Ss(this.ui.message),i&&KKe(i,this.ui.message,{callback:o=>{this.ui.linkOpenerDelegate(o)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?_(1754,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==Yi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}};G4.noPromptMessage=_(1753,"Press 'Enter' to confirm your input or 'Escape' to cancel");let eN=G4;const Y4=class Y4 extends eN{constructor(e){super(e),this._value="",this.onDidChangeValueEmitter=this._register(new q),this.onWillAcceptEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._keepScrollPosition=!1,this._itemActivation=Ld.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new q),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new q),this.onDidTriggerItemButtonEmitter=this._register(new q),this.onDidTriggerSeparatorButtonEmitter=this._register(new q),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this._focusEventBufferer=new oD,this.type="quickPick",this.filterValue=t=>t,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event,this.noValidationMessage=void 0}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get prompt(){return this.noValidationMessage}set prompt(e){this.noValidationMessage=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?KUe:this.ui.keyMods}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get okLabel(){return this._okLabel??_(1756,"OK")}set okLabel(e){this._okLabel=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.canSelectMany||this.ui.list.focus(Ii.First)}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this._focusEventBufferer.wrapEvent(this.ui.list.onDidChangeFocus,(e,t)=>t)(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Fi(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany&&!e.some(i=>i.pickable===!1)){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Fi(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(JG(t)&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{!this.canSelectMany||!this.visible||this.selectedItemsToConfirm!==this._selectedItems&&Fi(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return J(this.ui.container,_e.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new ui(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.titleButtons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage||!!this.prompt,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;!s&&i.inputBox&&(s=this.placeholder,this.title&&(s=s?`${s} - ${this.title}`:this.title),s||(s=Y4.DEFAULT_ARIA_LABEL)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.inputBox.ariaLabel!==s&&(this.ui.inputBox.ariaLabel=s??"input"),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated&&(this.itemsUpdated=!1,this._focusEventBufferer.bufferEvents(()=>{switch(this.ui.list.setElements(this.items),this.ui.list.shouldLoop=!this.canSelectMany,this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this._itemActivation){case Ld.NONE:this._itemActivation=Ld.FIRST;break;case Ld.SECOND:this.ui.list.focus(Ii.Second),this._itemActivation=Ld.FIRST;break;case Ld.LAST:this.ui.list.focus(Ii.Last),this._itemActivation=Ld.FIRST;break;default:this.trySelectFirst();break}})),this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.ok.label=this.okLabel||"",this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(Ii.First)),this.keepScrollPosition&&(this.scrollTop=e)}focus(e){this.ui.list.focus(e),this.canSelectMany&&this.ui.list.domFocus()}accept(e){e&&!this._canAcceptInBackground||(this.activeItems[0]&&!this._canSelectMany&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(e??!1))}};Y4.DEFAULT_ARIA_LABEL=_(1755,"Type to narrow down results.");let Fk=Y4,tGe=class extends eN{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new q),this.onDidAcceptEmitter=this._register(new q),this.type="inputBox",this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get valueSelection(){const e=this.ui.inputBox.getSelection();if(e)return[e.start,e.end]}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.noValidationMessage=e?_(1757,"{0} (Press 'Enter' to confirm or 'Escape' to cancel)",e):eN.noPromptMessage,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}accept(){this.onDidAcceptEmitter.fire()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.titleButtons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password);let t=this.ariaLabel;!t&&e.inputBox&&(t=this.placeholder?this.title?`${this.placeholder} - ${this.title}`:this.placeholder:this.title?this.title:"input"),this.ui.inputBox.ariaLabel!==t&&(this.ui.inputBox.ariaLabel=t||"input")}},Yz=class extends CS{constructor(e,t){super("mouse",void 0,i=>this.getOverrideOptions(i),e,t)}getOverrideOptions(e){const t=(hn(e.content)?e.content.textContent??"":typeof e.content=="string"?e.content:e.content.value).includes(` +`);return{persistence:{hideOnKeyDown:!1},appearance:{showHoverHint:t,skipFadeInAnimation:!0}}}};Yz=GKe([Xoe(0,lt),Xoe(1,Sr)],Yz);se.white.toString(),se.white.toString();const iGe=Object.freeze({allowedTags:{override:["b","i","u","code","span"]},allowedAttributes:{override:["class"]}});class IP extends G{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new q),this._onDidEscape=this._register(new q),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),typeof t.title=="string"&&this.setTitle(t.title),typeof t.ariaLabel=="string"&&this._element.setAttribute("aria-label",t.ariaLabel),e.appendChild(this._element),this.enabled=!t.disabled,this._register(Eo.addTarget(this._element)),[_e.CLICK,xi.Tap].forEach(o=>{this._register(J(this._element,o,r=>{if(!this.enabled){Ht.stop(r);return}this._onDidClick.fire(r)}))}),this._register(J(this._element,_e.KEY_DOWN,o=>{const r=new ui(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._onDidEscape.fire(o),this._element.blur(),a=!0),a&&Ht.stop(r,!0)})),this._register(J(this._element,_e.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(J(this._element,_e.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(tc(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of xm(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var s;if(this._label===e||cg(this._label)&&cg(e)&&Uje(this._label,e))return;this._element.classList.add("monaco-text-button");const t=this.options.supportShortLabel?this._labelElement:this._element;if(cg(e)){const o=ID(e,void 0,document.createElement("span"));o.dispose();const r=(s=o.element.querySelector("p"))==null?void 0:s.innerHTML;r?Pbe(t,r,iGe):Ss(t)}else this.options.supportIcons?Ss(t,...this.getContentElements(e)):t.textContent=e;let i="";typeof this.options.title=="string"?i=this.options.title:this.options.title&&(i=hUe(e)),this.setTitle(i),this._setAriaLabel(),this._label=e}get label(){return this._label}_setAriaLabel(){typeof this.options.ariaLabel=="string"?this._element.setAttribute("aria-label",this.options.ariaLabel):typeof this.options.title=="string"&&this._element.setAttribute("aria-label",this.options.title)}set icon(e){this._setAriaLabel();const t=Array.from(this._element.classList).filter(i=>i.startsWith("codicon-"));this._element.classList.remove(...t),this._element.classList.add(...$e.asClassNameArray(e))}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}setTitle(e){!this._hover&&e!==""?this._hover=this._register(td().setupManagedHover(this.options.hoverDelegate??Pu("element"),this._element,e)):this._hover&&this._hover.update(e)}}class Zz extends G{constructor(e,t,i){super(),this.options=t,this.styles=i,this.count=0,this.hover=this._register(new Gt),this.element=he(e,me(".monaco-count-badge")),this._register(Re(()=>e.removeChild(this.element))),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0),this.updateHover()}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.updateHover(),this.render()}updateHover(){this.titleFormat!==""&&!this.hover.value?this.hover.value=td().setupDelayedHoverAtMouse(this.element,()=>({content:Z1(this.titleFormat,this.count),appearance:{compact:!0}})):this.titleFormat===""&&this.hover.value&&(this.hover.value=void 0)}render(){this.element.textContent=Z1(this.countFormat,this.count),this.element.style.backgroundColor=this.styles.badgeBackground??"",this.element.style.color=this.styles.badgeForeground??"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const Qoe="done",Joe="active",D9="infinite",T9="infinite-long-running",ere="discrete",Z4=class Z4 extends G{constructor(e,t){super(),this.progressSignal=this._register(new Gt),this.workedVal=0,this.showDelayedScheduler=this._register(new ai(()=>ca(this.element),0)),this.longRunningScheduler=this._register(new ai(()=>this.infiniteLongRunning(),Z4.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(Joe,D9,T9,ere),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel(),this.progressSignal.clear()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Qoe),this.element.classList.contains(D9)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(ere,Qoe,T9),this.element.classList.add(Joe,D9),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(T9)}getContainer(){return this.element}};Z4.LONG_RUNNING_INFINITE_THRESHOLD=1e4;let Xz=Z4;const nGe=_(2,"Match Case"),sGe=_(3,"Match Whole Word"),oGe=_(4,"Use Regular Expression");class gve extends Ug{constructor(e){super({icon:de.caseSensitive,title:nGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class pve extends Ug{constructor(e){super({icon:de.wholeWord,title:sGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class mve extends Ug{constructor(e){super({icon:de.regex,title:oGe+e.appendTitle,isChecked:e.isChecked,hoverLifecycleOptions:e.hoverLifecycleOptions,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}function rGe(n,e,t){const i=t??document.createElement("div");return i.textContent=n,i}function aGe(n,e,t){const i=t??document.createElement("div");return i.textContent="",_ve(i,cGe(n),e==null?void 0:e.actionHandler,e==null?void 0:e.renderCodeSegments),i}class lGe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function _ve(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(kn(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{_ve(s,o,t,i)})}function cGe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new lGe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&Qz(r.peek())!==0;if(l&&(a=r.next()),!l&&dGe(a)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=Qz(a);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` +`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function dGe(n,e){return Qz(n)!==0}function Qz(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return 0;default:return 0}}class hGe{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class uGe{constructor(e=new Set,t=10){this._history=e,this._limit=t,this._onChange(),this._history.onDidChange&&(this._disposable=this._history.onDidChange(()=>this._onChange()))}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new hGe(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;if(e.length>this._limit){const t=e.slice(e.length-this._limit);this._history.replace?this._history.replace(t):this._history=new Set(t)}}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=void 0)}}const vC=me;class fGe extends Da{get onDidChange(){return this._onDidChange.event}get onDidHeightChange(){return this._onDidHeightChange.event}constructor(e,t,i){super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this.hover=this._register(new Gt),this._onDidChange=this._register(new q),this._onDidHeightChange=this._register(new q),this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=this.options.tooltip??(this.placeholder||""),this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=he(e,vC(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=he(this.element,vC(".ibwrapper"));if(this.input=he(o,vC(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=he(o,vC("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new Lme(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),he(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(l=>this.input.scrollTop=l.scrollTop));const r=this._register(new ti(e.ownerDocument,"selectionchange")),a=ve.filter(r.event,()=>{const l=e.ownerDocument.getSelection();return(l==null?void 0:l.anchorNode)===o});this._register(a(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new jr(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.hover.value||(this.hover.value=this._register(td().setupDelayedHoverAtMouse(this.input,()=>({content:this.tooltip,appearance:{compact:!0}}))))}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:zf(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return H5(this.input)}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}getSelection(){const e=this.input.selectionStart;if(e===null)return null;const t=this.input.selectionEnd??e;return{start:e,end:t}}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&_a(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${dg(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=aa(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{if(!this.message)return null;e=he(s,vC(".monaco-inputbox-container")),t();const o=vC("span.monaco-inputbox-message");this.message.formatContent?aGe(this.message.content,void 0,o):rGe(this.message.content,void 0,o),o.classList.add(this.classForType(this.message.type));const r=this.stylesForType(this.message.type);return o.style.backgroundColor=r.background??"",o.style.color=r.foreground??"",o.style.border=r.border?`1px solid ${r.border}`:"",he(e,o),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=_(9,"Error: {0}",this.message.content):this.message.type===2?i=_(10,"Warning: {0}",this.message.content):i=_(11,"Info: {0}",this.message.content),vr(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){const e=this.options.inputBoxStyles,t=e.inputBackground??"",i=e.inputForeground??"",s=e.inputBorder??"";this.element.style.backgroundColor=t,this.element.style.color=i,this.input.style.backgroundColor="inherit",this.input.style.color=i,this.element.style.border=`1px solid ${dg(s,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=zf(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)==null||e.dispose(),super.dispose()}}class bve extends fGe{constructor(e,t,i){const s=_(12," or {0} for history","⇅"),o=_(13," ({0} for history)","⇅");super(e,t,i),this._onDidFocus=this._register(new q),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new q),this.onDidBlur=this._onDidBlur.event,this.history=this._register(new uGe(i.history,100));const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const a=this.placeholder.endsWith(")")?s:o,l=this.placeholder+a;i.showPlaceholderOnFocus&&!H5(this.input)?this.placeholder=l:this.setPlaceHolder(l)}};this.observer=new MutationObserver((a,l)=>{a.forEach(c=>{c.target.textContent||r()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>r()),this.onblur(this.input,()=>{const a=l=>{if(this.placeholder.endsWith(l)){const c=this.placeholder.slice(0,this.placeholder.length-l.length);return i.showPlaceholderOnFocus?this.placeholder=c:this.setPlaceHolder(c),!0}else return!1};a(o)||a(s)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",Jd(this.value?this.value:_(14,"Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,Jd(this.value))}setPlaceHolder(e){super.setPlaceHolder(e),this.setTooltip(e)}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const gGe=_(1,"input");class vve extends Da{get onDidOptionChange(){return this._onDidOptionChange.event}get onKeyDown(){return this._onKeyDown.event}get onMouseDown(){return this._onMouseDown.event}get onCaseSensitiveKeyDown(){return this._onCaseSensitiveKeyDown.event}get onRegexKeyDown(){return this._onRegexKeyDown.event}constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new Gt),this.additionalToggles=[],this._onDidOptionChange=this._register(new q),this._onKeyDown=this._register(new q),this._onMouseDown=this._register(new q),this._onInput=this._register(new q),this._onKeyUp=this._register(new q),this._onCaseSensitiveKeyDown=this._register(new q),this._onRegexKeyDown=this._register(new q),this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||gGe,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=!!i.flexibleHeight,l=!!i.flexibleWidth,c=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new bve(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:i.inputBoxStyles,history:i.history})),this.showCommonFindToggles){const d=(i==null?void 0:i.hoverLifecycleOptions)||{groupId:"find-input"};this.regex=this._register(new mve({appendTitle:r,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.regex.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(u=>{this._onRegexKeyDown.fire(u)})),this.wholeWords=this._register(new pve({appendTitle:o,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.wholeWords.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new gve({appendTitle:s,isChecked:!1,hoverLifecycleOptions:d,...i.toggleStyles})),this._register(this.caseSensitive.onChange(u=>{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(u=>{this._onCaseSensitiveKeyDown.fire(u)}));const h=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const f=h.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%h.length:u.equals(15)&&(f===0?g=h.length-1:g=f-1),u.equals(9)?(h[f].blur(),this.inputBox.focus()):g>=0&&h[g].focus(),Ht.stop(u,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(J(this.inputBox.inputElement,"compositionstart",d=>{this.imeSessionInProgress=!0})),this._register(J(this.inputBox.inputElement,"compositionend",d=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,d=>this._onKeyDown.fire(d)),this.onkeyup(this.inputBox.inputElement,d=>this._onKeyUp.fire(d)),this.oninput(this.inputBox.inputElement,d=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,d=>this._onMouseDown.fire(d))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)==null||e.enable(),(t=this.wholeWords)==null||t.enable(),(i=this.caseSensitive)==null||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)==null||e.disable(),(t=this.wholeWords)==null||t.disable(),(i=this.caseSensitive)==null||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new ne;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=(((t=this.caseSensitive)==null?void 0:t.width())??0)+(((i=this.wholeWords)==null?void 0:i.width())??0)+(((s=this.regex)==null?void 0:s.width())??0)+this.additionalToggles.reduce((o,r)=>o+r.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e;return((e=this.caseSensitive)==null?void 0:e.checked)??!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e;return((e=this.wholeWords)==null?void 0:e.checked)??!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e;return((e=this.regex)==null?void 0:e.checked)??!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)==null||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}const pGe=me;class mGe extends G{constructor(e,t,i){super(),this.parent=e,this.onDidChange=o=>this.findInput.onDidChange(o),this.container=he(this.parent,pGe(".quick-input-box")),this.findInput=this._register(new vve(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="textbox",s.ariaHasPopup="menu",s.ariaAutoComplete="list"}get onKeyDown(){return this.findInput.onKeyDown}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}getSelection(){return this.findInput.inputBox.getSelection()}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}get ariaLabel(){return this.findInput.inputBox.inputElement.getAttribute("aria-label")||""}set ariaLabel(e){this.findInput.inputBox.inputElement.setAttribute("aria-label",e)}hasFocus(){return this.findInput.inputBox.hasFocus()}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}removeAttribute(e){this.findInput.inputBox.inputElement.removeAttribute(e)}showDecoration(e){e===Yi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===Yi.Info?1:e===Yi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===Yi.Info?1:e===Yi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Im extends G{constructor(e,t){super(),this.options=t,this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.domNode=he(e,me("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s,o){e||(e=""),s&&(e=Im.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&_a(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render(o))}render(e){var s;const t=[];let i=0;for(const o of this.highlights){if(o.end===o.start)continue;if(i{s=o===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class oL{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set classNames(e){this.disposed||_a(e,this._classNames)||(this._classNames=e,this._element.classList.value="",this._element.classList.add(...e))}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class tN extends G{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new oL(he(e,me(".monaco-icon-label")))),this.labelContainer=he(this.domNode.element,me(".monaco-icon-label-container")),this.nameContainer=he(this.labelContainer,me("span.monaco-icon-name-container")),t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=this._register(new vGe(this.nameContainer,!!t.supportIcons)):this.nameNode=new _Ge(this.nameContainer),this.hoverDelegate=(t==null?void 0:t.hoverDelegate)??Pu("mouse")}get element(){return this.domNode.element}setLabel(e,t,i){var l;const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";i&&(i.extraClasses&&s.push(...i.extraClasses),i.bold&&s.push("bold"),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(typeof i.title=="string"?r+=i.title:r+=e));const a=this.domNode.element.querySelector(".monaco-icon-label-iconpath");if(i!=null&&i.iconPath){let c;if(!a||!hn(a)?(c=me(".monaco-icon-label-iconpath"),this.domNode.element.prepend(c)):c=a,$e.isThemeIcon(i.iconPath)){const d=$e.asClassName(i.iconPath);c.className=`monaco-icon-label-iconpath ${d}`,c.style.backgroundImage=""}else c.style.backgroundImage=xu(i==null?void 0:i.iconPath);c.style.backgroundRepeat="no-repeat",c.style.backgroundPosition="center",c.style.backgroundSize="contain"}else a&&a.remove();if(this.domNode.classNames=s,this.domNode.element.setAttribute("aria-label",r),this.labelContainer.classList.value="",this.labelContainer.classList.add(...o),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const c=this.getOrCreateDescriptionNode();if(c instanceof Im){const d=(i==null?void 0:i.supportIcons)??((l=this.creationOptions)==null?void 0:l.supportIcons);c.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines,d),this.setupHover(c.element,i==null?void 0:i.descriptionTitle)}else c.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Im.escapeNewLines(t,[]):t||"",this.setupHover(c.element,(i==null?void 0:i.descriptionTitle)||""),c.empty=!t}if(i!=null&&i.suffix||this.suffixNode){const c=this.getOrCreateSuffixNode();c.textContent=(i==null?void 0:i.suffix)??""}}setupHover(e,t){var r;const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}let s=e;if((r=this.creationOptions)!=null&&r.hoverTargetOverride){if(!ys(e,this.creationOptions.hoverTargetOverride))throw new Error("hoverTargetOverrride must be an ancestor of the htmlElement");s=this.creationOptions.hoverTargetOverride}const o=td().setupManagedHover(this.hoverDelegate,s,t);o&&this.customHovers.set(e,o)}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateSuffixNode(){if(!this.suffixNode){const e=this._register(new oL(i4e(this.nameContainer,me("span.monaco-icon-suffix-container"))));this.suffixNode=this._register(new oL(he(e.element,me("span.label-suffix"))))}return this.suffixNode}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new oL(he(this.labelContainer,me("span.monaco-icon-description-container"))));(e=this.creationOptions)!=null&&e.supportDescriptionHighlights?this.descriptionNode=this._register(new Im(he(t.element,me("span.label-description")))):this.descriptionNode=this._register(new oL(he(t.element,me("span.label-description"))))}return this.descriptionNode}}class _Ge{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&_a(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=he(this.container,me("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>mo.intersect(o,a)).filter(a=>!mo.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class vGe extends G{constructor(e,t){super(),this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label===e&&_a(this.options,t))return;this.label=e,this.options=t;const i=(t==null?void 0:t.supportIcons)??this.supportIcons;if(typeof e=="string")this.singleLabel||(this.container.textContent="",this.container.classList.remove("multiple"),this.singleLabel=this._register(new Im(he(this.container,me("a.label-name",{id:t==null?void 0:t.domId}))))),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines,i);else{this.container.textContent="",this.container.classList.add("multiple"),this.singleLabel=void 0;const s=(t==null?void 0:t.separator)||"/",o=bGe(e,s,t==null?void 0:t.matches);for(let r=0;r"u"?!1:i.collapseByDefault,this.allowNonCollapsibleParents=i.allowNonCollapsibleParents??!1,this.filter=i.filter,this.autoExpandSingleChildren=typeof i.autoExpandSingleChildren>"u"?!1:i.autoExpandSingleChildren,this.root={parent:void 0,element:t,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=Dt.empty(),s={}){if(e.length===0)throw new Ya(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s=Dt.empty(),o,r=o.diffDepth??0){const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,s,o);const l=[...s],c=t[t.length-1],d=new Xh({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,c),...l,...a.children.slice(c+i)].map(p=>e.getId(p.element).toString())}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,o);const h=t.slice(0,-1),u=(p,m,b)=>{if(r>0)for(let v=0;vb.originalStart-m.originalStart))u(f,g,f-(p.originalStart+p.originalLength)),f=p.originalStart,g=p.modifiedStart-c,this.spliceSimple([...h,f],p.originalLength,Dt.slice(l,g,g+p.modifiedLength),o);u(f,g,f)}spliceSimple(e,t,i=Dt.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),h=[],u=Dt.map(i,S=>this.createTreeNode(S,a,a.visible?1:0,c,h,s)),f=e[e.length-1];let g=0;for(let S=f;S>=0&&Sr.getId(S.element).toString())):a.lastDiffIds=a.children.map(S=>r.getId(S.element).toString()):a.lastDiffIds=void 0;let w=0;for(const S of v)S.visible&&w++;if(w!==0)for(let S=f+p.length;S0&&o){const S=L=>{o(L),L.children.forEach(S)};v.forEach(S)}if(c&&d){const S=v.reduce((L,x)=>L+(x.visible?x.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-S),this._onDidSpliceRenderedNodes.fire({start:l,deleteCount:S,elements:h})}this._onDidSpliceModel.fire({insertedNodes:p,deletedNodes:v});let C=a;for(;C;){if(C.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}C=C.parent}}rerender(e){if(e.length===0)throw new Ya(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this._onDidSpliceRenderedNodes.fire({start:i,deleteCount:1,elements:[t]})}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!R9(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this._onDidSpliceRenderedNodes.fire({start:t+1,deleteCount:l,elements:a.slice(1)}),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(R9(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!R9(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this._onDidSpliceRenderedNodes.fire({start:0,deleteCount:e,elements:t}),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||Dt.empty(),d=s&&l!==0&&!a.collapsed;let h=0,u=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),u+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=h++)}return this.allowNonCollapsibleParents||(a.collapsible=a.collapsible||a.children.length>0),a.visibleChildrenCount=h,a.visible=l===2?h>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=u):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):TD(i)?(e.filterData=i.data,dw(i.visibility)):(e.filterData=void 0,dw(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new Ya(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new Ya(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new Ya(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function M9(n){return n instanceof ND?new yGe(n):n}class SGe{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=G.None,this.disposables=new ne}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,M9(e),t)}onDragOver(e,t,i,s,o,r=!0){const a=this.dnd.onDragOver(M9(e),t&&t.element,i,s,o),l=this.autoExpandNode!==t;if(l&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return a;if(l&&typeof a!="boolean"&&a.autoExpand&&(this.autoExpandDisposable=kg(()=>{const f=this.modelProvider(),g=f.getNodeLocation(t);f.isCollapsed(g)&&f.setCollapsed(g,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof a=="boolean"||!a.accept||typeof a.bubble>"u"||a.feedback){if(!r){const f=typeof a=="boolean"?a:a.accept,g=typeof a=="boolean"?void 0:a.effect;return{accept:f,effect:g,feedback:[i]}}return a}if(a.bubble===1){const f=this.modelProvider(),g=f.getNodeLocation(t),p=f.getParentNodeLocation(g),m=f.getNode(p),b=p&&f.getListIndex(p);return this.onDragOver(e,m,b,s,o,!1)}const c=this.modelProvider(),d=c.getNodeLocation(t),h=c.getListIndex(d),u=c.getListRenderCount(d);return{...a,feedback:ar(h,h+u)}}drop(e,t,i,s,o){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(M9(e),t&&t.element,i,s,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function xGe(n,e,t){return t&&{...t,identityProvider:t.identityProvider&&{getId(i){return t.identityProvider.getId(i.element)}},dnd:t.dnd&&e.add(new SGe(n,t.dnd)),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent(i){return t.multipleSelectionController.isSelectionSingleChangeEvent({...i,element:i.element})},isSelectionRangeChangeEvent(i){return t.multipleSelectionController.isSelectionRangeChangeEvent({...i,element:i.element})}},accessibilityProvider:t.accessibilityProvider&&{...t.accessibilityProvider,getSetSize(i){const s=n(),o=s.getNodeLocation(i),r=s.getParentNodeLocation(o);return s.getNode(r).visibleChildrenCount},getPosInSet(i){return i.visibleChildIndex+1},isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?i=>t.accessibilityProvider.isChecked(i.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?i=>t.accessibilityProvider.getRole(i.element):()=>"treeitem",getAriaLabel(i){return t.accessibilityProvider.getAriaLabel(i.element)},getWidgetAriaLabel(){return t.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?i=>t.accessibilityProvider.getAriaLevel(i.element):i=>i.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(i=>t.accessibilityProvider.getActiveDescendantId(i.element))},keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{...t.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(i){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i.element)}}}}class OZ{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)==null||s.call(i,e.element,t)}}var hw;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(hw||(hw={}));class LGe{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new ne,this.onDidChange=ve.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}const W0=class W0{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.model=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=W0.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=G.None,this.disposables=new ne,this.templateId=e.templateId,this.updateOptions(r),ve.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)==null||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=lr(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)s.indentSize=W0.DefaultIndent+(i.depth-1)*this.indent,this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==hw.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new ne;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=he(e,me(".monaco-tl-row")),i=he(t,me(".monaco-tl-indent")),s=he(t,me(".monaco-tl-twistie")),o=he(t,me(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:G.None,indentSize:0,templateData:r}}renderElement(e,t,i,s){i.indentSize=W0.DefaultIndent+(e.depth-1)*this.indent,this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,{...s,indent:i.indentSize})}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)==null||r.call(o,e,t,i.templateData,{...s,indent:i.indentSize}),typeof(s==null?void 0:s.height)=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){t.twistie.style.paddingLeft=`${t.indentSize}px`,t.indent.style.width=`${t.indentSize+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...$e.asClassNameArray(de.treeItemExpanded));let i=!1;this.renderer.renderTwistie&&(i=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(i||t.twistie.classList.add(...$e.asClassNameArray(de.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(js(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new ne;for(;;){const s=this.model.getNodeLocation(e),o=this.model.getParentNodeLocation(s);if(!o)break;const r=this.model.getNode(o),a=me(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(Re(()=>this.renderedIndentGuides.delete(r,a))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set;e.forEach(i=>{const s=this.model.getNodeLocation(i);try{const o=this.model.getParentNodeLocation(s);i.collapsible&&i.children.length>0&&!i.collapsed?t.add(i):o&&t.add(this.model.getNode(o))}catch{}}),this.activeIndentNodes.forEach(i=>{t.has(i)||this.renderedIndentGuides.forEach(i,s=>s.classList.remove("active"))}),t.forEach(i=>{this.activeIndentNodes.has(i)||this.renderedIndentGuides.forEach(i,s=>s.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),ei(this.disposables)}};W0.DefaultIndent=8;let Jz=W0;function kGe(n,e){const t=e.toLowerCase().indexOf(n);let i;if(t>-1){i=[Number.MAX_SAFE_INTEGER,0];for(let s=n.length;s>0;s--)i.push(t+s-1)}return i}class wve{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}set findMatchType(e){this._findMatchType=e}get findMatchType(){return this._findMatchType}set findMode(e){this._findMode=e}get findMode(){return this._findMode}constructor(e,t,i){this._keyboardNavigationLabelProvider=e,this._filter=t,this._defaultFindVisibility=i,this._totalCount=0,this._matchCount=0,this._findMatchType=Fd.Fuzzy,this._findMode=Za.Highlight,this._pattern="",this._lowercasePattern="",this.disposables=new ne}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:TD(r)?i=dw(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:$c.Default,visibility:i};const s=this._keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:$c.Default,visibility:i};let l;if(this._findMatchType===Fd.Contiguous?l=kGe(this._lowercasePattern,a.toLowerCase()):l=rw(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0}),l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this._findMode===Za.Filter?typeof this._defaultFindVisibility=="number"?this._defaultFindVisibility:this._defaultFindVisibility?this._defaultFindVisibility(e):2:{data:$c.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){ei(this.disposables)}}class IGe{constructor(e){this.stateMap=new Map(e.map(t=>[t.id,{...t}]))}get(e){const t=this.stateMap.get(e);if(t===void 0)throw new Error(`No state found for toggle id ${e}`);return t.isChecked}set(e,t){const i=this.stateMap.get(e);if(i===void 0)throw new Error(`No state found for toggle id ${e}`);return i.isChecked===t?!1:(i.isChecked=t,!0)}}var Za;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Za||(Za={}));var Fd;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Fd||(Fd={}));var Sp;(function(n){n.Mode="mode",n.MatchType="matchType"})(Sp||(Sp={}));class EGe{get pattern(){return this._pattern}get placeholder(){return this._placeholder}set placeholder(e){var t;this._placeholder=e,(t=this.widget)==null||t.setPlaceHolder(e)}constructor(e,t,i,s={}){this.tree=e,this.filter=t,this.contextViewProvider=i,this.options=s,this._pattern="",this._onDidChangePattern=new q,this._onDidChangeOpenState=new q,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new ne,this.disposables=new ne,this.toggles=new IGe(s.toggles??[]),this._placeholder=s.placeholder??_(20,"Type to search")}isOpened(){return!!this.widget}updateToggleState(e,t){var i;this.toggles.set(e,t),(i=this.widget)==null||i.setToggleState(e,t)}renderMessage(e,t){var i,s,o;e?this.tree.options.showNotFoundMessage??!0?(i=this.widget)==null||i.showMessage({type:2,content:t??_(21,"No results found.")}):(s=this.widget)==null||s.showMessage({type:2}):(o=this.widget)==null||o.clearMessage()}alertResults(e){vr(e?_(23,"{0} results",e):_(22,"No results"))}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}let Cve=class extends EGe{get mode(){return this.toggles.get(Sp.Mode)?Za.Filter:Za.Highlight}set mode(e){if(e===this.mode)return;const t=e===Za.Filter;this.updateToggleState(Sp.Mode,t),this.placeholder=t?_(24,"Type to filter"):_(25,"Type to search"),this.filter.findMode=e,this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e)}get matchType(){return this.toggles.get(Sp.MatchType)?Fd.Fuzzy:Fd.Contiguous}set matchType(e){e!==this.matchType&&(this.updateToggleState(Sp.MatchType,e===Fd.Fuzzy),this.filter.findMatchType=e,this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s={}){const o=s.defaultFindMode??Za.Highlight,r=s.defaultFindMatchType??Fd.Fuzzy,a=[{id:Sp.Mode,icon:de.listFilter,title:_(26,"Filter"),isChecked:o===Za.Filter},{id:Sp.MatchType,icon:de.searchFuzzy,title:_(27,"Fuzzy Match"),isChecked:r===Fd.Fuzzy}];t.findMatchType=r,t.findMode=o,super(e,t,i,{...s,toggles:a}),this.filter=t,this._onDidChangeMode=new q,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new q,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this.disposables.add(this.tree.onDidChangeModel(()=>{this.isOpened()&&(this.pattern.length!==0&&this.tree.refilter(),this.render())})),this.disposables.add(this.tree.onWillRefilter(()=>this.filter.reset()))}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}shouldAllowFocus(e){return!this.isOpened()||!this.pattern||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!$c.isDefault(e.filterData)}render(){const t=this.filter.matchCount===0&&this.filter.totalCount>0&&this.pattern.length>0;this.renderMessage(t),this.pattern.length&&this.alertResults(this.filter.matchCount)}};function NGe(n,e){return n.position===e.position&&yve(n,e)}function yve(n,e){return n.node.element===e.node.element&&n.startIndex===e.startIndex&&n.height===e.height&&n.endIndex===e.endIndex}class DGe{constructor(e=[]){this.stickyNodes=e}get count(){return this.stickyNodes.length}equal(e){return Fi(this.stickyNodes,e.stickyNodes,NGe)}contains(e){return this.stickyNodes.some(t=>t.node.element===e.element)}lastNodePartiallyVisible(){if(this.count===0)return!1;const e=this.stickyNodes[this.count-1];if(this.count===1)return e.position!==0;const t=this.stickyNodes[this.count-2];return t.position+t.height!==e.position}animationStateChanged(e){if(!Fi(this.stickyNodes,e.stickyNodes,yve)||this.count===0)return!1;const t=this.stickyNodes[this.count-1],i=e.stickyNodes[e.count-1];return t.position!==i.position}}class TGe{constrainStickyScrollNodes(e,t,i){for(let s=0;si||s>=t)return e.slice(0,s)}return e}}let tre=class extends G{constructor(e,t,i,s,o,r={}){super(),this.tree=e,this.model=t,this.view=i,this.treeDelegate=o,this.maxWidgetViewRatio=.4;const a=this.validateStickySettings(r);this.stickyScrollMaxItemCount=a.stickyScrollMaxItemCount,this.stickyScrollDelegate=r.stickyScrollDelegate??new TGe,this.paddingTop=r.paddingTop??0,this._widget=this._register(new RGe(i.getScrollableElement(),i,e,s,o,r.accessibilityProvider)),this.onDidChangeHasFocus=this._widget.onDidChangeHasFocus,this.onContextMenu=this._widget.onContextMenu,this._register(i.onDidScroll(()=>this.update())),this._register(i.onDidChangeContentHeight(()=>this.update())),this._register(e.onDidChangeCollapseState(()=>this.update())),this._register(t.onDidSpliceRenderedNodes(l=>{const c=this._widget.state;if(!c)return;if(l.deleteCount>0&&c.stickyNodes.some(u=>!this.model.has(this.model.getNodeLocation(u.node)))){this.update();return}c.stickyNodes.some(u=>{const f=this.model.getListIndex(this.model.getNodeLocation(u.node));return f>=l.start&&f=this.view.length))return this.view.element(t)}update(){const e=this.getNodeAtHeight(this.paddingTop);if(!e||this.tree.scrollTop<=this.paddingTop){this._widget.setState(void 0);return}const t=this.findStickyState(e);this._widget.setState(t)}findStickyState(e){const t=[];let i=e,s=0,o=this.getNextStickyNode(i,void 0,s);for(;o&&(t.push(o),s+=o.height,!(t.length<=this.stickyScrollMaxItemCount&&(i=this.getNextVisibleNode(o),!i)));)o=this.getNextStickyNode(i,o.node,s);const r=this.constrainStickyNodes(t);return r.length?new DGe(r):void 0}getNextVisibleNode(e){return this.getNodeAtHeight(e.position+e.height)}getNextStickyNode(e,t,i){const s=this.getAncestorUnderPrevious(e,t);if(s&&!(s===e&&(!this.nodeIsUncollapsedParent(e)||this.nodeTopAlignsWithStickyNodesBottom(e,i))))return this.createStickyScrollNode(s,i)}nodeTopAlignsWithStickyNodesBottom(e,t){const i=this.getNodeIndex(e),s=this.view.getElementTop(i),o=t;return this.view.scrollTop===s-o}createStickyScrollNode(e,t){const i=this.treeDelegate.getHeight(e),{startIndex:s,endIndex:o}=this.getNodeRange(e),r=this.calculateStickyNodePosition(o,t,i);return{node:e,position:r,height:i,startIndex:s,endIndex:o}}getAncestorUnderPrevious(e,t=void 0){let i=e,s=this.getParentNode(i);for(;s;){if(s===t)return i;i=s,s=this.getParentNode(i)}if(t===void 0)return i}calculateStickyNodePosition(e,t,i){let s=this.view.getRelativeTop(e);if(s===null&&this.view.firstVisibleIndex===e&&e+1l&&t<=l?l-i:t}constrainStickyNodes(e){if(e.length===0)return[];const t=this.view.renderHeight*this.maxWidgetViewRatio,i=e[e.length-1];if(e.length<=this.stickyScrollMaxItemCount&&i.position+i.height<=t)return e;const s=this.stickyScrollDelegate.constrainStickyScrollNodes(e,this.stickyScrollMaxItemCount,t);if(!s.length)return[];const o=s[s.length-1];if(s.length>this.stickyScrollMaxItemCount||o.position+o.height>t)throw new Error("stickyScrollDelegate violates constraints");return s}getParentNode(e){const t=this.model.getNodeLocation(e),i=this.model.getParentNodeLocation(t);return i?this.model.getNode(i):void 0}nodeIsUncollapsedParent(e){const t=this.model.getNodeLocation(e);return this.model.getListRenderCount(t)>1}getNodeIndex(e){const t=this.model.getNodeLocation(e);return this.model.getListIndex(t)}getNodeRange(e){const t=this.model.getNodeLocation(e),i=this.model.getListIndex(t);if(i<0)throw new Error("Node not found in tree");const s=this.model.getListRenderCount(t),o=i+s-1;return{startIndex:i,endIndex:o}}nodePositionTopBelowWidget(e){const t=[];let i=this.getParentNode(e);for(;i;)t.push(i),i=this.getParentNode(i);let s=0;for(let o=0;o0,i=!!e&&e.count>0;if(!t&&!i||t&&i&&this._previousState.equal(e))return;if(t!==i&&this.setVisible(i),!i){this._previousState=void 0,this._previousElements=[],this._previousStateDisposables.clear();return}const s=e.stickyNodes[e.count-1];this._previousState&&e.animationStateChanged(this._previousState)?this._previousElements[this._previousState.count-1].style.top=`${s.position}px`:this.renderState(e),this._previousState=e,this._rootDomNode.style.height=`${s.position+s.height}px`}renderState(e){this._previousStateDisposables.clear();const t=Array(e.count);for(let i=e.count-1;i>=0;i--){const s=e.stickyNodes[i],{element:o,disposable:r}=this.createElement(s,i,e.count);t[i]=o,this._rootDomNode.appendChild(o),this._previousStateDisposables.add(r)}this.stickyScrollFocus.updateElements(t,e),this._previousElements=t}rerender(){this._previousState&&this.renderState(this._previousState)}createElement(e,t,i){const s=e.startIndex,o=document.createElement("div");o.style.top=`${e.position}px`,this.tree.options.setRowHeight!==!1&&(o.style.height=`${e.height}px`),this.tree.options.setRowLineHeight!==!1&&(o.style.lineHeight=`${e.height}px`),o.classList.add("monaco-tree-sticky-row"),o.classList.add("monaco-list-row"),o.setAttribute("data-index",`${s}`),o.setAttribute("data-parity",s%2===0?"even":"odd"),o.setAttribute("id",this.view.getElementID(s));const r=this.setAccessibilityAttributes(o,e.node.element,t,i),a=this.treeDelegate.getTemplateId(e.node),l=this.treeRenderers.find(u=>u.templateId===a);if(!l)throw new Error(`No renderer found for template id ${a}`);let c=e.node;c===this.tree.getNode(this.tree.getNodeLocation(e.node))&&(c=new Proxy(e.node,{}));const d=l.renderTemplate(o);l.renderElement(c,e.startIndex,d,{height:e.height});const h=Re(()=>{r.dispose(),l.disposeElement(c,e.startIndex,d,{height:e.height}),l.disposeTemplate(d),o.remove()});return{element:o,disposable:h}}setAccessibilityAttributes(e,t,i,s){if(!this.accessibilityProvider)return G.None;this.accessibilityProvider.getSetSize&&e.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(t,i,s))),this.accessibilityProvider.getPosInSet&&e.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(t,i))),this.accessibilityProvider.getRole&&e.setAttribute("role",this.accessibilityProvider.getRole(t)??"treeitem");const o=this.accessibilityProvider.getAriaLabel(t),r=o&&typeof o!="string"?o:wi(o),a=qe(c=>{const d=c.readObservable(r);d?e.setAttribute("aria-label",d):e.removeAttribute("aria-label")});typeof o=="string"||o&&e.setAttribute("aria-label",o.get());const l=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(t);return typeof l=="number"&&e.setAttribute("aria-level",`${l}`),e.setAttribute("aria-selected",String(!1)),a}setVisible(e){this._rootDomNode.classList.toggle("empty",!e),e||this.stickyScrollFocus.updateElements([],void 0)}domFocus(){this.stickyScrollFocus.domFocus()}focusedLast(){return this.stickyScrollFocus.focusedLast()}dispose(){this.stickyScrollFocus.dispose(),this._previousStateDisposables.dispose(),this._rootDomNode.remove()}};class MGe extends G{get domHasFocus(){return this._domHasFocus}set domHasFocus(e){e!==this._domHasFocus&&(this._onDidChangeHasFocus.fire(e),this._domHasFocus=e)}constructor(e,t){super(),this.container=e,this.view=t,this.focusedIndex=-1,this.elements=[],this._onDidChangeHasFocus=new q,this.onDidChangeHasFocus=this._onDidChangeHasFocus.event,this._onContextMenu=new q,this.onContextMenu=this._onContextMenu.event,this._domHasFocus=!1,this._register(J(this.container,"focus",()=>this.onFocus())),this._register(J(this.container,"blur",()=>this.onBlur())),this._register(this.view.onDidFocus(()=>this.toggleStickyScrollFocused(!1))),this._register(this.view.onKeyDown(i=>this.onKeyDown(i))),this._register(this.view.onMouseDown(i=>this.onMouseDown(i))),this._register(this.view.onContextMenu(i=>this.handleContextMenu(i)))}handleContextMenu(e){const t=e.browserEvent.target;if(!XE(t)&&!Ok(t)){this.focusedLast()&&this.view.domFocus();return}if(!kf(e.browserEvent)){if(!this.state)throw new Error("Context menu should not be triggered when state is undefined");const r=this.state.stickyNodes.findIndex(a=>{var l;return a.node.element===((l=e.element)==null?void 0:l.element)});if(r===-1)throw new Error("Context menu should not be triggered when element is not in sticky scroll widget");this.container.focus(),this.setFocus(r);return}if(!this.state||this.focusedIndex<0)throw new Error("Context menu key should not be triggered when focus is not in sticky scroll widget");const s=this.state.stickyNodes[this.focusedIndex].node.element,o=this.elements[this.focusedIndex];this._onContextMenu.fire({element:s,anchor:o,browserEvent:e.browserEvent,isStickyScroll:!0})}onKeyDown(e){if(this.domHasFocus&&this.state){if(e.key==="ArrowUp")this.setFocusedElement(Math.max(0,this.focusedIndex-1)),e.preventDefault(),e.stopPropagation();else if(e.key==="ArrowDown"||e.key==="ArrowRight"){if(this.focusedIndex>=this.state.count-1){const t=this.state.stickyNodes[this.state.count-1].startIndex+1;this.view.domFocus(),this.view.setFocus([t]),this.scrollNodeUnderWidget(t,this.state)}else this.setFocusedElement(this.focusedIndex+1);e.preventDefault(),e.stopPropagation()}}}onMouseDown(e){const t=e.browserEvent.target;!XE(t)&&!Ok(t)||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation())}updateElements(e,t){if(t&&t.count===0)throw new Error("Sticky scroll state must be undefined when there are no sticky nodes");if(t&&t.count!==e.length)throw new Error("Sticky scroll focus received illigel state");const i=this.focusedIndex;if(this.removeFocus(),this.elements=e,this.state=t,t){const s=lr(i,0,t.count-1);this.setFocus(s)}else this.domHasFocus&&this.view.domFocus();this.container.tabIndex=t?0:-1}setFocusedElement(e){const t=this.state;if(!t)throw new Error("Cannot set focus when state is undefined");if(this.setFocus(e),!(e1?t.stickyNodes[t.count-2]:void 0,o=this.view.getElementTop(e),r=s?s.position+s.height+i.height:i.height;this.view.scrollTop=o-r}domFocus(){if(!this.state)throw new Error("Cannot focus when state is undefined");this.container.focus()}focusedLast(){return this.state?this.view.getHTMLElement().classList.contains("sticky-scroll-focused"):!1}removeFocus(){this.focusedIndex!==-1&&(this.toggleElementFocus(this.elements[this.focusedIndex],!1),this.focusedIndex=-1)}setFocus(e){if(0>e)throw new Error("addFocus() can not remove focus");if(!this.state&&e>=0)throw new Error("Cannot set focus index when state is undefined");if(this.state&&e>=this.state.count)throw new Error("Cannot set focus index to an index that does not exist");const t=this.focusedIndex;t>=0&&this.toggleElementFocus(this.elements[t],!1),e>=0&&this.toggleElementFocus(this.elements[e],!0),this.focusedIndex=e}toggleElementFocus(e,t){this.toggleElementActiveFocus(e,t&&this.domHasFocus),this.toggleElementPassiveFocus(e,t)}toggleCurrentElementActiveFocus(e){this.focusedIndex!==-1&&this.toggleElementActiveFocus(this.elements[this.focusedIndex],e)}toggleElementActiveFocus(e,t){e.classList.toggle("focused",t)}toggleElementPassiveFocus(e,t){e.classList.toggle("passive-focused",t)}toggleStickyScrollFocused(e){this.view.getHTMLElement().classList.toggle("sticky-scroll-focused",e)}onFocus(){if(!this.state||this.elements.length===0)throw new Error("Cannot focus when state is undefined or elements are empty");this.domHasFocus=!0,this.toggleStickyScrollFocused(!0),this.toggleCurrentElementActiveFocus(!0),this.focusedIndex===-1&&this.setFocus(0)}onBlur(){this.domHasFocus=!1,this.toggleCurrentElementActiveFocus(!1)}dispose(){this.toggleStickyScrollFocused(!1),this._onDidChangeHasFocus.fire(!1),super.dispose()}}function x2(n){let e=uv.Unknown;return y7(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=uv.Twistie:y7(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=uv.Element:y7(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=uv.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function AGe(n){const e=XE(n.browserEvent.target);return{element:n.element?n.element.element:null,browserEvent:n.browserEvent,anchor:n.anchor,isStickyScroll:e}}function KR(n,e){e(n),n.children.forEach(t=>KR(t,e))}class A9{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new q,this.onDidChange=this._onDidChange.event}set(e,t){const i=t;!(i!=null&&i.__forceEvent)&&Fi(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>KR(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>KR(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>KR(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const h=o.get(c);h&&h.visible&&a.push(h)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class PGe extends Jbe{constructor(e,t,i){super(e),this.tree=t,this.stickyScrollProvider=i}onViewPointer(e){if(Ybe(e.browserEvent.target)||qd(e.browserEvent.target)||PL(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16,o=Ok(e.browserEvent.target);let r=!1;if(o?r=!0:typeof this.tree.expandOnlyOnTwistieClick=="function"?r=this.tree.expandOnlyOnTwistieClick(t.element):r=!!this.tree.expandOnlyOnTwistieClick,o)this.handleStickyScrollMouseEvent(e,t);else{if(r&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e)}if(t.collapsible&&(!o||s)){const a=this.tree.getNodeLocation(t),l=e.browserEvent.altKey;if(this.tree.setFocus([a]),this.tree.toggleCollapsed(a,l),s){e.browserEvent.isHandledByList=!0;return}}o||super.onViewPointer(e)}handleStickyScrollMouseEvent(e,t){if(Zqe(e.browserEvent.target)||Xqe(e.browserEvent.target))return;const i=this.stickyScrollProvider();if(!i)throw new Error("Sticky scroll controller not found");const s=this.list.indexOf(t),o=this.list.getElementTop(s),r=i.nodePositionTopBelowWidget(t);this.tree.scrollTop=o-r,this.list.domFocus(),this.list.setFocus([s]),this.list.setSelection([s])}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}onMouseDown(e){const t=e.browserEvent.target;if(!XE(t)&&!Ok(t)){super.onMouseDown(e);return}}onContextMenu(e){const t=e.browserEvent.target;if(!XE(t)&&!Ok(t)){super.onContextMenu(e);return}}}class OGe extends pl{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new PGe(this,e.tree,e.stickyScrollProvider)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(bg([...super.getFocus(),...s])),o.length>0&&super.setSelection(bg([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class Sve{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ve.filter(ve.map(this.view.onMouseDblClick,x2),e=>e.target!==uv.Filter)}get onMouseOver(){return ve.map(this.view.onMouseOver,x2)}get onMouseOut(){return ve.map(this.view.onMouseOut,x2)}get onContextMenu(){var e;return ve.any(ve.filter(ve.map(this.view.onContextMenu,AGe),t=>!t.isStickyScroll),((e=this.stickyScrollController)==null?void 0:e.onContextMenu)??ve.None)}get onPointer(){return ve.map(this.view.onPointer,x2)}get onKeyDown(){return this.view.onKeyDown}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ve.any(this.onDidChangeModelRelay.event,this.onDidSwapModel.event)}get onDidChangeCollapseState(){return this.onDidChangeCollapseStateRelay.event}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){this._user=e,this._options=o,this.eventBufferer=new oD,this.onDidChangeFindOpenState=ve.None,this.onDidChangeStickyScrollFocused=ve.None,this.disposables=new ne,this.onDidSwapModel=this.disposables.add(new q),this.onDidChangeModelRelay=this.disposables.add(new Bx),this.onDidSpliceModelRelay=this.disposables.add(new Bx),this.onDidChangeCollapseStateRelay=this.disposables.add(new Bx),this.onDidChangeRenderNodeCountRelay=this.disposables.add(new Bx),this.onDidChangeActiveNodesRelay=this.disposables.add(new Bx),this._onWillRefilter=new q,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new q,this.modelDisposables=new ne,o.keyboardNavigationLabelProvider&&(o.findWidgetEnabled??!0)&&(this.findFilter=new wve(o.keyboardNavigationLabelProvider,o.filter,o.defaultFindVisibility),o={...o,filter:this.findFilter},this.disposables.add(this.findFilter)),this.model=this.createModel(e,o),this.treeDelegate=new OZ(i);const r=this.disposables.add(new LGe(this.onDidChangeActiveNodesRelay.event)),a=new hpe;this.renderers=s.map(l=>new Jz(l,this.model,this.onDidChangeCollapseStateRelay.event,r,a,o));for(const l of this.renderers)this.disposables.add(l);if(this.focus=new A9(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new A9(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new A9(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new OGe(e,t,this.treeDelegate,this.renderers,this.focus,this.selection,this.anchor,{...xGe(()=>this.model,this.disposables,o),tree:this,stickyScrollProvider:()=>this.stickyScrollController}),this.setupModel(this.model),o.keyboardSupport!==!1){const l=ve.chain(this.view.onKeyDown,c=>c.filter(d=>!qd(d.target)).map(d=>new ui(d)));ve.chain(l,c=>c.filter(d=>d.keyCode===15))(this.onLeftArrow,this,this.disposables),ve.chain(l,c=>c.filter(d=>d.keyCode===17))(this.onRightArrow,this,this.disposables),ve.chain(l,c=>c.filter(d=>d.keyCode===10))(this.onSpace,this,this.disposables)}if((o.findWidgetEnabled??!0)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const l={styles:o.findWidgetStyles,defaultFindMode:o.defaultFindMode,defaultFindMatchType:o.defaultFindMatchType,showNotFoundMessage:o.showNotFoundMessage};this.findController=this.disposables.add(new Cve(this,this.findFilter,o.contextViewProvider,l)),this.focusNavigationFilter=c=>this.findController.shouldAllowFocus(c),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=ve.None,this.onDidChangeFindMatchType=ve.None;o.enableStickyScroll&&(this.stickyScrollController=new tre(this,this.model,this.view,this.renderers,this.treeDelegate,o),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus),this.styleElement=sc(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===hw.Always)}updateOptions(e={}){var t;this._options={...this._options,...e};for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)==null||t.updateOptions(e),this.updateStickyScroll(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===hw.Always)}get options(){return this._options}updateStickyScroll(e){var t;!this.stickyScrollController&&this._options.enableStickyScroll?(this.stickyScrollController=new tre(this,this.model,this.view,this.renderers,this.treeDelegate,this._options),this.onDidChangeStickyScrollFocused=this.stickyScrollController.onDidChangeHasFocus):this.stickyScrollController&&!this._options.enableStickyScroll&&(this.onDidChangeStickyScrollFocused=ve.None,this.stickyScrollController.dispose(),this.stickyScrollController=void 0),(t=this.stickyScrollController)==null||t.updateOptions(e)}getHTMLElement(){return this.view.getHTMLElement()}get onDidChangeContentHeight(){return this.view.onDidChangeContentHeight}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get ariaLabel(){return this.view.ariaLabel}set ariaLabel(e){this.view.ariaLabel=e}domFocus(){var e;(e=this.stickyScrollController)!=null&&e.focusedLast()?this.stickyScrollController.domFocus():this.view.domFocus()}layout(e,t){this.view.layout(e,t)}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { opacity: 1; border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { opacity: 1; border-color: ${e.treeIndentGuidesStroke}; }`));const s=e.treeStickyScrollBackground??e.listBackground;s&&(i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${s}; }`),i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${s}; }`)),e.treeStickyScrollBorder&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${e.treeStickyScrollBorder}; }`),e.treeStickyScrollShadow&&i.push(`.monaco-list${t} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${e.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`),e.listFocusForeground&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { color: inherit; }`));const o=dg(e.listFocusAndSelectionOutline,dg(e.listSelectionOutline,e.listFocusOutline??""));o&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused.selected { outline: inherit;}`)),e.listFocusOutline&&(i.push(`.monaco-list${t}.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.monaco-list${t}:not(.sticky-scroll-focused) .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-scrollable-element .monaco-tree-sticky-container .monaco-list-row.passive-focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused.sticky-scroll-focused .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`),i.push(`.context-menu-visible .monaco-list${t}.last-focused:not(.sticky-scroll-focused) .monaco-tree-sticky-container .monaco-list-rows .monaco-list-row.focused { outline: inherit; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)})}getSelection(){return this.selection.get()}setFocus(e,t){this.eventBufferer.bufferEvents(()=>{const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)})}focusNext(e=1,t=!1,i,s=kf(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusNext(e,t,i,s)}focusPrevious(e=1,t=!1,i,s=kf(i)&&i.altKey?void 0:this.focusNavigationFilter){this.view.focusPrevious(e,t,i,s)}focusNextPage(e,t=kf(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusNextPage(e,t)}focusPreviousPage(e,t=kf(e)&&e.altKey?void 0:this.focusNavigationFilter){return this.view.focusPreviousPage(e,t,()=>{var i;return((i=this.stickyScrollController)==null?void 0:i.height)??0})}focusLast(e,t=kf(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusLast(e,t)}focusFirst(e,t=kf(e)&&e.altKey?void 0:this.focusNavigationFilter){this.view.focusFirst(e,t)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);if(i!==-1)if(!this.stickyScrollController)this.view.reveal(i,t);else{const s=this.stickyScrollController.nodePositionTopBelowWidget(this.getNode(e));this.view.reveal(i,t,s)}}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}setupModel(e){this.modelDisposables.clear(),this.modelDisposables.add(e.onDidSpliceRenderedNodes(({start:o,deleteCount:r,elements:a})=>this.view.splice(o,r,a)));const t=ve.forEach(e.onDidSpliceModel,o=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(o),this.selection.onDidModelSplice(o)})},this.modelDisposables);t(()=>null,null,this.modelDisposables);const i=this.modelDisposables.add(new q),s=this.modelDisposables.add(new ec(0));this.modelDisposables.add(ve.any(t,this.focus.onDidChange,this.selection.onDidChange)(()=>{s.trigger(()=>{const o=new Set;for(const r of this.focus.getNodes())o.add(r);for(const r of this.selection.getNodes())o.add(r);i.fire([...o.values()])})})),this.onDidChangeActiveNodesRelay.input=i.event,this.onDidChangeModelRelay.input=ve.signal(e.onDidSpliceModel),this.onDidChangeCollapseStateRelay.input=e.onDidChangeCollapseState,this.onDidChangeRenderNodeCountRelay.input=e.onDidChangeRenderNodeCount,this.onDidSpliceModelRelay.input=e.onDidSpliceModel}dispose(){var e;ei(this.disposables),(e=this.stickyScrollController)==null||e.dispose(),this.view.dispose(),this.modelDisposables.dispose()}}const ire=new ro(()=>{const n=Aw.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});new ro(()=>({collator:Aw.Collator(void 0,{numeric:!0}).value}));new ro(()=>({collator:Aw.Collator(void 0,{numeric:!0,sensitivity:"accent"}).value}));function FGe(n,e,t=!1){const i=n||"",s=e||"",o=ire.value.collator.compare(i,s);return ire.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}class HGe{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:G.None}}renderElement(e,t,i,s){var l;if((l=i.disposable)==null||l.dispose(),!i.data)return;const o=this.modelProvider();if(o.isResolved(e))return this.renderer.renderElement(o.get(e),e,i.data,s);const r=new Bi,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class VGe{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function zGe(n,e){return{...e,accessibilityProvider:e.accessibilityProvider&&new VGe(n,e.accessibilityProvider)}}class jGe{constructor(e,t,i,s,o={}){this.modelDisposables=new ne;const r=()=>this.model,a=s.map(l=>new HGe(l,r));this.list=new pl(e,t,i,a,zGe(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ve.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return ve.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return ve.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this.modelDisposables.clear(),this._model=e,this.list.splice(0,this.list.length,ar(e.length)),this.modelDisposables.add(e.onDidIncrementLength(t=>this.list.splice(this.list.length,0,ar(this.list.length,t))))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose(),this.modelDisposables.dispose()}}var dx=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const $Ge=!1;var EP;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(EP||(EP={}));let UGe=4;const qGe=new q;let KGe=300;const GGe=new q;class FZ{constructor(e){this.el=e,this.disposables=new ne}get onPointerMove(){return this.disposables.add(new ti(Pe(this.el),"mousemove")).event}get onPointerUp(){return this.disposables.add(new ti(Pe(this.el),"mouseup")).event}dispose(){this.disposables.dispose()}}dx([wn],FZ.prototype,"onPointerMove",null);dx([wn],FZ.prototype,"onPointerUp",null);class BZ{get onPointerMove(){return this.disposables.add(new ti(this.el,xi.Change)).event}get onPointerUp(){return this.disposables.add(new ti(this.el,xi.End)).event}constructor(e){this.el=e,this.disposables=new ne}dispose(){this.disposables.dispose()}}dx([wn],BZ.prototype,"onPointerMove",null);dx([wn],BZ.prototype,"onPointerUp",null);class NP{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}dx([wn],NP.prototype,"onPointerMove",null);dx([wn],NP.prototype,"onPointerUp",null);const nre="pointer-events-disabled";class _o extends G{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}get onDidStart(){return this._onDidStart.event}get onDidChange(){return this._onDidChange.event}get onDidReset(){return this._onDidReset.event}get onDidEnd(){return this._onDidEnd.event}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=he(this.el,me(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Re(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(J(this._orthogonalStartDragHandle,"mouseenter",()=>_o.onMouseEnter(e))),this.orthogonalStartDragHandleDisposables.add(J(this._orthogonalStartDragHandle,"mouseleave",()=>_o.onMouseLeave(e))))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=he(this.el,me(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Re(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(J(this._orthogonalEndDragHandle,"mouseenter",()=>_o.onMouseEnter(e))),this.orthogonalEndDragHandleDisposables.add(J(this._orthogonalEndDragHandle,"mouseleave",()=>_o.onMouseLeave(e))))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=KGe,this.hoverDelayer=this._register(new ec(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new q),this._onDidStart=this._register(new q),this._onDidChange=this._register(new q),this._onDidReset=this._register(new q),this._onDidEnd=this._register(new q),this.orthogonalStartSashDisposables=this._register(new ne),this.orthogonalStartDragHandleDisposables=this._register(new ne),this.orthogonalEndSashDisposables=this._register(new ne),this.orthogonalEndDragHandleDisposables=this._register(new ne),this.linkedSash=void 0,this.el=he(e,me(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),yt&&this.el.classList.add("mac"),this._register(J(this.el,"mousedown",o=>this.onPointerStart(o,new FZ(e)))),this._register(J(this.el,"dblclick",o=>this.onPointerDoublePress(o))),this._register(J(this.el,"mouseenter",()=>_o.onMouseEnter(this))),this._register(J(this.el,"mouseleave",()=>_o.onMouseLeave(this))),this._register(Eo.addTarget(this.el)),this._register(J(this.el,xi.Start,o=>this.onPointerStart(o,new BZ(this.el))));let s;this._register(J(this.el,xi.Tap,o=>{if(s){clearTimeout(s),s=void 0,this.onPointerDoublePress(o);return}clearTimeout(s),s=setTimeout(()=>s=void 0,250)})),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=UGe,this._register(qGe.event(o=>{this.size=o,this.layout()}))),this._register(GGe.event(o=>this.hoverDelay=o)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",$Ge),this.layout()}onPointerStart(e,t){Ht.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new NP(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new NP(t))),!this.state)return;const s=this.el.ownerDocument.getElementsByTagName("iframe");for(const g of s)g.classList.add(nre);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=sc(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=yt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=yt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},h=new ne;d(),i||this.onDidEnablementChange.event(d,null,h);const u=g=>{Ht.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{Ht.stop(g,!1),c.remove(),this.el.classList.remove("active"),this._onDidEnd.fire(),h.dispose();for(const p of s)p.classList.remove(nre)};t.onPointerMove(u,null,h),t.onPointerUp(f,null,h),h.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&_o.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&_o.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){_o.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){const t=e.initialTarget??e.target;if(!(!t||!hn(t))&&t.classList.contains("orthogonal-drag-handle"))return t.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const YGe={separatorBorder:se.transparent};class xve{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;if(e!==this.visible){e?(this.size=lr(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e);try{(s=(i=this.view).setVisible)==null||s.call(i,e)}catch(o){console.error("Splitview: Failed to set visible view"),console.error(o)}}}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){return this.view.proportionalLayout??!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e);try{this.view.layout(this.size,e,t)}catch(i){console.error("Splitview: Failed to layout view"),console.error(i)}}dispose(){this.disposable.dispose()}}class ZGe extends xve{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class XGe extends xve{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var pf;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(pf||(pf={}));var DP;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(DP||(DP={}));class Lve extends G{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){super(),this.size=0,this._contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=pf.Idle,this._onDidSashChange=this._register(new q),this._onDidSashReset=this._register(new q),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=t.orientation??0,this.inverseAltBehavior=t.inverseAltBehavior??!1,this.proportionalLayout=t.proportionalLayout??!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=he(this.el,me(".sash-container")),this.viewContainer=me(".split-view-container"),this.scrollable=this._register(new sx({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:s=>Kr(Pe(this.el),s)})),this.scrollableElement=this._register(new m3(this.viewContainer,{vertical:this.orientation===0?t.scrollbarVisibility??1:2,horizontal:this.orientation===1?t.scrollbarVisibility??1:2},this.scrollable));const i=this._register(new ti(this.viewContainer,"scroll")).event;this._register(i(s=>{const o=this.scrollableElement.getScrollPosition(),r=Math.abs(this.viewContainer.scrollLeft-o.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,a=Math.abs(this.viewContainer.scrollTop-o.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(r!==void 0||a!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:r,scrollTop:a})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(s=>{s.scrollTopChanged&&(this.viewContainer.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this.viewContainer.scrollLeft=s.scrollLeft)})),he(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||YGe),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((s,o)=>{const r=Lo(s.visible)||s.visible?s.size:{type:"invisible",cachedVisibleSize:s.size},a=s.view;this.doAddView(a,r,o,!0)}),this._contentSize=this.viewItems.reduce((s,o)=>s+o.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;o0&&(r.size=lr(Math.round(a*e/s),r.minimumSize,r.maximumSize))}}else{const s=ar(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout&&e.visible?e.size/this._contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=Vc(J(this.el.ownerDocument.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),J(this.el.ownerDocument.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,h=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,h=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,h=(p.size-p.minimumSize)/2}let u,f;if(!l){const g=ar(s,-1),p=ar(s+1,this.viewItems.length),m=g.reduce((I,E)=>I+(this.viewItems[E].minimumSize-c[E]),0),b=g.reduce((I,E)=>I+(this.viewItems[E].viewMaximumSize-c[E]),0),v=p.length===0?Number.POSITIVE_INFINITY:p.reduce((I,E)=>I+(c[E]-this.viewItems[E].minimumSize),0),w=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((I,E)=>I+(c[E]-this.viewItems[E].viewMaximumSize),0),C=Math.max(m,w),S=Math.min(v,b),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const I=this.viewItems[L],E=Math.floor(I.viewMinimumSize/2);u={index:L,limitDelta:I.visible?C-E:C+E,size:I.size}}if(typeof x=="number"){const I=this.viewItems[x],E=Math.floor(I.viewMinimumSize/2);f={index:x,limitDelta:I.visible?S+E:S-E,size:I.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:h,alt:l,snapBefore:u,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,h=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const u=t===this.sashItems.length-1,f=this.viewItems.map(w=>w.size),g=u?t:t+1,p=this.viewItems[g],m=p.size-p.maximumSize,b=p.size-p.minimumSize,v=u?t-1:t+1;this.resize(v,-h,f,void 0,void 0,m,b)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=lr(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(!(e<0||e>=this.viewItems.length)){if(this.state!==pf.Idle)throw new Error("Cant modify splitview");this.state=pf.Busy;try{const i=ar(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=lr(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o)}finally{this.state=pf.Idle}}}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=lr(i,a.minimumSize,a.maximumSize);const s=ar(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==pf.Idle)throw new Error("Cant modify splitview");this.state=pf.Busy;try{const o=me(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(u=>this.onViewChange(d,u)),a=Re(()=>o.remove()),l=Vc(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new ZGe(o,e,c,l):new XGe(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const u={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new _o(this.sashContainer,{getHorizontalSashTop:I=>this.getSashPosition(I),getHorizontalSashWidth:this.getSashOrthogonalSize},{...u,orientation:1}):new _o(this.sashContainer,{getVerticalSashLeft:I=>this.getSashPosition(I),getVerticalSashHeight:this.getSashOrthogonalSize},{...u,orientation:0}),g=this.orientation===0?I=>({sash:f,start:I.startY,current:I.currentY,alt:I.altKey}):I=>({sash:f,start:I.startX,current:I.currentX,alt:I.altKey}),m=ve.map(f.onDidStart,g)(this.onSashStart,this),v=ve.map(f.onDidChange,g)(this.onSashChange,this),C=ve.map(f.onDidEnd,()=>this.sashItems.findIndex(I=>I.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const I=this.sashItems.findIndex(W=>W.sash===f),E=ar(I,-1),R=ar(I+1,this.viewItems.length),M=this.findFirstSnapIndex(E),A=this.findFirstSnapIndex(R);typeof M=="number"&&!this.viewItems[M].visible||typeof A=="number"&&!this.viewItems[A].visible||this._onDidSashReset.fire(I)}),L=Vc(m,v,C,S,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let h;typeof t!="number"&&t.type==="split"&&(h=[t.index]),s||this.relayout([i],h),!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}finally{this.state=pf.Idle}}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=ar(e,-1),h=ar(e+1,this.viewItems.length);if(o)for(const x of o)l7(d,x),l7(h,x);if(s)for(const x of s)TT(d,x),TT(h,x);const u=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=h.map(x=>this.viewItems[x]),p=h.map(x=>i[x]),m=d.reduce((x,I)=>x+(this.viewItems[I].minimumSize-i[I]),0),b=d.reduce((x,I)=>x+(this.viewItems[I].maximumSize-i[I]),0),v=h.length===0?Number.POSITIVE_INFINITY:h.reduce((x,I)=>x+(i[I]-this.viewItems[I].minimumSize),0),w=h.length===0?Number.NEGATIVE_INFINITY:h.reduce((x,I)=>x+(i[I]-this.viewItems[I].maximumSize),0),C=Math.max(m,w,r),S=Math.min(v,b,a);let L=!1;if(l){const x=this.viewItems[l.index],I=t>=l.limitDelta;L=I!==x.visible,x.setVisible(I,l.size)}if(!L&&c){const x=this.viewItems[c.index],I=ta+l.size,0);let i=this.size-t;const s=ar(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)l7(s,a);for(const a of o)TT(s,a);typeof e=="number"&&TT(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this._contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this._contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:v&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)==null||e.disposable.dispose(),ei(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}const X4=class X4{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=X4.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=he(e,me(".monaco-table-tr")),i=[],s=[];for(let r=0;rthis.disposables.add(new JGe(d,h))),l={size:a.reduce((d,h)=>d+h.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new Lve(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new TP(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new pl(e,this.domNode,QGe(i),[c],r)),ve.any(...a.map(d=>d.onDidLayout))(([d,h])=>c.layoutColumn(d,h),null,this.disposables),this.splitview.onDidSashReset(d=>{const h=s.reduce((f,g)=>f+g.weight,0),u=s[d].weight/h*this.cachedWidth;this.splitview.resizeView(d,u)},null,this.disposables),this.styleElement=sc(this.domNode),this.style(nKe)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};Q4.InstanceCount=0;let tj=Q4;class HZ{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new SGe(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare(i,s){return t.sorter.compare(i.element,s.element)}}),this.identityProvider=t.identityProvider}setChildren(e,t=Nt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=Nt.empty(),i){const s=new Set,o=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(s.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)==null||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(s.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.has(h)||this.nodesByIdentity.delete(h)}(d=i.onDidDeleteNode)==null||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=Nt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Nt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===ja.Collapsed||t.collapsed===ja.PreserveOrCollapsed?r=!0:t.collapsed===ja.Expanded||t.collapsed===ja.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===ja.PreserveOrCollapsed||t.collapsed===ja.PreserveOrExpanded?o=i.collapsed:t.collapsed===ja.Collapsed?o=!0:t.collapsed===ja.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),s=this.model.getNode(i);this._setChildren(i,this.resortChildren(s,t),{})}resortChildren(e,t,i=!0){let s=[...e.children];return(t||i)&&(s=s.sort(this.sorter.compare.bind(this.sorter))),Nt.map(s,o=>({element:o.element,collapsible:o.collapsible,collapsed:o.collapsed,children:this.resortChildren(o,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ya(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function KR(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Nt.map(Nt.from(n.children),KR),collapsible:n.collapsible,collapsed:n.collapsed}}function GR(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=Nt.consume(Nt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Nt.map(Nt.concat(s,i),GR),collapsible:n.collapsible,collapsed:n.collapsed}}function ij(n,e=0){let t;return eij(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function rre(n){return ij(n,0)}function Dve(n,e,t){return n.element===e?{...n,children:t}:{...n,children:Nt.map(Nt.from(n.children),i=>Dve(i,e,t))}}const iYe=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class nYe{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new HZ(e,t),this.enabled=typeof t.compressionEnabled>"u"?!0:t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=Nt.empty(),i){const s=i.diffIdentityProvider&&iYe(i.diffIdentityProvider);if(e===null){const g=Nt.map(t,this.enabled?GR:KR);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Ya(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=rre(r),d=Dve(c,e,t),h=(this.enabled?GR:KR)(d),u=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Bi(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||Nt.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?h:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=Nt.map(i,rre),o=Nt.map(s,e?GR:KR);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return t}}const sYe=n=>n[n.length-1];class VZ{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new VZ(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function oYe(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){const s=t.elements;for(let o=0;o({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidSpliceRenderedNodes(){return ve.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(s=>this.nodeMapper.map(s))}))}get onDidChangeCollapseState(){return ve.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ve.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||sYe;const i=s=>this.elementMapper(s.elements);this.nodeMapper=new OZ(s=>new VZ(i,s)),this.model=new nYe(e,oYe(i,t))}setChildren(e,t=Nt.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var aYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class zZ extends Eve{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=Nt.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new HZ(e,t)}}class Tve{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)==null||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)==null||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){var i,s;return((s=(i=this.renderer).renderTwistie)==null?void 0:s.call(i,e,t))??!1}}aYe([wn],Tve.prototype,"compressedTreeNodeProvider",null);class lYe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let s=0;si||s>=t-1&&tthis,a=new lYe(()=>this.model),l=s.map(c=>new Tve(r,a,c));super(e,t,i,l,{...cYe(r,o),stickyScrollDelegate:a})}setChildren(e,t=Nt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new rYe(e,t)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function P9(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function nj(n,e){return e.parent?e.parent===n?!0:nj(n,e.parent):!1}function dYe(n,e){return n===e||nj(n,e)||nj(e,n)}class jZ{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new jZ(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class hYe{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ue.asClassNameArray(de.treeItemLoading)),!0):(t.classList.remove(...Ue.asClassNameArray(de.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)==null||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function are(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function lre(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class uYe extends ND{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function O9(n){return n instanceof ND?new uYe(n):n}class fYe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,O9(e),t)}onDragOver(e,t,i,s,o,r=!0){return this.dnd.onDragOver(O9(e),t&&t.element,i,s,o)}drop(e,t,i,s,o){this.dnd.drop(O9(e),t&&t.element,i,s,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.dnd.dispose()}}class gYe extends xve{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);if(!this.isFindSessionActive||this.findMode===Za.Highlight||!this.findProvider.isVisible)return i;const s=TD(i)?i.visibility:i;return fw(s)===0?0:this.findProvider.isVisible(e)?i:0}}class pYe extends Lve{constructor(e,t,i,s,o){super(e,i,s,o),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(Re(async()=>{var r,a;this.activeSession&&await((a=(r=this.findProvider).endSession)==null?void 0:a.call(r))}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=this.activeFindMetadata.matchCount===0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){var i;if(!this.activeSession||!this.activeFindMetadata)return!0;const t=(i=e.element)==null?void 0:i.element;return t&&this.activeFindMetadata.isMatch(t)?!0:!jc.isDefault(e.filterData)}}function Mve(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new fYe(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!((t=n.accessibilityProvider)!=null&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element),stickyScrollDelegate:n.stickyScrollDelegate}}function sj(n,e){e(n),n.children.forEach(t=>sj(t,e))}class Ave{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ve.map(this.tree.onDidChangeFocus,are)}get onDidChangeSelection(){return ve.map(this.tree.onDidChangeSelection,are)}get onMouseDblClick(){return ve.map(this.tree.onMouseDblClick,lre)}get onPointer(){return ve.map(this.tree.onPointer,lre)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new q,this._onDidChangeNodeSlowState=new q,this.nodeMapper=new OZ(c=>new jZ(c)),this.disposables=new ne,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=c=>r.collapseByDefault?r.collapseByDefault(c)?ja.PreserveOrCollapsed:ja.PreserveOrExpanded:void 0;let a=!1,l;if(r.findProvider&&(r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider&&(a=!0,l=new gYe(r.findProvider,r.keyboardNavigationLabelProvider,r.filter)),this.tree=this.createTree(e,t,i,s,{...r,findWidgetEnabled:!a,filter:l??r.filter}),this.root=P9({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const c={styles:r.findWidgetStyles,showNotFoundMessage:r.showNotFoundMessage,defaultFindMatchType:r.defaultFindMatchType,defaultFindMode:r.defaultFindMode};this.findController=this.disposables.add(new pYe(this.tree,r.findProvider,l,this.tree.options.contextViewProvider,c)),this.focusNavigationFilter=d=>this.findController.shouldFocusWhenNavigating(d),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,s,o){const r=new FZ(i),a=s.map(c=>new hYe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Mve(o)||{};return new zZ(e,t,r,a,l)}updateOptions(e={}){this.findController&&(e.defaultFindMode!==void 0&&(this.findController.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(t=>t.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(t=>t.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,s,o){if(typeof this.root.element>"u")throw new Ya(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ve.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Ya(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ve.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await i.refreshPromise,await ve.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await ve.toPromise(this._onDidRender.event)),s}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){var i;const t=this.nodes.get(e===this.root.element?null:e);if(!t){const s=(i=this.identityProvider)==null?void 0:i.getId(e).toString();throw new Ya(this.user,`Data tree node not found${s?`: ${s}`:""}`)}return t}async refreshAndRenderNode(e,t,i,s){this.disposables.isDisposed||(await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,s))}async refreshNode(e,t,i){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&dYe(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){const s=ss(async()=>{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await aI.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))});return e.refreshPromise=s,this.subTreeRefreshPromises.set(e,s),s.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),s}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Nt.empty());else{const o=this.doGetChildren(e);if(XB(o))s=Promise.resolve(o);else{const r=vu(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=await s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),fl(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return XB(i)?this.processChildren(i):(t=ss(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Je))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=P9({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&p.defaultCollapseState===ja.PreserveOrExpanded&&l.push(p),p}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=h,i?f.collapsed?(p.children.forEach(m=>sj(m,b=>this.nodes.delete(b.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):h&&!f.collapsed&&l.push(p),p}const g=P9({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return s&&s.viewState.focus&&s.viewState.focus.indexOf(u)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(u)>-1&&s.selection.push(g),(s&&s.viewState.expanded&&s.viewState.expanded.indexOf(u)>-1||h&&g.defaultCollapseState===ja.PreserveOrExpanded)&&l.push(g),g});for(const d of r.values())sj(d,h=>this.nodes.delete(h.element));for(const d of c)this.nodes.set(d.element,d);return GM(e.children,0,e.children.length,c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Nt.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class $Z{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new $Z(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class mYe{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Ue.asClassNameArray(de.treeItemLoading)),!0):(t.classList.remove(...Ue.asClassNameArray(de.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)==null||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)==null||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Jt(this.disposables)}}function _Ye(n){const e=n&&Mve(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}},stickyScrollDelegate:e.stickyScrollDelegate}}class bYe extends Ave{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new OZ(l=>new $Z(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new FZ(i),a=s.map(c=>new mYe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=_Ye(o)||{};return new Rve(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const s=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const m=this.tree.getCompressedTreeNode(p===this.root?null:p);if(m.element)for(const b of m.element.elements)g.add(s(b.element))}return g},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let h=!1;const u=f=>{const g=f.element;if(g)for(let p=0;p{const i=this.filter.filter(t,1),s=vYe(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function vYe(n){return typeof n=="boolean"?n?1:0:TD(n)?fw(n.visibility):fw(n)}class wYe extends Eve{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t){return new HZ(e,t)}}new Se("isMac",wt,_(1684,"Whether the operating system is macOS"));new Se("isLinux",jr,_(1685,"Whether the operating system is Linux"));const P3=new Se("isWindows",$s,_(1686,"Whether the operating system is Windows")),Pve=new Se("isWeb",Du,_(1687,"Whether the platform is a web browser"));new Se("isMacNative",wt&&!Du,_(1688,"Whether the operating system is macOS on a non-browser platform"));new Se("isIOS",nc,_(1689,"Whether the operating system is iOS"));new Se("isMobile",cge,_(1690,"Whether the platform is a mobile web browser"));new Se("isDevelopment",!1,!0);new Se("productQualityType","",_(1691,"Quality type of VS Code"));const Ove="inputFocus",UZ=new Se(Ove,!1,_(1692,"Whether keyboard focus is inside an input box"));var qg=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ri=function(n,e){return function(t,i){e(t,i,n)}};const mc=mt("listService");class CYe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new ne,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)==null||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)==null||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),H5(e.getHTMLElement())&&this.setLastFocusedList(e),Hc(e.onDidFocus(()=>this.setLastFocusedList(e)),Re(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const iN=new Se("listScrollAtBoundary","none");le.or(iN.isEqualTo("top"),iN.isEqualTo("both"));le.or(iN.isEqualTo("bottom"),iN.isEqualTo("both"));const Fve=new Se("listFocus",!0),Bve=new Se("treestickyScrollFocused",!1),O3=new Se("listSupportsMultiselect",!0),Wve=le.and(Fve,le.not(Ove),Bve.negate()),qZ=new Se("listHasSelectionOrFocus",!1),KZ=new Se("listDoubleSelection",!1),GZ=new Se("listMultiSelection",!1),F3=new Se("listSelectionNavigation",!1),yYe=new Se("listSupportsFind",!0),YZ=new Se("treeElementCanCollapse",!1),SYe=new Se("treeElementHasParent",!1),ZZ=new Se("treeElementCanExpand",!1),xYe=new Se("treeElementHasChild",!1),LYe=new Se("treeFindOpen",!1),Hve="listTypeNavigationMode",Vve="listAutomaticKeyboardNavigation";function B3(n,e){const t=n.createScoped(e.getHTMLElement());return Fve.bindTo(t),t}function W3(n,e){const t=iN.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const $w="workbench.list.multiSelectModifier",YR="workbench.list.openMode",Jl="workbench.list.horizontalScrolling",XZ="workbench.list.defaultFindMode",QZ="workbench.list.typeNavigationMode",RP="workbench.list.keyboardNavigation",th="workbench.list.scrollByPage",JZ="workbench.list.defaultFindMatchType",nN="workbench.tree.indent",MP="workbench.tree.renderIndentGuides",ih="workbench.list.smoothScrolling",xu="workbench.list.mouseWheelScrollSensitivity",Lu="workbench.list.fastScrollSensitivity",AP="workbench.tree.expandMode",PP="workbench.tree.enableStickyScroll",OP="workbench.tree.stickyScrollMaxItemCount";function ku(n){return n.getValue($w)==="alt"}class kYe extends G{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=ku(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration($w)&&(this.useAltAsMultipleSelectionModifier=ku(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:tve(e)}isSelectionRangeChangeEvent(e){return ive(e)}}function H3(n,e){const t=n.get(lt),i=n.get(Ht),s=new ne;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(ih),mouseWheelScrollSensitivity:t.getValue(xu),fastScrollSensitivity:t.getValue(Lu),multipleSelectionController:e.multipleSelectionController??s.add(new kYe(t)),keyboardNavigationEventFilter:NYe(i),scrollByPage:!!t.getValue(th)},s]}let cre=class extends pl{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Jl),[h,u]=c.invokeFunction(H3,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=B3(r,this),this.disposables.add(W3(this.contextKeyService,this)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=qZ.bindTo(this.contextKeyService),this.listDoubleSelection=KZ.bindTo(this.contextKeyService),this.listMultiSelection=GZ.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=ku(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration($w)&&(this._useAltAsMultipleSelectionModifier=ku(l));let p={};if(g.affectsConfiguration(Jl)&&this.horizontalScrolling===void 0){const m=!!l.getValue(Jl);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(th)){const m=!!l.getValue(th);p={...p,scrollByPage:m}}if(g.affectsConfiguration(ih)){const m=!!l.getValue(ih);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(xu)){const m=l.getValue(xu);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Lu)){const m=l.getValue(Lu);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new zve(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?zw(e):dx)}};cre=qg([Ri(5,Xe),Ri(6,mc),Ri(7,lt),Ri(8,Ae)],cre);let dre=class extends UGe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Jl),[h,u]=c.invokeFunction(H3,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new ne,this.disposables.add(u),this.contextKeyService=B3(r,this),this.disposables.add(W3(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=ku(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration($w)&&(this._useAltAsMultipleSelectionModifier=ku(l));let p={};if(g.affectsConfiguration(Jl)&&this.horizontalScrolling===void 0){const m=!!l.getValue(Jl);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(th)){const m=!!l.getValue(th);p={...p,scrollByPage:m}}if(g.affectsConfiguration(ih)){const m=!!l.getValue(ih);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(xu)){const m=l.getValue(xu);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(Lu)){const m=l.getValue(Lu);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new zve(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?zw(e):dx)}dispose(){this.disposables.dispose(),super.dispose()}};dre=qg([Ri(5,Xe),Ri(6,mc),Ri(7,lt),Ri(8,Ae)],dre);let hre=class extends tj{constructor(e,t,i,s,o,r,a,l,c,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Jl),[u,f]=d.invokeFunction(H3,r);super(e,t,i,s,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=B3(a,this),this.disposables.add(W3(this.contextKeyService,this)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=qZ.bindTo(this.contextKeyService),this.listDoubleSelection=KZ.bindTo(this.contextKeyService),this.listMultiSelection=GZ.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=ku(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration($w)&&(this._useAltAsMultipleSelectionModifier=ku(c));let m={};if(p.affectsConfiguration(Jl)&&this.horizontalScrolling===void 0){const b=!!c.getValue(Jl);m={...m,horizontalScrolling:b}}if(p.affectsConfiguration(th)){const b=!!c.getValue(th);m={...m,scrollByPage:b}}if(p.affectsConfiguration(ih)){const b=!!c.getValue(ih);m={...m,smoothScrolling:b}}if(p.affectsConfiguration(xu)){const b=c.getValue(xu);m={...m,mouseWheelScrollSensitivity:b}}if(p.affectsConfiguration(Lu)){const b=c.getValue(Lu);m={...m,fastScrollSensitivity:b}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new EYe(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?zw(e):dx)}dispose(){this.disposables.dispose(),super.dispose()}};hre=qg([Ri(6,Xe),Ri(7,mc),Ri(8,lt),Ri(9,Ae)],hre);class eX extends G{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new q),this.onDidOpen=this._onDidOpen.event,this._register(ve.filter(this.widget.onDidChangeSelection,i=>Lf(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(YR))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(YR)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(YR))!=="doubleClick")}))):this.openOnSingleClick=(t==null?void 0:t.openOnSingleClick)??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class zve extends eX{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class EYe extends eX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class IYe extends eX{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function NYe(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let FP=class extends zZ{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(RD,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new pw(this,o,h,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};FP=qg([Ri(5,Ae),Ri(6,Xe),Ri(7,mc),Ri(8,lt)],FP);let ure=class extends Rve{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(RD,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new pw(this,o,h,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};ure=qg([Ri(5,Ae),Ri(6,Xe),Ri(7,mc),Ri(8,lt)],ure);let fre=class extends wYe{constructor(e,t,i,s,o,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(RD,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new pw(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};fre=qg([Ri(6,Ae),Ri(7,Xe),Ri(8,mc),Ri(9,lt)],fre);let oj=class extends Ave{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(RD,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new pw(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};oj=qg([Ri(6,Ae),Ri(7,Xe),Ri(8,mc),Ri(9,lt)],oj);let gre=class extends bYe{constructor(e,t,i,s,o,r,a,l,c,d,h){const{options:u,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(RD,a);super(e,t,i,s,o,r,u),this.disposables.add(g),this.internals=new pw(this,a,f,a.overrideStyles,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};gre=qg([Ri(7,Ae),Ri(8,Xe),Ri(9,mc),Ri(10,lt)],gre);function jve(n){const e=n.getValue(XZ);if(e==="highlight")return Za.Highlight;if(e==="filter")return Za.Filter;const t=n.getValue(RP);if(t==="simple"||t==="highlight")return Za.Highlight;if(t==="filter")return Za.Filter}function $ve(n){const e=n.getValue(JZ);if(e==="fuzzy")return Pd.Fuzzy;if(e==="contiguous")return Pd.Contiguous}function RD(n,e){const t=n.get(lt),i=n.get(zg),s=n.get(Xe),o=n.get(Ae),r=()=>{const u=s.getContextKeyValue(Hve);if(u==="automatic")return Xh.Automatic;if(u==="trigger"||s.getContextKeyValue(Vve)===!1)return Xh.Trigger;const g=t.getValue(QZ);if(g==="automatic")return Xh.Automatic;if(g==="trigger")return Xh.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(Jl),[l,c]=o.invokeFunction(H3,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(MP);return{getTypeNavigationMode:r,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(nN)=="number"?t.getValue(nN):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(ih),defaultFindMode:e.defaultFindMode??jve(t),defaultFindMatchType:e.defaultFindMatchType??$ve(t),horizontalScrolling:a,scrollByPage:!!t.getValue(th),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(AP)==="doubleClick",contextViewProvider:i,findWidgetStyles:SKe,enableStickyScroll:!!t.getValue(PP),stickyScrollMaxItemCount:Number(t.getValue(OP))}}}let pw=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=B3(o,e),this.disposables.push(W3(this.contextKeyService,e)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=yYe.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=qZ.bindTo(this.contextKeyService),this.hasDoubleSelection=KZ.bindTo(this.contextKeyService),this.hasMultiSelection=GZ.bindTo(this.contextKeyService),this.treeElementCanCollapse=YZ.bindTo(this.contextKeyService),this.treeElementHasParent=SYe.bindTo(this.contextKeyService),this.treeElementCanExpand=ZZ.bindTo(this.contextKeyService),this.treeElementHasChild=xYe.bindTo(this.contextKeyService),this.treeFindOpen=LYe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=Bve.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=ku(a),this.updateStyleOverrides(s);const c=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(Hve),d.add(Vve),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration($w)&&(this._useAltAsMultipleSelectionModifier=ku(a)),h.affectsConfiguration(nN)){const f=a.getValue(nN);u={...u,indent:f}}if(h.affectsConfiguration(MP)&&t.renderIndentGuides===void 0){const f=a.getValue(MP);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(ih)){const f=!!a.getValue(ih);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(XZ)||h.affectsConfiguration(RP)){const f=jve(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(QZ)||h.affectsConfiguration(RP)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(JZ)){const f=$ve(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(Jl)&&t.horizontalScrolling===void 0){const f=!!a.getValue(Jl);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(th)){const f=!!a.getValue(th);u={...u,scrollByPage:f}}if(h.affectsConfiguration(AP)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(AP)==="doubleClick"}),h.affectsConfiguration(PP)){const f=a.getValue(PP);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(OP)){const f=Math.max(1,a.getValue(OP));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(xu)){const f=a.getValue(xu);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(Lu)){const f=a.getValue(Lu);u={...u,fastScrollSensitivity:f}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new IYe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?zw(e):dx)}dispose(){this.disposables=Jt(this.disposables)}};pw=qg([Ri(4,Xe),Ri(5,mc),Ri(6,lt)],pw);const DYe=Ji.as(ah.Configuration);DYe.registerConfiguration({id:"workbench",order:7,title:_(1705,"Workbench"),type:"object",properties:{[$w]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[_(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),_(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:_(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[YR]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Jl]:{type:"boolean",default:!1,description:_(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[th]:{type:"boolean",default:!1,description:_(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[nN]:{type:"number",default:8,minimum:4,maximum:40,description:_(1712,"Controls tree indentation in pixels.")},[MP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:_(1713,"Controls whether the tree should render indent guides.")},[ih]:{type:"boolean",default:!1,description:_(1714,"Controls whether lists and trees have smooth scrolling.")},[xu]:{type:"number",default:1,markdownDescription:_(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[Lu]:{type:"number",default:5,markdownDescription:_(1716,"Scrolling speed multiplier when pressing `Alt`.")},[XZ]:{type:"string",enum:["highlight","filter"],enumDescriptions:[_(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),_(1718,"Filter elements when searching.")],default:"highlight",description:_(1719,"Controls the default find mode for lists and trees in the workbench.")},[RP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[_(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),_(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),_(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:_(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:_(1724,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[JZ]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[_(1725,"Use fuzzy matching when searching."),_(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:_(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[AP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[PP]:{type:"boolean",default:!0,description:_(1729,"Controls whether sticky scrolling is enabled in trees.")},[OP]:{type:"number",minimum:1,default:7,markdownDescription:_(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[QZ]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:_(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var V3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rj=function(n,e){return function(t,i){e(t,i,n)}},aj;const Ih=me;class Uve{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new oo(()=>{const s=i.label??"",o=fv(s).text.trim(),r=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>_be(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class Xs extends Uve{constructor(e,t,i,s,o,r,a){var l,c,d;super(e,i,r),this.childIndex=t,this.fireButtonTriggered=s,this._onChecked=o,this.item=r,this._separator=a,this._checked=!1,this.onChecked=i?ve.map(ve.filter(this._onChecked.event,h=>h.element===this),h=>h.checked):ve.None,this._saneDetail=r.detail,this._labelHighlights=(l=r.highlights)==null?void 0:l.label,this._descriptionHighlights=(c=r.highlights)==null?void 0:c.description,this._detailHighlights=(d=r.highlights)==null?void 0:d.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var Vh;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(Vh||(Vh={}));class mb extends Uve{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=Vh.NONE}}class TYe{getHeight(e){return e instanceof mb?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Xs?BP.ID:WP.ID}}class RYe{getWidgetAriaLabel(){return _(1770,"Quick Input")}getAriaLabel(e){var t;return(t=e.separator)!=null&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Xs)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class qve{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new ne,t.toDisposeTemplate=new ne,t.entry=ue(e,Ih(".quick-input-list-entry"));const i=ue(t.entry,Ih("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new Kt),t.toDisposeTemplate.add(xn(i,_e.CLICK,c=>{if(t.checkbox.value&&!c.defaultPrevented&&t.checkbox.value.enabled){const d=!t.checkbox.value.checked;t.checkbox.value.checked=d,t.element.checked=d}}));const s=ue(i,Ih(".quick-input-list-rows")),o=ue(s,Ih(".quick-input-list-row")),r=ue(s,Ih(".quick-input-list-row"));t.label=new tN(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=V5(t.label.element,Ih(".quick-input-list-icon"));const a=ue(o,Ih(".quick-input-list-entry-keybinding"));t.keybinding=new hx(a,ha),t.toDisposeTemplate.add(t.keybinding);const l=ue(r,Ih(".quick-input-list-label-meta"));return t.detail=new tN(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=ue(t.entry,Ih(".quick-input-list-separator")),t.actionBar=new Vr(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var Uv;let BP=(Uv=class extends qve{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return aj.ID}ensureCheckbox(e,t){var s;if(!e.hasCheckbox){(s=t.checkbox.value)==null||s.domNode.remove(),t.checkbox.clear();return}let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new fve(e.saneLabel,e.checked,{...RZ,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(o=>i.checked=o)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){var u;const s=e.element;i.element=s,s.element=i.entry??void 0;const o=s.item;s.element.classList.toggle("not-pickable",s.item.pickable===!1),this.ensureCheckbox(s,i);const{labelHighlights:r,descriptionHighlights:a,detailHighlights:l}=s;if(o.iconPath){const f=Ng(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,g=He.revive(f);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=Su(g)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let c;!s.saneTooltip&&s.saneDescription&&(c={markdown:{value:Vc(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(o.keybinding),s.saneDetail){let f;s.saneTooltip||(f={markdown:{value:Vc(s.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:l,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";(u=s.separator)!=null&&u.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator&&s.childIndex!==0);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((f,g)=>wy(f,`id-${g}`,()=>s.fireButtonTriggered({button:f,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},aj=Uv,Uv.ID="quickpickitem",Uv);BP=aj=V3([rj(1,en)],BP);const J4=class J4 extends qve{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return J4.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const o=s.separator,{labelHighlights:r,descriptionHighlights:a}=s;i.icon.style.backgroundImage="",i.icon.className="";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:Vc(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const c={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,c),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=o.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>wy(h,`id-${u}`,()=>s.fireSeparatorButtonTriggered({button:h,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){var s;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(s=e.element.element)==null||s.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};J4.ID="quickpickseparator";let WP=J4,sN=class extends G{constructor(e,t,i,s,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new q,this._onLeave=new q,this.onLeave=this._onLeave.event,this._visibleCountObservable=Ze("VisibleCount",0),this.onChangedVisibleCount=ve.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Ze("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=ve.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Ze("CheckedCount",0),this.onChangedCheckedCount=ve.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=Lk({equalsFn:Bi},new Array),this.onChangedCheckedElements=ve.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new q,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new q,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new q,this._elementCheckedEventBufferer=new oD,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new ne),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=ue(this.parent,Ih(".quick-input-list")),this._separatorRenderer=new WP(t),this._itemRenderer=o.createInstance(BP,t),this._tree=this._register(o.createInstance(FP,"QuickInput",this._container,new TYe,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof mb?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return AYe(a,l,c)}},accessibilityProvider:new RYe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:gw.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return ve.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof Xs).map(t=>t.item),this._store)}get onDidChangeSelection(){return ve.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof Xs).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new ui(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(J(this._container,_e.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(J(this._container,_e.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new jge(typeof this.hoverDelegate.delay=="function"?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(hie(t.browserEvent.target)){e.cancel();return}if(!(!hie(t.browserEvent.relatedTarget)&&Cs(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof Xs&&this.showHover(t.element)})}catch(s){if(!fl(s))throw s}})),this._register(this._tree.onMouseOut(t=>{var i;Cs(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&Vh.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=Vh.ACTIVE_ITEM:i.focusInsideSeparator&=~Vh.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&Vh.MOUSE_HOVER)||(i.focusInsideSeparator|=Vh.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&Vh.MOUSE_HOVER)&&(i.focusInsideSeparator&=~Vh.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof Xs);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof mb&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&t.item.pickable!==!1&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,s,o)=>{let r;if(s.type==="separator"){if(!s.buttons)return i;t=new mb(o,a=>this._onSeparatorButtonTriggered.fire(a),s),r=t}else{const a=o>0?e[o-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(l=a);const c=new Xs(o,t!=null&&t.children?t.children.length:o,this._hasCheckboxes&&s.pickable!==!1,d=>this._onButtonTriggered.fire(d),this._elementChecked,s,l);if(this._itemElements.push(c),t)return t.children.push(c),i;r=c}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),s=i==null?void 0:i.parentNode;if(i&&s){const o=i.nextSibling;i.remove(),s.insertBefore(i,o)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){var t;if(this._itemElements.length)switch(e===Ni.Second&&this._itemElements.length<2&&(e=Ni.First),e){case Ni.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof Xs);break;case Ni.Second:{this._tree.scrollTop=0;let i=!1;this._tree.focusFirst(void 0,s=>s.element instanceof Xs?i?!0:(i=!i,!1):!1);break}case Ni.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,i=>i.element instanceof Xs);break;case Ni.Next:{const i=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,o=>o.element instanceof Xs?(this._tree.reveal(o.element),!0):!1);const s=this._tree.getFocus();i.length&&i[0]===s[0]&&this._onLeave.fire();break}case Ni.Previous:{const i=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,o=>{if(!(o.element instanceof Xs))return!1;const r=this._tree.getParentElement(o.element);return r===null||r.children[0]!==o.element?this._tree.reveal(o.element):this._tree.reveal(r),!0});const s=this._tree.getFocus();i.length&&i[0]===s[0]&&this._onLeave.fire();break}case Ni.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof Xs?(this._tree.reveal(i.element),!0):!1);break;case Ni.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof Xs))return!1;const s=this._tree.getParentElement(i.element);return s===null||s.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(s),!0});break;case Ni.NextSeparator:{let i=!1;const s=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(i)return!0;if(r.element instanceof mb)i=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof Xs){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});const o=this._tree.getFocus()[0];s===o&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,r=>r.element instanceof Xs));break}case Ni.PreviousSeparator:{let i,s=!!((t=this._tree.getFocus()[0])!=null&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,o=>{if(o.element instanceof mb)s?i||(this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element.children[0]):s=!0;else if(o.element instanceof Xs&&!i){if(o.element.separator)this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element;else if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const s=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=s&&s.type==="separator"&&!s.buttons?s:void 0)});else{let i;this._itemElements.forEach(s=>{let o;this.matchOnLabelMode==="fuzzy"?o=this.matchOnLabel?Tk(e,fv(s.saneLabel))??void 0:void 0:o=this.matchOnLabel?MYe(t,fv(s.saneLabel))??void 0:void 0;const r=this.matchOnDescription?Tk(e,fv(s.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?Tk(e,fv(s.saneDetail||""))??void 0:void 0;if(o||r||a?(s.labelHighlights=o,s.descriptionHighlights=r,s.detailHighlights=a,s.hidden=!1):(s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=s.item?!s.item.alwaysShow:!0),s.item?s.separator=void 0:s.separator&&(s.hidden=!0),!this.sortByLabel){const l=s.index&&this._inputElements[s.index-1]||void 0;(l==null?void 0:l.type)==="separator"&&!l.buttons&&(i=l),i&&!s.hidden&&(s.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof Xs),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof Xs))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new ne;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof Xs&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof mb?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(s=>({element:s,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){var t,i,s;this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.hoverDelegate).onDidHideHover)==null||i.call(t),(s=this._lastHover)==null||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};V3([wn],sN.prototype,"onDidChangeFocus",null);V3([wn],sN.prototype,"onDidChangeSelection",null);sN=V3([rj(4,Ae),rj(5,Us)],sN);function MYe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return pre(n,t);const s=rD(t," "),o=t.length-s.length,r=pre(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function pre(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function AYe(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:HGe(n.saneSortLabel,e.saneSortLabel,t)}function PYe(n,e={}){As.registerCommandAndKeybindingRule({weight:200,when:A3,metadata:{description:_(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...n,secondary:tX(n.primary,n.secondary??[],e)})}function Ar(n,e={}){As.registerCommandAndKeybindingRule({weight:200,when:le.and(le.or(le.equals(JI,"quickPick"),le.equals(JI,"quickTree")),A3),metadata:{description:_(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...n,secondary:tX(n.primary,n.secondary??[],e)})}const oN=wt?256:2048;function tX(n,e,t={}){return t.withAltMod&&e.push(512+n),t.withCtrlMod&&(e.push(oN+n),t.withAltMod&&e.push(512+oN+n)),t.withCmdMod&&wt&&(e.push(2048+n),t.withCtrlMod&&e.push(2304+n),t.withAltMod&&(e.push(2560+n),t.withCtrlMod&&e.push(2816+n))),e}function $a(n,e){return t=>{const i=t.get(Do).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Ar({id:"quickInput.pageNext",primary:12,handler:$a(Ni.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Ar({id:"quickInput.pagePrevious",primary:11,handler:$a(Ni.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Ar({id:"quickInput.first",primary:oN+14,handler:$a(Ni.First)},{withAltMod:!0,withCmdMod:!0});Ar({id:"quickInput.last",primary:oN+13,handler:$a(Ni.Last)},{withAltMod:!0,withCmdMod:!0});Ar({id:"quickInput.next",primary:18,handler:$a(Ni.Next)},{withCtrlMod:!0});Ar({id:"quickInput.previous",primary:16,handler:$a(Ni.Previous)},{withCtrlMod:!0});const mre=_(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),_re=_(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");wt?(Ar({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:$a(Ni.NextSeparator,Ni.Next),metadata:{description:mre}}),Ar({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:$a(Ni.NextSeparator)},{withCtrlMod:!0}),Ar({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:$a(Ni.PreviousSeparator,Ni.Previous),metadata:{description:_re}}),Ar({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:$a(Ni.PreviousSeparator)},{withCtrlMod:!0})):(Ar({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:$a(Ni.NextSeparator,Ni.Next),metadata:{description:mre}}),Ar({id:"quickInput.nextSeparator",primary:2578,handler:$a(Ni.NextSeparator)}),Ar({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:$a(Ni.PreviousSeparator,Ni.Previous),metadata:{description:_re}}),Ar({id:"quickInput.previousSeparator",primary:2576,handler:$a(Ni.PreviousSeparator)}));As.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:le.and(le.notEquals(JI,"quickWidget"),A3,le.not("isComposing")),metadata:{description:_(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:n=>{const e=n.get(Do).currentQuickInput;e==null||e.accept()},secondary:tX(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})});Ar({id:"quickInput.acceptInBackground",when:le.and(A3,le.equals(JI,"quickPick"),le.or(UZ.negate(),iGe)),primary:17,weight:250,handler:n=>{const e=n.get(Do).currentQuickInput;e==null||e.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});PYe({id:"quickInput.hide",primary:9,handler:n=>{const e=n.get(Do).currentQuickInput;e==null||e.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Ar({id:"quickInput.toggleHover",primary:oN|10,handler:n=>{n.get(Do).toggleHover()}});var OYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},FYe=function(n,e){return function(t,i){e(t,i,n)}},lj;const rL=me;var qv;let HP=(qv=class extends G{constructor(e,t,i,s){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=s,this.templateId=lj.ID}renderTemplate(e){const t=new ne,i=ue(e,rL(".quick-input-tree-entry")),s=t.add(new gve("",!1,{...RZ,size:15}));i.appendChild(s.domNode);const o=ue(i,rL("label.quick-input-tree-label")),r=ue(o,rL(".quick-input-tree-rows")),a=ue(r,rL(".quick-input-tree-row")),l=V5(a,rL(".quick-input-tree-icon")),c=t.add(new tN(a,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),d=t.add(new Vr(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return d.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:s,icon:l,label:c,actionBar:d,toDisposeElement:new ne}}renderElement(e,t,i,s){const o=i.toDisposeElement,r=e.element;if(r.pickable===!1?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=r.checked??!1,o.add(ve.filter(this.onCheckedEvent,h=>h.item===r)(h=>i.checkbox.checked=h.checked)),r.disabled&&i.checkbox.disable()),r.iconPath){const h=Ng(this._themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,u=He.revive(h);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=Su(u)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-tree-icon ${r.iconClass}`:"";const{labelHighlights:a,descriptionHighlights:l}=e.filterData||{};let c;r.description&&(c={markdown:{value:Vc(r.description),supportThemeIcons:!0},markdownNotSupportedFallback:r.description}),i.label.setLabel(r.label,r.description,{matches:a,descriptionMatches:l,extraClasses:r.iconClasses,italic:r.italic,strikethrough:r.strikethrough,labelEscapeNewLines:!0,descriptionTitle:c});const d=r.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>wy(h,`tree-${u}`,()=>this._buttonTriggeredEmitter.fire({item:r,button:h}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,s){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}},lj=qv,qv.ID="quickInputTreeElement",qv);HP=lj=OYe([FYe(3,en)],HP);class BYe{getHeight(e){return 22}getTemplateId(e){return HP.ID}}function WYe(n){var o;let e=!1,t=!1,i=!1;for(const r of n){switch((o=r.element)==null?void 0:o.checked){case"mixed":i=!0;break;case!0:e=!0;break;default:t=!0;break}if(e&&t&&i)break}return t?i||e?"mixed":!1:i?"mixed":e}class HYe{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return _(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(t=>_be(t)).filter(t=>!!t).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return e.checked==="mixed"?"mixed":!!e.checked},onDidChange:t=>ve.filter(this.onCheckedEvent,i=>i.item===e)(i=>t())}}}class VYe{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?Tk(this.filterValue,fv(e.label))??void 0:void 0,s=this.matchOnDescription?Tk(this.filterValue,fv(e.description||""))??void 0:void 0;return{visibility:t===1||i||s?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:s}}}}class zYe extends G{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.labelt.label)return 1;if(e.description&&t.description){if(e.descriptiont.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}}var jYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$Ye=function(n,e){return function(t,i){e(t,i,n)}};const UYe=me;let cj=class extends G{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new q),this._onDidChangeCheckboxState=this._register(new q),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new q),this._onLeave=new q,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new q),this.onDidAccept=this._onDidAccept.event,this._container=ue(e,UYe(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(HP,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(VYe),this._sorter=this._register(new zYe),this._tree=this._register(this.instantiationService.createInstance(FP,"QuickInputTree",this._container,new BYe,[this._renderer],{accessibilityProvider:new HYe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:gw.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){e.matchOnLabel!==void 0&&(this._filter.matchOnLabel=e.matchOnLabel),e.matchOnDescription!==void 0&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{const t=e.element;if(!t||t.disabled)return;if(t.pickable===!1){this._tree.setFocus([t]),this._onDidAccept.fire();return}const i=t.checked!==!0;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const s=new Set,o=[...this._tree.getNode(t).children];for(;o.length;){const a=o.shift();a!=null&&a.element&&!s.has(a.element)&&(s.add(a.element),(a.element.checked??!1)!==t.checked&&(a.element.checked=t.checked,this._tree.rerender(a.element)),o.push(...a.children))}let r=this._tree.getParentElement(t);for(;r;){const a=[...this._tree.getNode(r).children],l=WYe(a);(r.checked??!1)!==l&&(r.checked=l,this._tree.rerender(r)),r=this._tree.getParentElement(r)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const s=t.shift();!(s!=null&&s.element)||e.has(s.element)||s.element.checked&&(e.add(s.element),t.push(...s.children),s.element.children||i.push(s.element))}return i}};cj=jYe([$Ye(2,Ae)],cj);var Kve=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mv=function(n,e){return function(t,i){e(t,i,n)}},dj;const Ma=me,F9="workbench.quickInput.viewState";var Kv;let hj=(Kv=class extends G{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s,o){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=o,this.enabled=!0,this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this.onDidTriggerButtonEmitter=this._register(new q),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new q),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new q),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=XKe.bindTo(s),this.quickInputTypeContext=eGe.bindTo(s),this.endOfQuickInputBoxContext=tGe.bindTo(s),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(ve.runAndSubscribe(hD,({window:r,disposables:a})=>this.registerKeyModsListeners(r,a),{window:ri,disposables:this._store})),this._register($Oe(r=>{this.ui&&Oe(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[_e.KEY_DOWN,_e.KEY_UP,_e.MOUSE_DOWN])t.add(J(e,s,i,!0))}getUI(e){if(this.ui)return e&&Oe(this._container)!==Oe(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=ue(this._container,Ma(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=lc(t),s=ue(t,Ma(".quick-input-titlebar")),o=this._register(new Vr(s,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=ue(s,Ma(".quick-input-title")),a=this._register(new Vr(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=ue(t,Ma(".quick-input-header")),c=this._register(new gve(_(1763,"Toggle all checkboxes"),!1,{...RZ,size:15}));ue(l,c.domNode),this._register(c.onChange(()=>{const B=c.checked;A.setAllVisibleChecked(B===!0)})),this._register(J(c.domNode,_e.CLICK,B=>{(B.x||B.y)&&f.setFocus()}));const d=ue(l,Ma(".quick-input-description")),h=ue(l,Ma(".quick-input-and-message")),u=ue(h,Ma(".quick-input-filter")),f=this._register(new bGe(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ue(u,Ma(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=this._register(new Xz(g,{countFormat:_(1764,"{0} Results")},this.styles.countBadge)),m=ue(u,Ma(".quick-input-count"));m.setAttribute("aria-live","polite");const b=this._register(new Xz(m,{countFormat:_(1765,"{0} Selected")},this.styles.countBadge)),v=this._register(new Vr(l,{hoverDelegate:this.options.hoverDelegate}));v.domNode.classList.add("quick-input-inline-action-bar");const w=ue(l,Ma(".quick-input-action")),C=this._register(new EP(w,this.styles.button));C.label=_(1766,"OK"),this._register(C.onDidClick(B=>{this.onDidAcceptEmitter.fire()}));const S=ue(l,Ma(".quick-input-action")),L=this._register(new EP(S,{...this.styles.button,supportIcons:!0}));L.label=_(1767,"Custom"),this._register(L.onDidClick(B=>{this.onDidCustomEmitter.fire()}));const x=ue(h,Ma(`#${this.idPrefix}message.quick-input-message`)),E=this._register(new Qz(t,this.styles.progressBar));E.getContainer().classList.add("quick-input-progress");const I=ue(t,Ma(".quick-input-html-widget"));I.tabIndex=-1;const R=ue(t,Ma(".quick-input-description")),M=this.idPrefix+"list",A=this._register(this.instantiationService.createInstance(sN,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,M));f.setAttribute("aria-controls",M),this._register(A.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute("aria-activedescendant",A.getActiveDescendant()??"")})),this._register(A.onChangedAllVisibleChecked(B=>{c.checked=B})),this._register(A.onChangedVisibleCount(B=>{p.setCount(B)})),this._register(A.onChangedCheckedCount(B=>{sD(()=>b.setCount(B))})),this._register(A.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof Fk&&this.controller.canSelectMany&&A.clearFocus())},0)}));const W=this._register(this.instantiationService.createInstance(cj,t,this.options.hoverDelegate));this._register(W.tree.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute("aria-activedescendant",W.getActiveDescendant()??"")})),this._register(W.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),W.tree.setFocus([]))},0)})),this._register(W.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(W.tree.onDidChangeContentHeight(()=>this.updateLayout()));const P=oc(t);return this._register(P),this._register(J(t,_e.FOCUS,B=>{const V=this.getUI();if(Cs(B.relatedTarget,V.inputContainer)){const K=V.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==K&&this.endOfQuickInputBoxContext.set(K)}Cs(B.relatedTarget,V.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=hn(B.relatedTarget)?B.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(GI.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(B=>{const V=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==V&&this.endOfQuickInputBoxContext.set(V),f.removeAttribute("aria-activedescendant")})),this._register(J(t,_e.FOCUS,B=>{f.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(uj,this._container,t,[{node:s,includeChildren:!0},{node:l,includeChildren:!1}],this.viewState)),this._register(qe(B=>{var K;const V=(K=this.dndController)==null?void 0:K.dndViewState.read(B);V&&(V.top!==void 0&&V.left!==void 0?this.viewState={...this.viewState,top:V.top,left:V.left}:this.viewState=void 0,this.updateLayout(),V.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:s,title:r,description1:R,description2:d,widget:I,rightActionBar:a,inlineActionBar:v,checkAll:c,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:m,count:b,okContainer:w,ok:C,message:x,customButtonContainer:S,customButton:L,list:A,tree:W,progressBar:E,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:B=>this.show(B),hide:()=>this.hide(),setVisibilities:B=>this.setVisibilities(B),setEnabled:B=>this.setEnabled(B),setContextKey:B=>this.options.setContextKey(B),linkOpenerDelegate:B=>this.options.linkOpenerDelegate(B)},this.updateStyles(),this.ui}reparentUI(e){var t;this.ui&&(this._container=e,ue(this._container,this.ui.container),(t=this.dndController)==null||t.reparentUI(this._container))}pick(e,t={},i=vt.None){return new Promise((s,o)=>{let r=d=>{var h;r=s,(h=t.onKeyMods)==null||h.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),g=a.activeItems.filter(m=>m!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(d=>{var h;return(h=t.onDidTriggerSeparatorButton)==null?void 0:h.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Jt(c),r(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.prompt=t.prompt,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,t.sortByLabel!==void 0&&(a.sortByLabel=t.sortByLabel),a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{l=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&ws(t)?(e.severity=Yi.Error,e.validationMessage=t):t&&!ws(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Yi.Ignore,e.validationMessage=void 0)}input(e={},t=vt.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const s=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=ve.debounce(s.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",l=Promise.resolve(o(a));const c=[s,r(d=>{d!==a&&(l=Promise.resolve(o(d)),a=d),l.then(h=>{d===a&&this.setValidationOnInput(s,h)})}),s.onDidAccept(()=>{const d=s.value;d!==a&&(l=Promise.resolve(o(d)),a=d),l.then(h=>{!h||!ws(h)&&h.severity!==Yi.Error?(i(d),s.hide()):d===a&&this.setValidationOnInput(s,h)})}),t.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{Jt(c),i(void 0)})];s.title=e.title,s.value=e.value||"",s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.placeholder=e.placeHolder,s.password=!!e.password,s.ignoreFocusOut=!!e.ignoreFocusLost,s.show()})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new Fk(t)}createInputBox(){const e=this.getUI(!0);return new nGe(e)}show(e){var o;const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ys(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Yi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ys(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();Yz.tooltip=s?_(1768,"Back ({0})",s):_(1769,"Back"),t.container.style.display="",this.updateLayout(),(o=this.dndController)==null||o.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){var o;const t=this.controller;if(!t)return;t.willHide(e);const i=(o=this.ui)==null?void 0:o.container,s=i&&!rpe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let r=this.previousFocusElement;for(;r&&!r.offsetParent;)r=r.parentElement??void 0;r!=null&&r.offsetParent?(r.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof Fk&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){var e,t;if(this.ui&&this.isVisible()){const i=this.ui.container.style,s=Math.min(this.dimension.width*.62,dj.MAX_WIDTH);i.width=s+"px",i.top=`${(e=this.viewState)!=null&&e.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,i.left=`${Math.round(this.dimension.width*(((t=this.viewState)==null?void 0:t.left)??.5)-s/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(F9,-1,"{}"));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e!==void 0?this.storageService.store(F9,JSON.stringify(e),-1,1):this.storageService.remove(F9,-1))}},dj=Kv,Kv.MAX_WIDTH=600,Kv);hj=dj=Kve([mv(1,Mu),mv(2,Ae),mv(3,Xe),mv(4,Qo)],hj);let uj=class extends G{constructor(e,t,i,s,o,r,a){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=o,this.configurationService=a,this.dndViewState=Ze(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=JKe.bindTo(r);const l=IKe(this.configurationService)==="custom";this._controlsOnLeft=l&&d7===1,this._controlsOnRight=l&&(d7===3||d7===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...s,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t!=null&&t.top&&(t!=null&&t.left)){const s=Math.round(t.left*100)/100,o=e.width,r=i.width,a=s*o-r/2;this._layout(t.top*e.height,a)}}_registerLayoutListener(){this._register(ve.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(die(e,t=>{const i=new ao(Oe(e),t);i.detail===2&&this._quickInputDragAreas.some(({node:s,includeChildren:o})=>o?Cs(i.target,s):i.target===s)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(ipe(e,t=>{const i=Oe(this._layoutService.activeContainer),s=new ao(i,t);if(!this._quickInputDragAreas.some(({node:h,includeChildren:u})=>u?Cs(s.target,h):s.target===h))return;const o=this._quickInputContainer.getBoundingClientRect(),r=s.browserEvent.clientX-o.left,a=s.browserEvent.clientY-o.top;let l=!1;const c=YOe(i,h=>{new ao(i,h).preventDefault(),l||(l=!0),this._layout(h.clientY-a,h.clientX-r)}),d=die(i,h=>{if(l){const u=this.dndViewState.get();this.dndViewState.set({top:u==null?void 0:u.top,left:u==null?void 0:u.left,done:!0},void 0)}c.dispose(),d.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),s=this._getCenterYSnapValue(),o=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aL=function(n,e){return function(t,i){e(t,i,n)}};let fj=class extends h6e{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Gz))),this._quickAccess}constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=o,this._onShow=this._register(new q),this._onHide=this._register(new q),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(jg).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Zz))},s=this._register(this.instantiationService.createInstance(hj,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Oe(e.activeContainer)===Oe(s.container)&&s.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Se(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=vt.None){return this.controller.pick(e,t,i)}input(e={},t=vt.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:pe(O7),quickInputForeground:pe(F7e),quickInputTitleBackground:pe(B7e),widgetBorder:pe(xY),widgetShadow:pe(sx)},inputBox:yP,toggle:CP,countBadge:rve,button:CKe,progressBar:yKe,keybindingLabel:ove,list:zw({listBackground:O7,listFocusBackground:NI,listFocusForeground:II,listInactiveFocusForeground:II,listInactiveSelectionIconForeground:DY,listInactiveFocusBackground:NI,listFocusOutline:Vi,listInactiveFocusOutline:Vi,treeStickyScrollBackground:O7}),pickerGroup:{pickerGroupBorder:pe(W7e),pickerGroupForeground:pe(Cme)}}}};fj=qYe([aL(0,Ae),aL(1,Xe),aL(2,en),aL(3,Mu),aL(4,lt)],fj);var Gve=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Bb=function(n,e){return function(t,i){e(t,i,n)}};let gj=class extends fj{constructor(e,t,i,s,o,r){super(t,i,s,new YV(e.getContainerDomNode(),o),r),this.host=void 0;const a=rN.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return ve.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return ve.None},get onDidAddContainer(){return ve.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};gj=Gve([Bb(1,Ae),Bb(2,Xe),Bb(3,en),Bb(4,Ft),Bb(5,lt)],gj);let pj=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(gj,e);this.mapEditorToService.set(e,t),Y1(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=vt.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};pj=Gve([Bb(0,Ae),Bb(1,Ft)],pj);const eF=class eF{static get(e){return e.getContribution(eF.ID)}constructor(e){this.editor=e,this.widget=new mj(this.editor)}dispose(){this.widget.dispose()}};eF.ID="editor.controller.quickInput";let rN=eF;const tF=class tF{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return tF.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}};tF.ID="editor.contrib.quickInputWidget";let mj=tF;At(rN.ID,rN,4);class KYe{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function GYe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const u=eZe(d.token,h.token);return u!==0?u:d.index-h.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new XYe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new iX(t,r,a),c=new nX(l);for(let d=0,h=n.length;d"u"){const s=this._match(t),o=JYe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const QYe=/\b(comment|string|regex|regexp)\b/;function JYe(n){const e=n.match(QYe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function eZe(n,e){return ne?1:0}class iX{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new iX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class nX{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new nX(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function tZe(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>ws(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>ws(o.format)&&ws(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:He.parse(o.location)}))}}n.fromJSONObject=t})(vre||(vre={}));const aZe=/^([\w_-]+)$/,lZe=_(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class cZe extends G{constructor(){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:_(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:aZe.source,patternErrorMessage:lZe},fontCharacter:{type:"string",description:_(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Ue.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Ue.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Ue.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!Ue.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const Uw=new cZe;Ji.add(rZe.IconContribution,Uw);function Ai(n,e,t,i){return Uw.registerIcon(n,e,t,i)}function Zve(){return Uw}function dZe(){const n=Ege();for(const e in n){const t="\\"+n[e].toString(16);Uw.registerIcon(e,{fontCharacter:t})}}dZe();const Xve="vscode://schemas/icons",Qve=Ji.as(i3.JSONContribution);Qve.registerSchema(Xve,Uw.getIconSchema());const wre=new ai(()=>Qve.notifySchemaChanged(Xve),200);Uw.onDidChange(()=>{wre.isScheduled()||wre.schedule()});const Jve=Ai("widget-close",de.close,_(2027,"Icon for the close action in widgets."));Ai("goto-previous-location",de.arrowUp,_(2028,"Icon for goto previous editor location."));Ai("goto-next-location",de.arrowDown,_(2029,"Icon for goto next editor location."));Ue.modify(de.sync,"spin");Ue.modify(de.loading,"spin");function hZe(n){const e=new ne,t=e.add(new q),i=Zve();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new e1e,o={},r=new k9,a=new k9;for(const l of i.getIcons()){const c=s.getIcon(l);if(!c)continue;const d=c.font,h=na`--vscode-icon-${w2(l.id)}-font-family`,u=na`--vscode-icon-${w2(l.id)}-content`;d?(o[d.id]=d.definition,a.push(na`${h}: ${hp(d.id)};`,na`${u}: ${hp(c.fontCharacter)};`),r.push(na`.codicon-${w2(l.id)}:before { content: ${hp(c.fontCharacter)}; font-family: ${hp(d.id)}; }`)):(a.push(na`${u}: ${hp(c.fontCharacter)}; ${h}: 'codicon';`),r.push(na`.codicon-${w2(l.id)}:before { content: ${hp(c.fontCharacter)}; }`))}for(const l in o){const c=o[l],d=c.weight?na`font-weight: ${$oe(c.weight)};`:na``,h=c.style?na`font-style: ${$oe(c.style)};`:na``,u=new k9;for(const f of c.src)u.push(na`${Su(f.location)} format(${hp(f.format)})`);r.push(na`@font-face { src: ${u.join(", ")}; font-family: ${hp(l)};${d}${h} font-display: block; }`)}return r.push(na`:root { ${a.join(" ")} }`),r.join(` -`)}}}class e1e{getIcon(e){const t=Zve();let i=e.defaults;for(;Ue.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Af="vs",Cy="vs-dark",Fv="hc-black",Bv="hc-light",t1e=Ji.as(sme.ColorContribution),uZe=Ji.as(jme.ThemingContribution);class i1e{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(ZR(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,se.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=_j(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,se.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=t1e.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Af:return Gl.LIGHT;case Fv:return Gl.HIGH_CONTRAST_DARK;case Bv:return Gl.HIGH_CONTRAST_LIGHT;default:return Gl.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=_j(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Yve.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Co.getForeground(o),a=Co.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}get tokenColorMap(){return[]}}function ZR(n){return n===Af||n===Cy||n===Fv||n===Bv}function _j(n){switch(n){case Af:return iZe;case Cy:return nZe;case Fv:return sZe;case Bv:return oZe}}function x2(n){const e=_j(n);return new i1e(n,e)}class fZe extends G{constructor(){super(),this._onColorThemeChange=this._register(new q),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new q),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new e1e,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Af,x2(Af)),this._knownThemes.set(Cy,x2(Cy)),this._knownThemes.set(Fv,x2(Fv)),this._knownThemes.set(Bv,x2(Bv));const e=this._register(hZe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Af),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Hge(ri,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return pA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=lc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),G.None}_registerShadowDomContainer(e){const t=lc(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Af),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=ri.matchMedia("(forced-colors: active)").matches;if(e!==qd(this._theme.type)){let t;Ng(this._theme.type)?t=e?Fv:Cy:t=e?Bv:Af,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};uZe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of t1e.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${bY(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${s.join(` -`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(tZe(o)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join(` +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}};Q4.InstanceCount=0;let ej=Q4;class WZ{constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new CGe(e,null,t),this.onDidSpliceModel=this.model.onDidSpliceModel,this.onDidSpliceRenderedNodes=this.model.onDidSpliceRenderedNodes,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,t.sorter&&(this.sorter={compare(i,s){return t.sorter.compare(i.element,s.element)}}),this.identityProvider=t.identityProvider}setChildren(e,t=Dt.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=Dt.empty(),i){const s=new Set,o=new Set,r=l=>{var d;if(l.element===null)return;const c=l;if(s.add(c.element),this.nodes.set(c.element,c),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.add(h),this.nodesByIdentity.set(h,c)}(d=i.onDidCreateNode)==null||d.call(i,c)},a=l=>{var d;if(l.element===null)return;const c=l;if(s.has(c.element)||this.nodes.delete(c.element),this.identityProvider){const h=this.identityProvider.getId(c.element).toString();o.has(h)||this.nodesByIdentity.delete(h)}(d=i.onDidDeleteNode)==null||d.call(i,c)};this.model.splice([...e,0],Number.MAX_VALUE,t,{...i,onDidCreateNode:r,onDidDeleteNode:a})}preserveCollapseState(e=Dt.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),Dt.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===ja.Collapsed||t.collapsed===ja.PreserveOrCollapsed?r=!0:t.collapsed===ja.Expanded||t.collapsed===ja.PreserveOrExpanded?r=!1:r=!!t.collapsed,{...t,children:this.preserveCollapseState(t.children),collapsed:r}}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===ja.PreserveOrCollapsed||t.collapsed===ja.PreserveOrExpanded?o=i.collapsed:t.collapsed===ja.Collapsed?o=!0:t.collapsed===ja.Expanded?o=!1:o=!!t.collapsed,{...t,collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)}})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}resort(e=null,t=!0){if(!this.sorter)return;const i=this.getElementLocation(e),s=this.model.getNode(i);this._setChildren(i,this.resortChildren(s,t),{})}resortChildren(e,t,i=!0){let s=[...e.children];return(t||i)&&(s=s.sort(this.sorter.compare.bind(this.sorter))),Dt.map(s,o=>({element:o.element,collapsible:o.collapsible,collapsed:o.collapsed,children:this.resortChildren(o,t,!1)}))}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new Ya(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function GR(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:Dt.map(Dt.from(n.children),GR),collapsible:n.collapsible,collapsed:n.collapsed}}function YR(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=Dt.consume(Dt.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:Dt.map(Dt.concat(s,i),YR),collapsible:n.collapsible,collapsed:n.collapsed}}function tj(n,e=0){let t;return etj(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function sre(n){return tj(n,0)}function kve(n,e,t){return n.element===e?{...n,children:t}:{...n,children:Dt.map(Dt.from(n.children),i=>kve(i,e,t))}}const eYe=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class tYe{get onDidSpliceRenderedNodes(){return this.model.onDidSpliceRenderedNodes}get onDidSpliceModel(){return this.model.onDidSpliceModel}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new WZ(e,t),this.enabled=typeof t.compressionEnabled>"u"?!0:t.compressionEnabled,this.identityProvider=t.identityProvider}setChildren(e,t=Dt.empty(),i){const s=i.diffIdentityProvider&&eYe(i.diffIdentityProvider);if(e===null){const g=Dt.map(t,this.enabled?YR:GR);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new Ya(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=sre(r),d=kve(c,e,t),h=(this.enabled?YR:GR)(d),u=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Fi(h.element.elements,r.element.elements,u)){this._setChildren(o,h.children||Dt.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?h:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}isCompressionEnabled(){return this.enabled}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=Dt.map(i,sre),o=Dt.map(s,e?YR:GR);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,{...i,onDidCreateNode:o,onDidDeleteNode:r})}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}resort(e=null,t=!0){const i=this.getCompressedNode(e);this.model.resort(i,t)}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new Ya(this.user,`Tree element not found: ${e}`);return t}}const iYe=n=>n[n.length-1];class HZ{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new HZ(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function nYe(n,e){return{...e,identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){const s=t.elements;for(let o=0;o({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidSpliceRenderedNodes(){return ve.map(this.model.onDidSpliceRenderedNodes,({start:e,deleteCount:t,elements:i})=>({start:e,deleteCount:t,elements:i.map(s=>this.nodeMapper.map(s))}))}get onDidChangeCollapseState(){return ve.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ve.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t={}){this.rootRef=null,this.elementMapper=t.elementMapper||iYe;const i=s=>this.elementMapper(s.elements);this.nodeMapper=new PZ(s=>new HZ(i,s)),this.model=new tYe(e,nYe(i,t))}setChildren(e,t=Dt.empty(),i={}){this.model.setChildren(e,t,i)}isCompressionEnabled(){return this.model.isCompressionEnabled()}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}resort(e=null,t=!0){return this.model.resort(e,t)}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var oYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class VZ extends Sve{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=Dt.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}resort(e,t=!0){this.model.resort(e,t)}hasElement(e){return this.model.has(e)}createModel(e,t){return new WZ(e,t)}}class Ive{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t,i){this._compressedTreeNodeProvider=e,this.stickyScrollDelegate=t,this.renderer=i,this.templateId=i.templateId,i.onDidChangeTwistieState&&(this.onDidChangeTwistieState=i.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){let o=this.stickyScrollDelegate.getCompressedNode(e);o||(o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element)),o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)==null||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)==null||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){var i,s;return((s=(i=this.renderer).renderTwistie)==null?void 0:s.call(i,e,t))??!1}}oYe([wn],Ive.prototype,"compressedTreeNodeProvider",null);class rYe{constructor(e){this.modelProvider=e,this.compressedStickyNodes=new Map}getCompressedNode(e){return this.compressedStickyNodes.get(e)}constrainStickyScrollNodes(e,t,i){if(this.compressedStickyNodes.clear(),e.length===0)return[];for(let s=0;si||s>=t-1&&tthis,a=new rYe(()=>this.model),l=s.map(c=>new Ive(r,a,c));super(e,t,i,l,{...aYe(r,o),stickyScrollDelegate:a})}setChildren(e,t=Dt.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t){return new sYe(e,t)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}function P9(n){return{...n,children:[],refreshPromise:void 0,stale:!0,slow:!1,forceExpanded:!1}}function ij(n,e){return e.parent?e.parent===n?!0:ij(n,e.parent):!1}function lYe(n,e){return n===e||ij(n,e)||ij(e,n)}class zZ{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new zZ(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class cYe{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(de.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(de.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)==null||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function ore(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function rre(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class dYe extends ND{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function O9(n){return n instanceof ND?new dYe(n):n}class hYe{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)==null||s.call(i,O9(e),t)}onDragOver(e,t,i,s,o,r=!0){return this.dnd.onDragOver(O9(e),t&&t.element,i,s,o)}drop(e,t,i,s,o){this.dnd.drop(O9(e),t&&t.element,i,s,o)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)==null||i.call(t,e)}dispose(){this.dnd.dispose()}}class uYe extends wve{constructor(e,t,i){super(t,i),this.findProvider=e,this.isFindSessionActive=!1}filter(e,t){const i=super.filter(e,t);if(!this.isFindSessionActive||this.findMode===Za.Highlight||!this.findProvider.isVisible)return i;const s=TD(i)?i.visibility:i;return dw(s)===0?0:this.findProvider.isVisible(e)?i:0}}class fYe extends Cve{constructor(e,t,i,s,o){super(e,i,s,o),this.findProvider=t,this.filter=i,this.activeSession=!1,this.asyncWorkInProgress=!1,this.disposables.add(Re(async()=>{var r,a;this.activeSession&&await((a=(r=this.findProvider).endSession)==null?void 0:a.call(r))}))}render(){if(this.asyncWorkInProgress||!this.activeFindMetadata)return;const e=this.activeFindMetadata.matchCount===0&&this.pattern.length>0;this.renderMessage(e),this.pattern.length&&this.alertResults(this.activeFindMetadata.matchCount)}shouldAllowFocus(e){return this.shouldFocusWhenNavigating(e)}shouldFocusWhenNavigating(e){var i;if(!this.activeSession||!this.activeFindMetadata)return!0;const t=(i=e.element)==null?void 0:i.element;return t&&this.activeFindMetadata.isMatch(t)?!0:!$c.isDefault(e.filterData)}}function Nve(n){return n&&{...n,collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new hYe(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent({...e,element:e.element})},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent({...e,element:e.element})}},accessibilityProvider:n.accessibilityProvider&&{...n.accessibilityProvider,getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!((t=n.accessibilityProvider)!=null&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))},filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&{...n.keyboardNavigationLabelProvider,getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}},sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element),stickyScrollDelegate:n.stickyScrollDelegate}}function nj(n,e){e(n),n.children.forEach(t=>nj(t,e))}class Dve{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ve.map(this.tree.onDidChangeFocus,ore)}get onDidChangeSelection(){return ve.map(this.tree.onDidChangeSelection,ore)}get onMouseDblClick(){return ve.map(this.tree.onMouseDblClick,rre)}get onPointer(){return ve.map(this.tree.onPointer,rre)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeStickyScrollFocused(){return this.tree.onDidChangeStickyScrollFocused}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new q,this._onDidChangeNodeSlowState=new q,this.nodeMapper=new PZ(c=>new zZ(c)),this.disposables=new ne,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.getDefaultCollapseState=c=>r.collapseByDefault?r.collapseByDefault(c)?ja.PreserveOrCollapsed:ja.PreserveOrExpanded:void 0;let a=!1,l;if(r.findProvider&&(r.findWidgetEnabled??!0)&&r.keyboardNavigationLabelProvider&&r.contextViewProvider&&(a=!0,l=new uYe(r.findProvider,r.keyboardNavigationLabelProvider,r.filter)),this.tree=this.createTree(e,t,i,s,{...r,findWidgetEnabled:!a,filter:l??r.filter}),this.root=P9({element:void 0,parent:null,hasChildren:!0,defaultCollapseState:void 0}),this.identityProvider&&(this.root={...this.root,id:null}),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables),a){const c={styles:r.findWidgetStyles,showNotFoundMessage:r.showNotFoundMessage,defaultFindMatchType:r.defaultFindMatchType,defaultFindMode:r.defaultFindMode};this.findController=this.disposables.add(new fYe(this.tree,r.findProvider,l,this.tree.options.contextViewProvider,c)),this.focusNavigationFilter=d=>this.findController.shouldFocusWhenNavigating(d),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindOpenState=this.tree.onDidChangeFindOpenState,this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.onDidChangeFindMatchType=this.tree.onDidChangeFindMatchType}createTree(e,t,i,s,o){const r=new OZ(i),a=s.map(c=>new cYe(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=Nve(o)||{};return new VZ(e,t,r,a,l)}updateOptions(e={}){this.findController&&(e.defaultFindMode!==void 0&&(this.findController.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.findController.matchType=e.defaultFindMatchType)),this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}async setInput(e,t){this.cancelAllRefreshPromises(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};await this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)}cancelAllRefreshPromises(e=!1){this.refreshPromises.forEach(t=>t.cancel()),this.refreshPromises.clear(),e&&(this.subTreeRefreshPromises.forEach(t=>t.cancel()),this.subTreeRefreshPromises.clear())}async _updateChildren(e=this.root.element,t=!0,i=!1,s,o){if(typeof this.root.element>"u")throw new Ya(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ve.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(await this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}async expand(e,t=!1){if(typeof this.root.element>"u")throw new Ya(this.user,"Tree input not set");this.root.refreshPromise&&(await this.root.refreshPromise,await ve.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(await i.refreshPromise,await ve.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(await i.refreshPromise,await ve.toPromise(this._onDidRender.event)),s}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){var i;const t=this.nodes.get(e===this.root.element?null:e);if(!t){const s=(i=this.identityProvider)==null?void 0:i.getId(e).toString();throw new Ya(this.user,`Data tree node not found${s?`: ${s}`:""}`)}return t}async refreshAndRenderNode(e,t,i,s){this.disposables.isDisposed||(await this.refreshNode(e,t,i),!this.disposables.isDisposed&&this.render(e,i,s))}async refreshNode(e,t,i){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&lYe(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0,this.setChildren(e,[],t,i);return}return this.doRefreshSubTree(e,t,i)}async doRefreshSubTree(e,t,i){const s=rs(async()=>{const o=await this.doRefreshNode(e,t,i);e.stale=!1,await aE.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))});return e.refreshPromise=s,this.subTreeRefreshPromises.set(e,s),s.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}),s}async doRefreshNode(e,t,i){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(Dt.empty());else{const o=this.doGetChildren(e);if(ZB(o))s=Promise.resolve(o);else{const r=wu(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=await s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),fl(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return ZB(i)?this.processChildren(i):(t=rs(async()=>this.processChildren(await i)),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(Je))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)r.set(d.element,d),this.identityProvider&&a.set(d.id,{node:d,collapsed:this.tree.hasElement(d)&&this.tree.isCollapsed(d)});const l=[],c=o.map(d=>{const h=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=P9({element:d,parent:e,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return h&&p.defaultCollapseState===ja.PreserveOrExpanded&&l.push(p),p}const u=this.identityProvider.getId(d).toString(),f=a.get(u);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=h,i?f.collapsed?(p.children.forEach(m=>nj(m,b=>this.nodes.delete(b.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):h&&!f.collapsed&&l.push(p),p}const g=P9({element:d,parent:e,id:u,hasChildren:h,defaultCollapseState:this.getDefaultCollapseState(d)});return s&&s.viewState.focus&&s.viewState.focus.indexOf(u)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(u)>-1&&s.selection.push(g),(s&&s.viewState.expanded&&s.viewState.expanded.indexOf(u)>-1||h&&g.defaultCollapseState===ja.PreserveOrExpanded)&&l.push(g),g});for(const d of r.values())nj(d,h=>this.nodes.delete(h.element));for(const d of c)this.nodes.set(d.element,d);return GM(e.children,0,e.children.length,c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].forceExpanded=!0,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&{...i,diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}};this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:e.forceExpanded?(i=!1,e.forceExpanded=!1):i=e.defaultCollapseState,{element:e,children:e.hasChildren?Dt.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class jZ{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new jZ(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class gYe{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...$e.asClassNameArray(de.treeItemLoading)),!0):(t.classList.remove(...$e.asClassNameArray(de.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)==null||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)==null||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=ei(this.disposables)}}function pYe(n){const e=n&&Nve(n);return e&&{...e,keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{...e.keyboardNavigationLabelProvider,getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}},stickyScrollDelegate:e.stickyScrollDelegate}}class mYe extends Dve{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new PZ(l=>new jZ(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new OZ(i),a=s.map(c=>new gYe(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=pYe(o)||{};return new Eve(e,t,r,a,l)}asTreeElement(e,t){return{incompressible:this.compressionDelegate.isIncompressible(e.element),...super.asTreeElement(e,t)}}render(e,t,i){if(!this.identityProvider)return super.render(e,t);const s=f=>this.identityProvider.getId(f).toString(),o=f=>{const g=new Set;for(const p of f){const m=this.tree.getCompressedTreeNode(p===this.root?null:p);if(m.element)for(const b of m.element.elements)g.add(s(b.element))}return g},r=o(this.tree.getSelection()),a=o(this.tree.getFocus());super.render(e,t,i);const l=this.getSelection();let c=!1;const d=this.getFocus();let h=!1;const u=f=>{const g=f.element;if(g)for(let p=0;p{const i=this.filter.filter(t,1),s=_Ye(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function _Ye(n){return typeof n=="boolean"?n?1:0:TD(n)?dw(n.visibility):dw(n)}class bYe extends Sve{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t){return new WZ(e,t)}}new Se("isMac",yt,_(1684,"Whether the operating system is macOS"));new Se("isLinux",Ur,_(1685,"Whether the operating system is Linux"));const P3=new Se("isWindows",$s,_(1686,"Whether the operating system is Windows")),Tve=new Se("isWeb",Tu,_(1687,"Whether the platform is a web browser"));new Se("isMacNative",yt&&!Tu,_(1688,"Whether the operating system is macOS on a non-browser platform"));new Se("isIOS",Jl,_(1689,"Whether the operating system is iOS"));new Se("isMobile",oge,_(1690,"Whether the platform is a mobile web browser"));new Se("isDevelopment",!1,!0);new Se("productQualityType","",_(1691,"Quality type of VS Code"));const Rve="inputFocus",$Z=new Se(Rve,!1,_(1692,"Whether keyboard focus is inside an input box"));var qg=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Di=function(n,e){return function(t,i){e(t,i,n)}};const uc=mt("listService");class vYe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new ne,this.lists=[],this._lastFocusedWidget=void 0}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)==null||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)==null||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),H5(e.getHTMLElement())&&this.setLastFocusedList(e),Vc(e.onDidFocus(()=>this.setLastFocusedList(e)),Re(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const iN=new Se("listScrollAtBoundary","none");le.or(iN.isEqualTo("top"),iN.isEqualTo("both"));le.or(iN.isEqualTo("bottom"),iN.isEqualTo("both"));const Mve=new Se("listFocus",!0),Ave=new Se("treestickyScrollFocused",!1),O3=new Se("listSupportsMultiselect",!0),Pve=le.and(Mve,le.not(Rve),Ave.negate()),UZ=new Se("listHasSelectionOrFocus",!1),qZ=new Se("listDoubleSelection",!1),KZ=new Se("listMultiSelection",!1),F3=new Se("listSelectionNavigation",!1),wYe=new Se("listSupportsFind",!0),GZ=new Se("treeElementCanCollapse",!1),CYe=new Se("treeElementHasParent",!1),YZ=new Se("treeElementCanExpand",!1),yYe=new Se("treeElementHasChild",!1),SYe=new Se("treeFindOpen",!1),Ove="listTypeNavigationMode",Fve="listAutomaticKeyboardNavigation";function B3(n,e){const t=n.createScoped(e.getHTMLElement());return Mve.bindTo(t),t}function W3(n,e){const t=iN.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const Vw="workbench.list.multiSelectModifier",ZR="workbench.list.openMode",Yl="workbench.list.horizontalScrolling",ZZ="workbench.list.defaultFindMode",XZ="workbench.list.typeNavigationMode",RP="workbench.list.keyboardNavigation",nh="workbench.list.scrollByPage",QZ="workbench.list.defaultFindMatchType",nN="workbench.tree.indent",MP="workbench.tree.renderIndentGuides",sh="workbench.list.smoothScrolling",Lu="workbench.list.mouseWheelScrollSensitivity",ku="workbench.list.fastScrollSensitivity",AP="workbench.tree.expandMode",PP="workbench.tree.enableStickyScroll",OP="workbench.tree.stickyScrollMaxItemCount";function Iu(n){return n.getValue(Vw)==="alt"}class xYe extends G{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=Iu(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Vw)&&(this.useAltAsMultipleSelectionModifier=Iu(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:Xbe(e)}isSelectionRangeChangeEvent(e){return Qbe(e)}}function H3(n,e){const t=n.get(lt),i=n.get(Vt),s=new ne;return[{...e,keyboardNavigationDelegate:{mightProducePrintableCharacter(r){return i.mightProducePrintableCharacter(r)}},smoothScrolling:!!t.getValue(sh),mouseWheelScrollSensitivity:t.getValue(Lu),fastScrollSensitivity:t.getValue(ku),multipleSelectionController:e.multipleSelectionController??s.add(new xYe(t)),keyboardNavigationEventFilter:IYe(i),scrollByPage:!!t.getValue(nh)},s]}let are=class extends pl{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Yl),[h,u]=c.invokeFunction(H3,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables.add(u),this.contextKeyService=B3(r,this),this.disposables.add(W3(this.contextKeyService,this)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=UZ.bindTo(this.contextKeyService),this.listDoubleSelection=qZ.bindTo(this.contextKeyService),this.listMultiSelection=KZ.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Iu(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Vw)&&(this._useAltAsMultipleSelectionModifier=Iu(l));let p={};if(g.affectsConfiguration(Yl)&&this.horizontalScrolling===void 0){const m=!!l.getValue(Yl);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(nh)){const m=!!l.getValue(nh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(sh)){const m=!!l.getValue(sh);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Lu)){const m=l.getValue(Lu);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(ku)){const m=l.getValue(ku);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new Bve(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Ww(e):lx)}};are=qg([Di(5,Xe),Di(6,uc),Di(7,lt),Di(8,Ae)],are);let lre=class extends jGe{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Yl),[h,u]=c.invokeFunction(H3,o);super(e,t,i,s,{keyboardSupport:!1,...h,horizontalScrolling:d}),this.disposables=new ne,this.disposables.add(u),this.contextKeyService=B3(r,this),this.disposables.add(W3(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=Iu(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(Vw)&&(this._useAltAsMultipleSelectionModifier=Iu(l));let p={};if(g.affectsConfiguration(Yl)&&this.horizontalScrolling===void 0){const m=!!l.getValue(Yl);p={...p,horizontalScrolling:m}}if(g.affectsConfiguration(nh)){const m=!!l.getValue(nh);p={...p,scrollByPage:m}}if(g.affectsConfiguration(sh)){const m=!!l.getValue(sh);p={...p,smoothScrolling:m}}if(g.affectsConfiguration(Lu)){const m=l.getValue(Lu);p={...p,mouseWheelScrollSensitivity:m}}if(g.affectsConfiguration(ku)){const m=l.getValue(ku);p={...p,fastScrollSensitivity:m}}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new Bve(this,{configurationService:l,...o}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Ww(e):lx)}dispose(){this.disposables.dispose(),super.dispose()}};lre=qg([Di(5,Xe),Di(6,uc),Di(7,lt),Di(8,Ae)],lre);let cre=class extends ej{constructor(e,t,i,s,o,r,a,l,c,d){const h=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Yl),[u,f]=d.invokeFunction(H3,r);super(e,t,i,s,o,{keyboardSupport:!1,...u,horizontalScrolling:h}),this.disposables.add(f),this.contextKeyService=B3(a,this),this.disposables.add(W3(this.contextKeyService,this)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=UZ.bindTo(this.contextKeyService),this.listDoubleSelection=qZ.bindTo(this.contextKeyService),this.listMultiSelection=KZ.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=Iu(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),m=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||m.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),m=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||m.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(Vw)&&(this._useAltAsMultipleSelectionModifier=Iu(c));let m={};if(p.affectsConfiguration(Yl)&&this.horizontalScrolling===void 0){const b=!!c.getValue(Yl);m={...m,horizontalScrolling:b}}if(p.affectsConfiguration(nh)){const b=!!c.getValue(nh);m={...m,scrollByPage:b}}if(p.affectsConfiguration(sh)){const b=!!c.getValue(sh);m={...m,smoothScrolling:b}}if(p.affectsConfiguration(Lu)){const b=c.getValue(Lu);m={...m,mouseWheelScrollSensitivity:b}}if(p.affectsConfiguration(ku)){const b=c.getValue(ku);m={...m,fastScrollSensitivity:b}}Object.keys(m).length>0&&this.updateOptions(m)})),this.navigator=new LYe(this,{configurationService:c,...r}),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Ww(e):lx)}dispose(){this.disposables.dispose(),super.dispose()}};cre=qg([Di(6,Xe),Di(7,uc),Di(8,lt),Di(9,Ae)],cre);class JZ extends G{constructor(e,t){super(),this.widget=e,this._onDidOpen=this._register(new q),this.onDidOpen=this._onDidOpen.event,this._register(ve.filter(this.widget.onDidChangeSelection,i=>kf(i.browserEvent))(i=>this.onSelectionFromKeyboard(i))),this._register(this.widget.onPointer(i=>this.onPointer(i.element,i.browserEvent))),this._register(this.widget.onMouseDblClick(i=>this.onMouseDblClick(i.element,i.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(ZR))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(ZR)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(ZR))!=="doubleClick")}))):this.openOnSingleClick=(t==null?void 0:t.openOnSingleClick)??!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class Bve extends JZ{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class LYe extends JZ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class kYe extends JZ{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelection()[0]??void 0}}function IYe(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let FP=class extends VZ{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(RD,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new uw(this,o,h,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};FP=qg([Di(5,Ae),Di(6,Xe),Di(7,uc),Di(8,lt)],FP);let dre=class extends Eve{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:h,disposable:u}=r.invokeFunction(RD,o);super(e,t,i,s,d),this.disposables.add(u),this.internals=new uw(this,o,h,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};dre=qg([Di(5,Ae),Di(6,Xe),Di(7,uc),Di(8,lt)],dre);let hre=class extends bYe{constructor(e,t,i,s,o,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(RD,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new uw(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};hre=qg([Di(6,Ae),Di(7,Xe),Di(8,uc),Di(9,lt)],hre);let sj=class extends Dve{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:h,getTypeNavigationMode:u,disposable:f}=a.invokeFunction(RD,r);super(e,t,i,s,o,h),this.disposables.add(f),this.internals=new uw(this,r,u,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};sj=qg([Di(6,Ae),Di(7,Xe),Di(8,uc),Di(9,lt)],sj);let ure=class extends mYe{constructor(e,t,i,s,o,r,a,l,c,d,h){const{options:u,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(RD,a);super(e,t,i,s,o,r,u),this.disposables.add(g),this.internals=new uw(this,a,f,a.overrideStyles,c,d,h),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};ure=qg([Di(7,Ae),Di(8,Xe),Di(9,uc),Di(10,lt)],ure);function Wve(n){const e=n.getValue(ZZ);if(e==="highlight")return Za.Highlight;if(e==="filter")return Za.Filter;const t=n.getValue(RP);if(t==="simple"||t==="highlight")return Za.Highlight;if(t==="filter")return Za.Filter}function Hve(n){const e=n.getValue(QZ);if(e==="fuzzy")return Fd.Fuzzy;if(e==="contiguous")return Fd.Contiguous}function RD(n,e){const t=n.get(lt),i=n.get(zg),s=n.get(Xe),o=n.get(Ae),r=()=>{const u=s.getContextKeyValue(Ove);if(u==="automatic")return Qh.Automatic;if(u==="trigger"||s.getContextKeyValue(Fve)===!1)return Qh.Trigger;const g=t.getValue(XZ);if(g==="automatic")return Qh.Automatic;if(g==="trigger")return Qh.Trigger},a=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!t.getValue(Yl),[l,c]=o.invokeFunction(H3,e),d=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:t.getValue(MP);return{getTypeNavigationMode:r,disposable:c,options:{keyboardSupport:!1,...l,indent:typeof t.getValue(nN)=="number"?t.getValue(nN):void 0,renderIndentGuides:h,smoothScrolling:!!t.getValue(sh),defaultFindMode:e.defaultFindMode??Wve(t),defaultFindMatchType:e.defaultFindMatchType??Hve(t),horizontalScrolling:a,scrollByPage:!!t.getValue(nh),paddingBottom:d,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:e.expandOnlyOnTwistieClick??t.getValue(AP)==="doubleClick",contextViewProvider:i,findWidgetStyles:CKe,enableStickyScroll:!!t.getValue(PP),stickyScrollMaxItemCount:Number(t.getValue(OP))}}}let uw=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){this.tree=e,this.disposables=[],this.contextKeyService=B3(o,e),this.disposables.push(W3(this.contextKeyService,e)),this.listSupportsMultiSelect=O3.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),F3.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=wYe.bindTo(this.contextKeyService),this.listSupportFindWidget.set(t.findWidgetEnabled??!0),this.hasSelectionOrFocus=UZ.bindTo(this.contextKeyService),this.hasDoubleSelection=qZ.bindTo(this.contextKeyService),this.hasMultiSelection=KZ.bindTo(this.contextKeyService),this.treeElementCanCollapse=GZ.bindTo(this.contextKeyService),this.treeElementHasParent=CYe.bindTo(this.contextKeyService),this.treeElementCanExpand=YZ.bindTo(this.contextKeyService),this.treeElementHasChild=yYe.bindTo(this.contextKeyService),this.treeFindOpen=SYe.bindTo(this.contextKeyService),this.treeStickyScrollFocused=Ave.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=Iu(a),this.updateStyleOverrides(s);const c=()=>{const h=e.getFocus()[0];if(!h)return;const u=e.getNode(h);this.treeElementCanCollapse.set(u.collapsible&&!u.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(u.collapsible&&u.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},d=new Set;d.add(Ove),d.add(Fve),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),u=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||u.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),u=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||u.length>0),c()}),e.onDidChangeCollapseState(c),e.onDidChangeModel(c),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),e.onDidChangeStickyScrollFocused(h=>this.treeStickyScrollFocused.set(h)),a.onDidChangeConfiguration(h=>{let u={};if(h.affectsConfiguration(Vw)&&(this._useAltAsMultipleSelectionModifier=Iu(a)),h.affectsConfiguration(nN)){const f=a.getValue(nN);u={...u,indent:f}}if(h.affectsConfiguration(MP)&&t.renderIndentGuides===void 0){const f=a.getValue(MP);u={...u,renderIndentGuides:f}}if(h.affectsConfiguration(sh)){const f=!!a.getValue(sh);u={...u,smoothScrolling:f}}if(h.affectsConfiguration(ZZ)||h.affectsConfiguration(RP)){const f=Wve(a);u={...u,defaultFindMode:f}}if(h.affectsConfiguration(XZ)||h.affectsConfiguration(RP)){const f=i();u={...u,typeNavigationMode:f}}if(h.affectsConfiguration(QZ)){const f=Hve(a);u={...u,defaultFindMatchType:f}}if(h.affectsConfiguration(Yl)&&t.horizontalScrolling===void 0){const f=!!a.getValue(Yl);u={...u,horizontalScrolling:f}}if(h.affectsConfiguration(nh)){const f=!!a.getValue(nh);u={...u,scrollByPage:f}}if(h.affectsConfiguration(AP)&&t.expandOnlyOnTwistieClick===void 0&&(u={...u,expandOnlyOnTwistieClick:a.getValue(AP)==="doubleClick"}),h.affectsConfiguration(PP)){const f=a.getValue(PP);u={...u,enableStickyScroll:f}}if(h.affectsConfiguration(OP)){const f=Math.max(1,a.getValue(OP));u={...u,stickyScrollMaxItemCount:f}}if(h.affectsConfiguration(Lu)){const f=a.getValue(Lu);u={...u,mouseWheelScrollSensitivity:f}}if(h.affectsConfiguration(ku)){const f=a.getValue(ku);u={...u,fastScrollSensitivity:f}}Object.keys(u).length>0&&e.updateOptions(u)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(d)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new kYe(e,{configurationService:a,...t}),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?Ww(e):lx)}dispose(){this.disposables=ei(this.disposables)}};uw=qg([Di(4,Xe),Di(5,uc),Di(6,lt)],uw);const EYe=Ji.as(ch.Configuration);EYe.registerConfiguration({id:"workbench",order:7,title:_(1705,"Workbench"),type:"object",properties:{[Vw]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[_(1706,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),_(1707,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:_(1708,"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[ZR]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_(1709,"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Yl]:{type:"boolean",default:!1,description:_(1710,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[nh]:{type:"boolean",default:!1,description:_(1711,"Controls whether clicks in the scrollbar scroll page by page.")},[nN]:{type:"number",default:8,minimum:4,maximum:40,description:_(1712,"Controls tree indentation in pixels.")},[MP]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:_(1713,"Controls whether the tree should render indent guides.")},[sh]:{type:"boolean",default:!1,description:_(1714,"Controls whether lists and trees have smooth scrolling.")},[Lu]:{type:"number",default:1,markdownDescription:_(1715,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[ku]:{type:"number",default:5,markdownDescription:_(1716,"Scrolling speed multiplier when pressing `Alt`.")},[ZZ]:{type:"string",enum:["highlight","filter"],enumDescriptions:[_(1717,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),_(1718,"Filter elements when searching.")],default:"highlight",description:_(1719,"Controls the default find mode for lists and trees in the workbench.")},[RP]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[_(1720,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),_(1721,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),_(1722,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:_(1723,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:_(1724,"Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[QZ]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[_(1725,"Use fuzzy matching when searching."),_(1726,"Use contiguous matching when searching.")],default:"fuzzy",description:_(1727,"Controls the type of matching used when searching lists and trees in the workbench.")},[AP]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:_(1728,"Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[PP]:{type:"boolean",default:!0,description:_(1729,"Controls whether sticky scrolling is enabled in trees.")},[OP]:{type:"number",minimum:1,default:7,markdownDescription:_(1730,"Controls the number of sticky elements displayed in the tree when {0} is enabled.","`#workbench.tree.enableStickyScroll#`")},[XZ]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:_(1731,"Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var V3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},oj=function(n,e){return function(t,i){e(t,i,n)}},rj;const Nh=me;class Vve{constructor(e,t,i){this.index=e,this.hasCheckbox=t,this._hidden=!1,this._init=new ro(()=>{const s=i.label??"",o=dv(s).text.trim(),r=i.ariaLabel||[s,this.saneDescription,this.saneDetail].map(a=>fbe(a)).filter(a=>!!a).join(", ");return{saneLabel:s,saneSortLabel:o,saneAriaLabel:r}}),this._saneDescription=i.description,this._saneTooltip=i.tooltip}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get saneDescription(){return this._saneDescription}set saneDescription(e){this._saneDescription=e}get saneDetail(){return this._saneDetail}set saneDetail(e){this._saneDetail=e}get saneTooltip(){return this._saneTooltip}set saneTooltip(e){this._saneTooltip=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class Qs extends Vve{constructor(e,t,i,s,o,r,a){var l,c,d;super(e,i,r),this.childIndex=t,this.fireButtonTriggered=s,this._onChecked=o,this.item=r,this._separator=a,this._checked=!1,this.onChecked=i?ve.map(ve.filter(this._onChecked.event,h=>h.element===this),h=>h.checked):ve.None,this._saneDetail=r.detail,this._labelHighlights=(l=r.highlights)==null?void 0:l.label,this._descriptionHighlights=(c=r.highlights)==null?void 0:c.description,this._detailHighlights=(d=r.highlights)==null?void 0:d.detail}get separator(){return this._separator}set separator(e){this._separator=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({element:this,checked:e}))}get checkboxDisabled(){return!!this.item.disabled}}var zh;(function(n){n[n.NONE=0]="NONE",n[n.MOUSE_HOVER=1]="MOUSE_HOVER",n[n.ACTIVE_ITEM=2]="ACTIVE_ITEM"})(zh||(zh={}));class pb extends Vve{constructor(e,t,i){super(e,!1,i),this.fireSeparatorButtonTriggered=t,this.separator=i,this.children=new Array,this.focusInsideSeparator=zh.NONE}}class NYe{getHeight(e){return e instanceof pb?30:e.saneDetail?44:22}getTemplateId(e){return e instanceof Qs?BP.ID:WP.ID}}class DYe{getWidgetAriaLabel(){return _(1770,"Quick Input")}getAriaLabel(e){var t;return(t=e.separator)!=null&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(!(!e.hasCheckbox||!(e instanceof Qs)))return{get value(){return e.checked},onDidChange:t=>e.onChecked(()=>t())}}}class zve{constructor(e){this.hoverDelegate=e}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=new ne,t.toDisposeTemplate=new ne,t.entry=he(e,Nh(".quick-input-list-entry"));const i=he(t.entry,Nh("label.quick-input-list-label"));t.outerLabel=i,t.checkbox=t.toDisposeTemplate.add(new Gt),t.toDisposeTemplate.add(kn(i,_e.CLICK,c=>{if(t.checkbox.value&&!c.defaultPrevented&&t.checkbox.value.enabled){const d=!t.checkbox.value.checked;t.checkbox.value.checked=d,t.element.checked=d}}));const s=he(i,Nh(".quick-input-list-rows")),o=he(s,Nh(".quick-input-list-row")),r=he(s,Nh(".quick-input-list-row"));t.label=new tN(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.label),t.icon=V5(t.label.element,Nh(".quick-input-list-icon"));const a=he(o,Nh(".quick-input-list-entry-keybinding"));t.keybinding=new cx(a,ua),t.toDisposeTemplate.add(t.keybinding);const l=he(r,Nh(".quick-input-list-label-meta"));return t.detail=new tN(l,{supportHighlights:!0,supportIcons:!0,hoverDelegate:this.hoverDelegate}),t.toDisposeTemplate.add(t.detail),t.separator=he(t.entry,Nh(".quick-input-list-separator")),t.actionBar=new jr(t.entry,this.hoverDelegate?{hoverDelegate:this.hoverDelegate}:void 0),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.add(t.actionBar),t}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}disposeElement(e,t,i){i.toDisposeElement.clear(),i.actionBar.clear()}}var zv;let BP=(zv=class extends zve{constructor(e,t){super(e),this.themeService=t,this._itemsWithSeparatorsFrequency=new Map}get templateId(){return rj.ID}ensureCheckbox(e,t){var s;if(!e.hasCheckbox){(s=t.checkbox.value)==null||s.domNode.remove(),t.checkbox.clear();return}let i=t.checkbox.value;i?i.setTitle(e.saneLabel):(i=new cve(e.saneLabel,e.checked,{...TZ,size:15}),t.checkbox.value=i,t.outerLabel.prepend(i.domNode)),e.checkboxDisabled?i.disable():i.enable(),i.checked=e.checked,t.toDisposeElement.add(e.onChecked(o=>i.checked=o)),t.toDisposeElement.add(i.onChange(()=>e.checked=i.checked))}renderElement(e,t,i){var u;const s=e.element;i.element=s,s.element=i.entry??void 0;const o=s.item;s.element.classList.toggle("not-pickable",s.item.pickable===!1),this.ensureCheckbox(s,i);const{labelHighlights:r,descriptionHighlights:a,detailHighlights:l}=s;if(o.iconPath){const f=Ng(this.themeService.getColorTheme().type)?o.iconPath.dark:o.iconPath.light??o.iconPath.dark,g=He.revive(f);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=xu(g)}else i.icon.style.backgroundImage="",i.icon.className=o.iconClass?`quick-input-list-icon ${o.iconClass}`:"";let c;!s.saneTooltip&&s.saneDescription&&(c={markdown:{value:zc(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const d={matches:r||[],descriptionTitle:c,descriptionMatches:a||[],labelEscapeNewLines:!0};if(d.extraClasses=o.iconClasses,d.italic=o.italic,d.strikethrough=o.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,d),i.keybinding.set(o.keybinding),s.saneDetail){let f;s.saneTooltip||(f={markdown:{value:zc(s.saneDetail),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDetail}),i.detail.element.style.display="",i.detail.setLabel(s.saneDetail,void 0,{matches:l,title:f,labelEscapeNewLines:!0})}else i.detail.element.style.display="none";(u=s.separator)!=null&&u.label?(i.separator.textContent=s.separator.label,i.separator.style.display="",this.addItemWithSeparator(s)):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!s.separator&&s.childIndex!==0);const h=o.buttons;h&&h.length?(i.actionBar.push(h.map((f,g)=>by(f,`id-${g}`,()=>s.fireButtonTriggered({button:f,item:s.item}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){this.removeItemWithSeparator(e.element),super.disposeElement(e,t,i)}isItemWithSeparatorVisible(e){return this._itemsWithSeparatorsFrequency.has(e)}addItemWithSeparator(e){this._itemsWithSeparatorsFrequency.set(e,(this._itemsWithSeparatorsFrequency.get(e)||0)+1)}removeItemWithSeparator(e){const t=this._itemsWithSeparatorsFrequency.get(e)||0;t>1?this._itemsWithSeparatorsFrequency.set(e,t-1):this._itemsWithSeparatorsFrequency.delete(e)}},rj=zv,zv.ID="quickpickitem",zv);BP=rj=V3([oj(1,en)],BP);const J4=class J4 extends zve{constructor(){super(...arguments),this._visibleSeparatorsFrequency=new Map}get templateId(){return J4.ID}get visibleSeparators(){return[...this._visibleSeparatorsFrequency.keys()]}isSeparatorVisible(e){return this._visibleSeparatorsFrequency.has(e)}renderElement(e,t,i){const s=e.element;i.element=s,s.element=i.entry??void 0,s.element.classList.toggle("focus-inside",!!s.focusInsideSeparator);const o=s.separator,{labelHighlights:r,descriptionHighlights:a}=s;i.icon.style.backgroundImage="",i.icon.className="";let l;!s.saneTooltip&&s.saneDescription&&(l={markdown:{value:zc(s.saneDescription),supportThemeIcons:!0},markdownNotSupportedFallback:s.saneDescription});const c={matches:r||[],descriptionTitle:l,descriptionMatches:a||[],labelEscapeNewLines:!0};i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(s.saneLabel,s.saneDescription,c),i.separator.style.display="none",i.entry.classList.add("quick-input-list-separator-border");const d=o.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>by(h,`id-${u}`,()=>s.fireSeparatorButtonTriggered({button:h,separator:s.separator}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions"),this.addSeparator(s)}disposeElement(e,t,i){var s;this.removeSeparator(e.element),this.isSeparatorVisible(e.element)||(s=e.element.element)==null||s.classList.remove("focus-inside"),super.disposeElement(e,t,i)}addSeparator(e){this._visibleSeparatorsFrequency.set(e,(this._visibleSeparatorsFrequency.get(e)||0)+1)}removeSeparator(e){const t=this._visibleSeparatorsFrequency.get(e)||0;t>1?this._visibleSeparatorsFrequency.set(e,t-1):this._visibleSeparatorsFrequency.delete(e)}};J4.ID="quickpickseparator";let WP=J4,sN=class extends G{constructor(e,t,i,s,o,r){super(),this.parent=e,this.hoverDelegate=t,this.linkOpenerDelegate=i,this.accessibilityService=r,this._onKeyDown=new q,this._onLeave=new q,this.onLeave=this._onLeave.event,this._visibleCountObservable=Ze("VisibleCount",0),this.onChangedVisibleCount=ve.fromObservable(this._visibleCountObservable,this._store),this._allVisibleCheckedObservable=Ze("AllVisibleChecked",!1),this.onChangedAllVisibleChecked=ve.fromObservable(this._allVisibleCheckedObservable,this._store),this._checkedCountObservable=Ze("CheckedCount",0),this.onChangedCheckedCount=ve.fromObservable(this._checkedCountObservable,this._store),this._checkedElementsObservable=Lk({equalsFn:Fi},new Array),this.onChangedCheckedElements=ve.fromObservable(this._checkedElementsObservable,this._store),this._onButtonTriggered=new q,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new q,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._elementChecked=new q,this._elementCheckedEventBufferer=new oD,this._hasCheckboxes=!1,this._inputElements=new Array,this._elementTree=new Array,this._itemElements=new Array,this._elementDisposable=this._register(new ne),this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._shouldLoop=!0,this._container=he(this.parent,Nh(".quick-input-list")),this._separatorRenderer=new WP(t),this._itemRenderer=o.createInstance(BP,t),this._tree=this._register(o.createInstance(FP,"QuickInput",this._container,new NYe,[this._itemRenderer,this._separatorRenderer],{filter:{filter(a){return a.hidden?0:a instanceof pb?2:1}},sorter:{compare:(a,l)=>{if(!this.sortByLabel||!this._lastQueryString)return 0;const c=this._lastQueryString.toLowerCase();return RYe(a,l,c)}},accessibilityProvider:new DYe,setRowLineHeight:!1,multipleSelectionSupport:!1,hideTwistiesOfChildlessElements:!0,renderIndentGuides:hw.None,findWidgetEnabled:!1,indent:0,horizontalScrolling:!1,allowNonCollapsibleParents:!0,alwaysConsumeMouseWheel:!0})),this._tree.getHTMLElement().id=s,this._registerListeners()}get onDidChangeFocus(){return ve.map(this._tree.onDidChangeFocus,e=>e.elements.filter(t=>t instanceof Qs).map(t=>t.item),this._store)}get onDidChangeSelection(){return ve.map(this._tree.onDidChangeSelection,e=>({items:e.elements.filter(t=>t instanceof Qs).map(t=>t.item),event:e.browserEvent}),this._store)}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get scrollTop(){return this._tree.scrollTop}set scrollTop(e){this._tree.scrollTop=e}get ariaLabel(){return this._tree.ariaLabel}set ariaLabel(e){this._tree.ariaLabel=e??""}set enabled(e){this._tree.getHTMLElement().style.pointerEvents=e?"":"none"}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}get shouldLoop(){return this._shouldLoop}set shouldLoop(e){this._shouldLoop=e}_registerListeners(){this._registerOnKeyDown(),this._registerOnContainerClick(),this._registerOnMouseMiddleClick(),this._registerOnTreeModelChanged(),this._registerOnElementChecked(),this._registerOnContextMenu(),this._registerHoverListeners(),this._registerSelectionChangeListener(),this._registerSeparatorActionShowingListeners()}_registerOnKeyDown(){this._register(this._tree.onKeyDown(e=>{const t=new ui(e);switch(t.keyCode){case 10:this.toggleCheckbox();break}this._onKeyDown.fire(t)}))}_registerOnContainerClick(){this._register(J(this._container,_e.CLICK,e=>{(e.x||e.y)&&this._onLeave.fire()}))}_registerOnMouseMiddleClick(){this._register(J(this._container,_e.AUXCLICK,e=>{e.button===1&&this._onLeave.fire()}))}_registerOnTreeModelChanged(){this._register(this._tree.onDidChangeModel(()=>{const e=this._itemElements.filter(t=>!t.hidden).length;this._visibleCountObservable.set(e,void 0),this._hasCheckboxes&&this._updateCheckedObservables()}))}_registerOnElementChecked(){this._register(this._elementCheckedEventBufferer.wrapEvent(this._elementChecked.event,(e,t)=>t)(e=>this._updateCheckedObservables()))}_registerOnContextMenu(){this._register(this._tree.onContextMenu(e=>{e.element&&(e.browserEvent.preventDefault(),this._tree.setSelection([e.element]))}))}_registerHoverListeners(){const e=this._register(new Wge(typeof this.hoverDelegate.delay=="function"?this.hoverDelegate.delay():this.hoverDelegate.delay));this._register(this._tree.onMouseOver(async t=>{var i;if(cie(t.browserEvent.target)){e.cancel();return}if(!(!cie(t.browserEvent.relatedTarget)&&ys(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)))try{await e.trigger(async()=>{t.element instanceof Qs&&this.showHover(t.element)})}catch(s){if(!fl(s))throw s}})),this._register(this._tree.onMouseOut(t=>{var i;ys(t.browserEvent.relatedTarget,(i=t.element)==null?void 0:i.element)||e.cancel()}))}_registerSeparatorActionShowingListeners(){this._register(this._tree.onDidChangeFocus(e=>{const t=e.elements[0]?this._tree.getParentElement(e.elements[0]):null;for(const i of this._separatorRenderer.visibleSeparators){const s=i===t;!!(i.focusInsideSeparator&zh.ACTIVE_ITEM)!==s&&(s?i.focusInsideSeparator|=zh.ACTIVE_ITEM:i.focusInsideSeparator&=~zh.ACTIVE_ITEM,this._tree.rerender(i))}})),this._register(this._tree.onMouseOver(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&zh.MOUSE_HOVER)||(i.focusInsideSeparator|=zh.MOUSE_HOVER,this._tree.rerender(i))}})),this._register(this._tree.onMouseOut(e=>{const t=e.element?this._tree.getParentElement(e.element):null;for(const i of this._separatorRenderer.visibleSeparators){if(i!==t)continue;!!(i.focusInsideSeparator&zh.MOUSE_HOVER)&&(i.focusInsideSeparator&=~zh.MOUSE_HOVER,this._tree.rerender(i))}}))}_registerSelectionChangeListener(){this._register(this._tree.onDidChangeSelection(e=>{const t=e.elements.filter(i=>i instanceof Qs);t.length!==e.elements.length&&(e.elements.length===1&&e.elements[0]instanceof pb&&(this._tree.setFocus([e.elements[0].children[0]]),this._tree.reveal(e.elements[0],0)),this._tree.setSelection(t))}))}setAllVisibleChecked(e){this._elementCheckedEventBufferer.bufferEvents(()=>{this._itemElements.forEach(t=>{!t.hidden&&!t.checkboxDisabled&&t.item.pickable!==!1&&(t.checked=e)})})}setElements(e){this._elementDisposable.clear(),this._lastQueryString=void 0,this._inputElements=e,this._hasCheckboxes=this.parent.classList.contains("show-checkboxes");let t;this._itemElements=new Array,this._elementTree=e.reduce((i,s,o)=>{let r;if(s.type==="separator"){if(!s.buttons)return i;t=new pb(o,a=>this._onSeparatorButtonTriggered.fire(a),s),r=t}else{const a=o>0?e[o-1]:void 0;let l;a&&a.type==="separator"&&!a.buttons&&(l=a);const c=new Qs(o,t!=null&&t.children?t.children.length:o,this._hasCheckboxes&&s.pickable!==!1,d=>this._onButtonTriggered.fire(d),this._elementChecked,s,l);if(this._itemElements.push(c),t)return t.children.push(c),i;r=c}return i.push(r),i},new Array),this._setElementsToTree(this._elementTree),this.accessibilityService.isScreenReaderOptimized()&&setTimeout(()=>{const i=this._tree.getHTMLElement().querySelector(".monaco-list-row.focused"),s=i==null?void 0:i.parentNode;if(i&&s){const o=i.nextSibling;i.remove(),s.insertBefore(i,o)}},0)}setFocusedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i).filter(i=>!i.hidden);if(this._tree.setFocus(t),e.length>0){const i=this._tree.getFocus()[0];i&&this._tree.reveal(i)}}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){const t=e.map(i=>this._itemElements.find(s=>s.item===i)).filter(i=>!!i);this._tree.setSelection(t)}getCheckedElements(){return this._itemElements.filter(e=>e.checked).map(e=>e.item)}setCheckedElements(e){this._elementCheckedEventBufferer.bufferEvents(()=>{const t=new Set;for(const i of e)t.add(i);for(const i of this._itemElements)i.checked=t.has(i.item)})}focus(e){var t;if(this._itemElements.length)switch(e===Ii.Second&&this._itemElements.length<2&&(e=Ii.First),e){case Ii.First:this._tree.scrollTop=0,this._tree.focusFirst(void 0,i=>i.element instanceof Qs);break;case Ii.Second:{this._tree.scrollTop=0;let i=!1;this._tree.focusFirst(void 0,s=>s.element instanceof Qs?i?!0:(i=!i,!1):!1);break}case Ii.Last:this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,i=>i.element instanceof Qs);break;case Ii.Next:{const i=this._tree.getFocus();this._tree.focusNext(void 0,this._shouldLoop,void 0,o=>o.element instanceof Qs?(this._tree.reveal(o.element),!0):!1);const s=this._tree.getFocus();i.length&&i[0]===s[0]&&this._onLeave.fire();break}case Ii.Previous:{const i=this._tree.getFocus();this._tree.focusPrevious(void 0,this._shouldLoop,void 0,o=>{if(!(o.element instanceof Qs))return!1;const r=this._tree.getParentElement(o.element);return r===null||r.children[0]!==o.element?this._tree.reveal(o.element):this._tree.reveal(r),!0});const s=this._tree.getFocus();i.length&&i[0]===s[0]&&this._onLeave.fire();break}case Ii.NextPage:this._tree.focusNextPage(void 0,i=>i.element instanceof Qs?(this._tree.reveal(i.element),!0):!1);break;case Ii.PreviousPage:this._tree.focusPreviousPage(void 0,i=>{if(!(i.element instanceof Qs))return!1;const s=this._tree.getParentElement(i.element);return s===null||s.children[0]!==i.element?this._tree.reveal(i.element):this._tree.reveal(s),!0});break;case Ii.NextSeparator:{let i=!1;const s=this._tree.getFocus()[0];this._tree.focusNext(void 0,!0,void 0,r=>{if(i)return!0;if(r.element instanceof pb)i=!0,this._separatorRenderer.isSeparatorVisible(r.element)?this._tree.reveal(r.element.children[0]):this._tree.reveal(r.element,0);else if(r.element instanceof Qs){if(r.element.separator)return this._itemRenderer.isItemWithSeparatorVisible(r.element)?this._tree.reveal(r.element):this._tree.reveal(r.element,0),!0;if(r.element===this._elementTree[0])return this._tree.reveal(r.element,0),!0}return!1});const o=this._tree.getFocus()[0];s===o&&(this._tree.scrollTop=this._tree.scrollHeight,this._tree.focusLast(void 0,r=>r.element instanceof Qs));break}case Ii.PreviousSeparator:{let i,s=!!((t=this._tree.getFocus()[0])!=null&&t.separator);this._tree.focusPrevious(void 0,!0,void 0,o=>{if(o.element instanceof pb)s?i||(this._separatorRenderer.isSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element.children[0]):s=!0;else if(o.element instanceof Qs&&!i){if(o.element.separator)this._itemRenderer.isItemWithSeparatorVisible(o.element)?this._tree.reveal(o.element):this._tree.reveal(o.element,0),i=o.element;else if(o.element===this._elementTree[0])return this._tree.reveal(o.element,0),!0}return!1}),i&&this._tree.setFocus([i]);break}}}clearFocus(){this._tree.setFocus([])}domFocus(){this._tree.domFocus()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}filter(e){if(this._lastQueryString=e,!(this._sortByLabel||this._matchOnLabel||this._matchOnDescription||this._matchOnDetail))return this._tree.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this._itemElements.forEach(i=>{i.labelHighlights=void 0,i.descriptionHighlights=void 0,i.detailHighlights=void 0,i.hidden=!1;const s=i.index&&this._inputElements[i.index-1];i.item&&(i.separator=s&&s.type==="separator"&&!s.buttons?s:void 0)});else{let i;this._itemElements.forEach(s=>{let o;this.matchOnLabelMode==="fuzzy"?o=this.matchOnLabel?Tk(e,dv(s.saneLabel))??void 0:void 0:o=this.matchOnLabel?TYe(t,dv(s.saneLabel))??void 0:void 0;const r=this.matchOnDescription?Tk(e,dv(s.saneDescription||""))??void 0:void 0,a=this.matchOnDetail?Tk(e,dv(s.saneDetail||""))??void 0:void 0;if(o||r||a?(s.labelHighlights=o,s.descriptionHighlights=r,s.detailHighlights=a,s.hidden=!1):(s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=s.item?!s.item.alwaysShow:!0),s.item?s.separator=void 0:s.separator&&(s.hidden=!0),!this.sortByLabel){const l=s.index&&this._inputElements[s.index-1]||void 0;(l==null?void 0:l.type)==="separator"&&!l.buttons&&(i=l),i&&!s.hidden&&(s.separator=i,i=void 0)}})}return this._setElementsToTree(this._sortByLabel&&e?this._itemElements:this._elementTree),this._tree.layout(),!0}toggleCheckbox(){this._elementCheckedEventBufferer.bufferEvents(()=>{const e=this._tree.getFocus().filter(i=>i instanceof Qs),t=this._allVisibleChecked(e);for(const i of e)i.checkboxDisabled||(i.checked=!t)})}style(e){this._tree.style(e)}toggleHover(){const e=this._tree.getFocus()[0];if(!(e!=null&&e.saneTooltip)||!(e instanceof Qs))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}this.showHover(e);const t=new ne;t.add(this._tree.onDidChangeFocus(i=>{i.elements[0]instanceof Qs&&this.showHover(i.elements[0])})),this._lastHover&&t.add(this._lastHover),this._elementDisposable.add(t)}_setElementsToTree(e){const t=new Array;for(const i of e)i instanceof pb?t.push({element:i,collapsible:!1,collapsed:!1,children:i.children.map(s=>({element:s,collapsible:!1,collapsed:!1}))}):t.push({element:i,collapsible:!1,collapsed:!1});this._tree.setChildren(null,t)}_allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{this._allVisibleCheckedObservable.set(this._allVisibleChecked(this._itemElements,!1),e);const t=this._itemElements.filter(i=>i.checked).length;this._checkedCountObservable.set(t,e),this._checkedElementsObservable.set(this.getCheckedElements(),e)})}showHover(e){var t,i,s;this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.hoverDelegate).onDidHideHover)==null||i.call(t),(s=this._lastHover)==null||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.linkOpenerDelegate(o)},appearance:{showPointer:!0},container:this._container,position:{hoverPosition:1}},!1))}};V3([wn],sN.prototype,"onDidChangeFocus",null);V3([wn],sN.prototype,"onDidChangeSelection",null);sN=V3([oj(4,Ae),oj(5,Us)],sN);function TYe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return fre(n,t);const s=rD(t," "),o=t.length-s.length,r=fre(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function fre(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function RYe(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:BGe(n.saneSortLabel,e.saneSortLabel,t)}function MYe(n,e={}){As.registerCommandAndKeybindingRule({weight:200,when:A3,metadata:{description:_(1758,"Used while in the context of any kind of quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...n,secondary:eX(n.primary,n.secondary??[],e)})}function Or(n,e={}){As.registerCommandAndKeybindingRule({weight:200,when:le.and(le.or(le.equals(JE,"quickPick"),le.equals(JE,"quickTree")),A3),metadata:{description:_(1759,"Used while in the context of the quick pick. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},...n,secondary:eX(n.primary,n.secondary??[],e)})}const oN=yt?256:2048;function eX(n,e,t={}){return t.withAltMod&&e.push(512+n),t.withCtrlMod&&(e.push(oN+n),t.withAltMod&&e.push(512+oN+n)),t.withCmdMod&&yt&&(e.push(2048+n),t.withCtrlMod&&e.push(2304+n),t.withAltMod&&(e.push(2560+n),t.withCtrlMod&&e.push(2816+n))),e}function $a(n,e){return t=>{const i=t.get(No).currentQuickInput;if(i)return e&&i.quickNavigate?i.focus(e):i.focus(n)}}Or({id:"quickInput.pageNext",primary:12,handler:$a(Ii.NextPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Or({id:"quickInput.pagePrevious",primary:11,handler:$a(Ii.PreviousPage)},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Or({id:"quickInput.first",primary:oN+14,handler:$a(Ii.First)},{withAltMod:!0,withCmdMod:!0});Or({id:"quickInput.last",primary:oN+13,handler:$a(Ii.Last)},{withAltMod:!0,withCmdMod:!0});Or({id:"quickInput.next",primary:18,handler:$a(Ii.Next)},{withCtrlMod:!0});Or({id:"quickInput.previous",primary:16,handler:$a(Ii.Previous)},{withCtrlMod:!0});const gre=_(1760,"If we're in quick access mode, this will navigate to the next item. If we are not in quick access mode, this will navigate to the next separator."),pre=_(1761,"If we're in quick access mode, this will navigate to the previous item. If we are not in quick access mode, this will navigate to the previous separator.");yt?(Or({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:2066,handler:$a(Ii.NextSeparator,Ii.Next),metadata:{description:gre}}),Or({id:"quickInput.nextSeparator",primary:2578,secondary:[2322],handler:$a(Ii.NextSeparator)},{withCtrlMod:!0}),Or({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:2064,handler:$a(Ii.PreviousSeparator,Ii.Previous),metadata:{description:pre}}),Or({id:"quickInput.previousSeparator",primary:2576,secondary:[2320],handler:$a(Ii.PreviousSeparator)},{withCtrlMod:!0})):(Or({id:"quickInput.nextSeparatorWithQuickAccessFallback",primary:530,handler:$a(Ii.NextSeparator,Ii.Next),metadata:{description:gre}}),Or({id:"quickInput.nextSeparator",primary:2578,handler:$a(Ii.NextSeparator)}),Or({id:"quickInput.previousSeparatorWithQuickAccessFallback",primary:528,handler:$a(Ii.PreviousSeparator,Ii.Previous),metadata:{description:pre}}),Or({id:"quickInput.previousSeparator",primary:2576,handler:$a(Ii.PreviousSeparator)}));As.registerCommandAndKeybindingRule({id:"quickInput.accept",primary:3,weight:200,when:le.and(le.notEquals(JE,"quickWidget"),A3,le.not("isComposing")),metadata:{description:_(1762,"Used while in the context of some quick input. If you change one keybinding for this command, you should change all of the other keybindings (modifier variants) of this command as well.")},handler:n=>{const e=n.get(No).currentQuickInput;e==null||e.accept()},secondary:eX(3,[],{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0})});Or({id:"quickInput.acceptInBackground",when:le.and(A3,le.equals(JE,"quickPick"),le.or($Z.negate(),eGe)),primary:17,weight:250,handler:n=>{const e=n.get(No).currentQuickInput;e==null||e.accept(!0)}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});MYe({id:"quickInput.hide",primary:9,handler:n=>{const e=n.get(No).currentQuickInput;e==null||e.hide()}},{withAltMod:!0,withCtrlMod:!0,withCmdMod:!0});Or({id:"quickInput.toggleHover",primary:oN|10,handler:n=>{n.get(No).toggleHover()}});var AYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},PYe=function(n,e){return function(t,i){e(t,i,n)}},aj;const rL=me;var jv;let HP=(jv=class extends G{constructor(e,t,i,s){super(),this._hoverDelegate=e,this._buttonTriggeredEmitter=t,this.onCheckedEvent=i,this._themeService=s,this.templateId=aj.ID}renderTemplate(e){const t=new ne,i=he(e,rL(".quick-input-tree-entry")),s=t.add(new dve("",!1,{...TZ,size:15}));i.appendChild(s.domNode);const o=he(i,rL("label.quick-input-tree-label")),r=he(o,rL(".quick-input-tree-rows")),a=he(r,rL(".quick-input-tree-row")),l=V5(a,rL(".quick-input-tree-icon")),c=t.add(new tN(a,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0,hoverDelegate:this._hoverDelegate})),d=t.add(new jr(i,this._hoverDelegate?{hoverDelegate:this._hoverDelegate}:void 0));return d.domNode.classList.add("quick-input-tree-entry-action-bar"),{toDisposeTemplate:t,entry:i,checkbox:s,icon:l,label:c,actionBar:d,toDisposeElement:new ne}}renderElement(e,t,i,s){const o=i.toDisposeElement,r=e.element;if(r.pickable===!1?i.checkbox.domNode.style.display="none":(i.checkbox.domNode.style.display="",i.checkbox.checked=r.checked??!1,o.add(ve.filter(this.onCheckedEvent,h=>h.item===r)(h=>i.checkbox.checked=h.checked)),r.disabled&&i.checkbox.disable()),r.iconPath){const h=Ng(this._themeService.getColorTheme().type)?r.iconPath.dark:r.iconPath.light??r.iconPath.dark,u=He.revive(h);i.icon.className="quick-input-tree-icon",i.icon.style.backgroundImage=xu(u)}else i.icon.style.backgroundImage="",i.icon.className=r.iconClass?`quick-input-tree-icon ${r.iconClass}`:"";const{labelHighlights:a,descriptionHighlights:l}=e.filterData||{};let c;r.description&&(c={markdown:{value:zc(r.description),supportThemeIcons:!0},markdownNotSupportedFallback:r.description}),i.label.setLabel(r.label,r.description,{matches:a,descriptionMatches:l,extraClasses:r.iconClasses,italic:r.italic,strikethrough:r.strikethrough,labelEscapeNewLines:!0,descriptionTitle:c});const d=r.buttons;d&&d.length?(i.actionBar.push(d.map((h,u)=>by(h,`tree-${u}`,()=>this._buttonTriggeredEmitter.fire({item:r,button:h}))),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i,s){i.toDisposeElement.clear(),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement.dispose(),e.toDisposeTemplate.dispose()}},aj=jv,jv.ID="quickInputTreeElement",jv);HP=aj=AYe([PYe(3,en)],HP);class OYe{getHeight(e){return 22}getTemplateId(e){return HP.ID}}function FYe(n){var o;let e=!1,t=!1,i=!1;for(const r of n){switch((o=r.element)==null?void 0:o.checked){case"mixed":i=!0;break;case!0:e=!0;break;default:t=!0;break}if(e&&t&&i)break}return t?i||e?"mixed":!1:i?"mixed":e}class BYe{constructor(e){this.onCheckedEvent=e}getWidgetAriaLabel(){return _(1772,"Quick Tree")}getAriaLabel(e){return e.ariaLabel||[e.label,e.description].map(t=>fbe(t)).filter(t=>!!t).join(", ")}getWidgetRole(){return"tree"}getRole(e){return"checkbox"}isChecked(e){return{get value(){return e.checked==="mixed"?"mixed":!!e.checked},onDidChange:t=>ve.filter(this.onCheckedEvent,i=>i.item===e)(i=>t())}}}class WYe{constructor(){this.filterValue="",this.matchOnLabel=!0,this.matchOnDescription=!1}filter(e,t){if(!this.filterValue||!(this.matchOnLabel||this.matchOnDescription))return e.children?{visibility:2,data:{}}:{visibility:1,data:{}};const i=this.matchOnLabel?Tk(this.filterValue,dv(e.label))??void 0:void 0,s=this.matchOnDescription?Tk(this.filterValue,dv(e.description||""))??void 0:void 0;return{visibility:t===1||i||s?1:e.children?2:0,data:{labelHighlights:i,descriptionHighlights:s}}}}class HYe extends G{constructor(){super(...arguments),this._sortByLabel=!0}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e}compare(e,t){if(!this._sortByLabel)return 0;if(e.labelt.label)return 1;if(e.description&&t.description){if(e.descriptiont.description)return 1}else{if(e.description)return-1;if(t.description)return 1}return 0}}var VYe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zYe=function(n,e){return function(t,i){e(t,i,n)}};const jYe=me;let lj=class extends G{constructor(e,t,i){super(),this.instantiationService=i,this._onDidTriggerButton=this._register(new q),this._onDidChangeCheckboxState=this._register(new q),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidCheckedLeafItemsChange=this._register(new q),this._onLeave=new q,this.onLeave=this._onLeave.event,this._onDidAccept=this._register(new q),this.onDidAccept=this._onDidAccept.event,this._container=he(e,jYe(".quick-input-tree")),this._renderer=this._register(this.instantiationService.createInstance(HP,t,this._onDidTriggerButton,this.onDidChangeCheckboxState)),this._filter=this.instantiationService.createInstance(WYe),this._sorter=this._register(new HYe),this._tree=this._register(this.instantiationService.createInstance(FP,"QuickInputTree",this._container,new OYe,[this._renderer],{accessibilityProvider:new BYe(this.onDidChangeCheckboxState),horizontalScrolling:!1,multipleSelectionSupport:!1,findWidgetEnabled:!1,alwaysConsumeMouseWheel:!0,hideTwistiesOfChildlessElements:!0,renderIndentGuides:hw.None,expandOnDoubleClick:!0,expandOnlyOnTwistieClick:!0,disableExpandOnSpacebar:!0,sorter:this._sorter,filter:this._filter})),this.registerOnOpenListener()}get tree(){return this._tree}get displayed(){return this._container.style.display!=="none"}set displayed(e){this._container.style.display=e?"":"none"}get sortByLabel(){return this._sorter.sortByLabel}set sortByLabel(e){this._sorter.sortByLabel=e,this._tree.resort(null,!0)}getActiveDescendant(){return this._tree.getHTMLElement().getAttribute("aria-activedescendant")}updateFilterOptions(e){e.matchOnLabel!==void 0&&(this._filter.matchOnLabel=e.matchOnLabel),e.matchOnDescription!==void 0&&(this._filter.matchOnDescription=e.matchOnDescription),this._tree.refilter()}layout(e){this._tree.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this._tree.layout()}registerOnOpenListener(){this._register(this._tree.onDidOpen(e=>{const t=e.element;if(!t||t.disabled)return;if(t.pickable===!1){this._tree.setFocus([t]),this._onDidAccept.fire();return}const i=t.checked!==!0;if((t.checked??!1)===i)return;t.checked=i,this._tree.rerender(t);const s=new Set,o=[...this._tree.getNode(t).children];for(;o.length;){const a=o.shift();a!=null&&a.element&&!s.has(a.element)&&(s.add(a.element),(a.element.checked??!1)!==t.checked&&(a.element.checked=t.checked,this._tree.rerender(a.element)),o.push(...a.children))}let r=this._tree.getParentElement(t);for(;r;){const a=[...this._tree.getNode(r).children],l=FYe(a);(r.checked??!1)!==l&&(r.checked=l,this._tree.rerender(r)),r=this._tree.getParentElement(r)}this._onDidChangeCheckboxState.fire({item:t,checked:t.checked??!1}),this._onDidCheckedLeafItemsChange.fire(this.getCheckedLeafItems())}))}getCheckedLeafItems(){const e=new Set,t=[...this._tree.getNode().children],i=new Array;for(;t.length;){const s=t.shift();!(s!=null&&s.element)||e.has(s.element)||s.element.checked&&(e.add(s.element),t.push(...s.children),s.element.children||i.push(s.element))}return i}};lj=VYe([zYe(2,Ae)],lj);var jve=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fv=function(n,e){return function(t,i){e(t,i,n)}},cj;const Ma=me,F9="workbench.quickInput.viewState";var $v;let dj=($v=class extends G{get currentQuickInput(){return this.controller??void 0}get container(){return this._container}constructor(e,t,i,s,o){super(),this.options=e,this.layoutService=t,this.instantiationService=i,this.storageService=o,this.enabled=!0,this.onDidAcceptEmitter=this._register(new q),this.onDidCustomEmitter=this._register(new q),this.onDidTriggerButtonEmitter=this._register(new q),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new q),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new q),this.onHide=this.onHideEmitter.event,this.inQuickInputContext=YKe.bindTo(s),this.quickInputTypeContext=QKe.bindTo(s),this.endOfQuickInputBoxContext=JKe.bindTo(s),this.idPrefix=e.idPrefix,this._container=e.container,this.styles=e.styles,this._register(ve.runAndSubscribe(hD,({window:r,disposables:a})=>this.registerKeyModsListeners(r,a),{window:ri,disposables:this._store})),this._register(zOe(r=>{this.ui&&Pe(this.ui.container)===r&&(this.reparentUI(this.layoutService.mainContainer),this.layout(this.layoutService.mainContainerDimension,this.layoutService.mainContainerOffset.quickPickTop))})),this.viewState=this.loadViewState()}registerKeyModsListeners(e,t){const i=s=>{this.keyMods.ctrlCmd=s.ctrlKey||s.metaKey,this.keyMods.alt=s.altKey};for(const s of[_e.KEY_DOWN,_e.KEY_UP,_e.MOUSE_DOWN])t.add(J(e,s,i,!0))}getUI(e){if(this.ui)return e&&Pe(this._container)!==Pe(this.layoutService.activeContainer)&&(this.reparentUI(this.layoutService.activeContainer),this.layout(this.layoutService.activeContainerDimension,this.layoutService.activeContainerOffset.quickPickTop)),this.ui;const t=he(this._container,Ma(".quick-input-widget.show-file-icons"));t.tabIndex=-1,t.style.display="none";const i=sc(t),s=he(t,Ma(".quick-input-titlebar")),o=this._register(new jr(s,{hoverDelegate:this.options.hoverDelegate}));o.domNode.classList.add("quick-input-left-action-bar");const r=he(s,Ma(".quick-input-title")),a=this._register(new jr(s,{hoverDelegate:this.options.hoverDelegate}));a.domNode.classList.add("quick-input-right-action-bar");const l=he(t,Ma(".quick-input-header")),c=this._register(new dve(_(1763,"Toggle all checkboxes"),!1,{...TZ,size:15}));he(l,c.domNode),this._register(c.onChange(()=>{const B=c.checked;A.setAllVisibleChecked(B===!0)})),this._register(J(c.domNode,_e.CLICK,B=>{(B.x||B.y)&&f.setFocus()}));const d=he(l,Ma(".quick-input-description")),h=he(l,Ma(".quick-input-and-message")),u=he(h,Ma(".quick-input-filter")),f=this._register(new mGe(u,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=he(u,Ma(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=this._register(new Zz(g,{countFormat:_(1764,"{0} Results")},this.styles.countBadge)),m=he(u,Ma(".quick-input-count"));m.setAttribute("aria-live","polite");const b=this._register(new Zz(m,{countFormat:_(1765,"{0} Selected")},this.styles.countBadge)),v=this._register(new jr(l,{hoverDelegate:this.options.hoverDelegate}));v.domNode.classList.add("quick-input-inline-action-bar");const w=he(l,Ma(".quick-input-action")),C=this._register(new IP(w,this.styles.button));C.label=_(1766,"OK"),this._register(C.onDidClick(B=>{this.onDidAcceptEmitter.fire()}));const S=he(l,Ma(".quick-input-action")),L=this._register(new IP(S,{...this.styles.button,supportIcons:!0}));L.label=_(1767,"Custom"),this._register(L.onDidClick(B=>{this.onDidCustomEmitter.fire()}));const x=he(h,Ma(`#${this.idPrefix}message.quick-input-message`)),I=this._register(new Xz(t,this.styles.progressBar));I.getContainer().classList.add("quick-input-progress");const E=he(t,Ma(".quick-input-html-widget"));E.tabIndex=-1;const R=he(t,Ma(".quick-input-description")),M=this.idPrefix+"list",A=this._register(this.instantiationService.createInstance(sN,t,this.options.hoverDelegate,this.options.linkOpenerDelegate,M));f.setAttribute("aria-controls",M),this._register(A.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute("aria-activedescendant",A.getActiveDescendant()??"")})),this._register(A.onChangedAllVisibleChecked(B=>{c.checked=B})),this._register(A.onChangedVisibleCount(B=>{p.setCount(B)})),this._register(A.onChangedCheckedCount(B=>{sD(()=>b.setCount(B))})),this._register(A.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),this.controller instanceof Fk&&this.controller.canSelectMany&&A.clearFocus())},0)}));const W=this._register(this.instantiationService.createInstance(lj,t,this.options.hoverDelegate));this._register(W.tree.onDidChangeFocus(()=>{f.hasFocus()&&f.setAttribute("aria-activedescendant",W.getActiveDescendant()??"")})),this._register(W.onLeave(()=>{setTimeout(()=>{this.controller&&(f.setFocus(),W.tree.setFocus([]))},0)})),this._register(W.onDidAccept(()=>{this.onDidAcceptEmitter.fire()})),this._register(W.tree.onDidChangeContentHeight(()=>this.updateLayout()));const P=tc(t);return this._register(P),this._register(J(t,_e.FOCUS,B=>{const V=this.getUI();if(ys(B.relatedTarget,V.inputContainer)){const K=V.inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==K&&this.endOfQuickInputBoxContext.set(K)}ys(B.relatedTarget,V.container)||(this.inQuickInputContext.set(!0),this.previousFocusElement=hn(B.relatedTarget)?B.relatedTarget:void 0)},!0)),this._register(P.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(GE.Blur),this.inQuickInputContext.set(!1),this.endOfQuickInputBoxContext.set(!1),this.previousFocusElement=void 0})),this._register(f.onKeyDown(B=>{const V=this.getUI().inputBox.isSelectionAtEnd();this.endOfQuickInputBoxContext.get()!==V&&this.endOfQuickInputBoxContext.set(V),f.removeAttribute("aria-activedescendant")})),this._register(J(t,_e.FOCUS,B=>{f.setFocus()})),this.dndController=this._register(this.instantiationService.createInstance(hj,this._container,t,[{node:s,includeChildren:!0},{node:l,includeChildren:!1}],this.viewState)),this._register(qe(B=>{var K;const V=(K=this.dndController)==null?void 0:K.dndViewState.read(B);V&&(V.top!==void 0&&V.left!==void 0?this.viewState={...this.viewState,top:V.top,left:V.left}:this.viewState=void 0,this.updateLayout(),V.done&&this.saveViewState(this.viewState))})),this.ui={container:t,styleSheet:i,leftActionBar:o,titleBar:s,title:r,description1:R,description2:d,widget:E,rightActionBar:a,inlineActionBar:v,checkAll:c,inputContainer:h,filterContainer:u,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:m,count:b,okContainer:w,ok:C,message:x,customButtonContainer:S,customButton:L,list:A,tree:W,progressBar:I,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:B=>this.show(B),hide:()=>this.hide(),setVisibilities:B=>this.setVisibilities(B),setEnabled:B=>this.setEnabled(B),setContextKey:B=>this.options.setContextKey(B),linkOpenerDelegate:B=>this.options.linkOpenerDelegate(B)},this.updateStyles(),this.ui}reparentUI(e){var t;this.ui&&(this._container=e,he(this._container,this.ui.container),(t=this.dndController)==null||t.reparentUI(this._container))}pick(e,t={},i=wt.None){return new Promise((s,o)=>{let r=d=>{var h;r=s,(h=t.onKeyMods)==null||h.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick({useSeparators:!0});let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const h=d[0];h&&t.onDidFocus&&t.onDidFocus(h)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const h=d[0];h&&(r(h),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton({...d,removeItem:()=>{const h=a.items.indexOf(d.item);if(h!==-1){const u=a.items.slice(),f=u.splice(h,1),g=a.activeItems.filter(m=>m!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=u,g&&(a.activeItems=g),a.keepScrollPosition=p}}})),a.onDidTriggerSeparatorButton(d=>{var h;return(h=t.onDidTriggerSeparatorButton)==null?void 0:h.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{ei(c),r(void 0)})];a.title=t.title,t.value&&(a.value=t.value),a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.prompt=t.prompt,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,t.sortByLabel!==void 0&&(a.sortByLabel=t.sortByLabel),a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,h])=>{l=h,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(u=>u.type!=="separator"&&u.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}setValidationOnInput(e,t){t&&Cs(t)?(e.severity=Yi.Error,e.validationMessage=t):t&&!Cs(t)?(e.severity=t.severity,e.validationMessage=t.content):(e.severity=Yi.Ignore,e.validationMessage=void 0)}input(e={},t=wt.None){return new Promise(i=>{if(t.isCancellationRequested){i(void 0);return}const s=this.createInputBox(),o=e.validateInput||(()=>Promise.resolve(void 0)),r=ve.debounce(s.onDidChangeValue,(d,h)=>h,100);let a=e.value||"",l=Promise.resolve(o(a));const c=[s,r(d=>{d!==a&&(l=Promise.resolve(o(d)),a=d),l.then(h=>{d===a&&this.setValidationOnInput(s,h)})}),s.onDidAccept(()=>{const d=s.value;d!==a&&(l=Promise.resolve(o(d)),a=d),l.then(h=>{!h||!Cs(h)&&h.severity!==Yi.Error?(i(d),s.hide()):d===a&&this.setValidationOnInput(s,h)})}),t.onCancellationRequested(()=>{s.hide()}),s.onDidHide(()=>{ei(c),i(void 0)})];s.title=e.title,s.value=e.value||"",s.valueSelection=e.valueSelection,s.prompt=e.prompt,s.placeholder=e.placeHolder,s.password=!!e.password,s.ignoreFocusOut=!!e.ignoreFocusLost,s.show()})}createQuickPick(e={useSeparators:!1}){const t=this.getUI(!0);return new Fk(t)}createInputBox(){const e=this.getUI(!0);return new tGe(e)}show(e){var o;const t=this.getUI(!0);this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",Ss(t.widget),t.rightActionBar.clear(),t.inlineActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(Yi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),Ss(t.message),t.progressBar.stop(),t.progressBar.getContainer().setAttribute("aria-hidden","true"),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.tree.updateFilterOptions({matchOnDescription:!1,matchOnLabel:!0}),t.tree.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();Gz.tooltip=s?_(1768,"Back ({0})",s):_(1769,"Back"),t.container.style.display="",this.updateLayout(),(o=this.dndController)==null||o.layoutContainer(),t.inputBox.setFocus(),this.quickInputTypeContext.set(e.type)}isVisible(){return!!this.ui&&this.ui.container.style.display!=="none"}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.domNode.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.displayed=!!e.list,t.tree.displayed=!!e.tree,t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;const t=this.getUI();for(const i of t.leftActionBar.viewItems)i.action.enabled=e;for(const i of t.rightActionBar.viewItems)i.action.enabled=e;e?t.checkAll.enable():t.checkAll.disable(),t.inputBox.enabled=e,t.ok.enabled=e,t.list.enabled=e}}hide(e){var o;const t=this.controller;if(!t)return;t.willHide(e);const i=(o=this.ui)==null?void 0:o.container,s=i&&!ipe(i);if(this.controller=null,this.onHideEmitter.fire(),i&&(i.style.display="none"),!s){let r=this.previousFocusElement;for(;r&&!r.offsetParent;)r=r.parentElement??void 0;r!=null&&r.offsetParent?(r.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}t.didHide(e)}toggleHover(){this.isVisible()&&this.controller instanceof Fk&&this.getUI().list.toggleHover()}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){var e,t;if(this.ui&&this.isVisible()){const i=this.ui.container.style,s=Math.min(this.dimension.width*.62,cj.MAX_WIDTH);i.width=s+"px",i.top=`${(e=this.viewState)!=null&&e.top?Math.round(this.dimension.height*this.viewState.top):this.titleBarOffset}px`,i.left=`${Math.round(this.dimension.width*(((t=this.viewState)==null?void 0:t.left)??.5)-s/2)}px`,this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4),this.ui.tree.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list),this.ui.tree.tree.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}loadViewState(){try{const e=JSON.parse(this.storageService.get(F9,-1,"{}"));if(e.top!==void 0||e.left!==void 0)return e}catch{}}saveViewState(e){this.layoutService.activeContainer===this.layoutService.mainContainer&&(e!==void 0?this.storageService.store(F9,JSON.stringify(e),-1,1):this.storageService.remove(F9,-1))}},cj=$v,$v.MAX_WIDTH=600,$v);dj=cj=jve([fv(1,Au),fv(2,Ae),fv(3,Xe),fv(4,Jo)],dj);let hj=class extends G{constructor(e,t,i,s,o,r,a){super(),this._container=e,this._quickInputContainer=t,this._quickInputDragAreas=i,this._layoutService=o,this.configurationService=a,this.dndViewState=Ze(this,void 0),this._snapThreshold=20,this._snapLineHorizontalRatio=.25,this._quickInputAlignmentContext=XKe.bindTo(r);const l=kKe(this.configurationService)==="custom";this._controlsOnLeft=l&&d7===1,this._controlsOnRight=l&&(d7===3||d7===2),this._registerLayoutListener(),this.registerMouseListeners(),this.dndViewState.set({...s,done:!0},void 0)}reparentUI(e){this._container=e}layoutContainer(e=this._layoutService.activeContainerDimension){const t=this.dndViewState.get(),i=this._quickInputContainer.getBoundingClientRect();if(t!=null&&t.top&&(t!=null&&t.left)){const s=Math.round(t.left*100)/100,o=e.width,r=i.width,a=s*o-r/2;this._layout(t.top*e.height,a)}}_registerLayoutListener(){this._register(ve.filter(this._layoutService.onDidLayoutContainer,e=>e.container===this._container)(e=>this.layoutContainer(e.dimension)))}registerMouseListeners(){const e=this._quickInputContainer;this._register(lie(e,t=>{const i=new lo(Pe(e),t);i.detail===2&&this._quickInputDragAreas.some(({node:s,includeChildren:o})=>o?ys(i.target,s):i.target===s)&&this.dndViewState.set({top:void 0,left:void 0,done:!0},void 0)})),this._register(Qge(e,t=>{const i=Pe(this._layoutService.activeContainer),s=new lo(i,t);if(!this._quickInputDragAreas.some(({node:h,includeChildren:u})=>u?ys(s.target,h):s.target===h))return;const o=this._quickInputContainer.getBoundingClientRect(),r=s.browserEvent.clientX-o.left,a=s.browserEvent.clientY-o.top;let l=!1;const c=KOe(i,h=>{new lo(i,h).preventDefault(),l||(l=!0),this._layout(h.clientY-a,h.clientX-r)}),d=lie(i,h=>{if(l){const u=this.dndViewState.get();this.dndViewState.set({top:u==null?void 0:u.top,left:u==null?void 0:u.left,done:!0},void 0)}c.dispose(),d.dispose()})}))}_layout(e,t){const i=this._getTopSnapValue(),s=this._getCenterYSnapValue(),o=this._getCenterXSnapValue();e=Math.max(0,Math.min(e,this._container.clientHeight-this._quickInputContainer.clientHeight)),e=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aL=function(n,e){return function(t,i){e(t,i,n)}};let uj=class extends c6e{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get currentQuickInput(){return this.controller.currentQuickInput}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(Kz))),this._quickAccess}constructor(e,t,i,s,o){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this.configurationService=o,this._onShow=this._register(new q),this._onHide=this._register(new q),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.activeContainer,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(jg).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),styles:this.computeStyles(),hoverDelegate:this._register(this.instantiationService.createInstance(Yz))},s=this._register(this.instantiationService.createInstance(dj,{...i,...t}));return s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop),this._register(e.onDidLayoutActiveContainer(o=>{Pe(e.activeContainer)===Pe(s.container)&&s.layout(o,e.activeContainerOffset.quickPickTop)})),this._register(e.onDidChangeActiveContainer(()=>{s.isVisible()||s.layout(e.activeContainerDimension,e.activeContainerOffset.quickPickTop)})),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new Se(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t,i=wt.None){return this.controller.pick(e,t,i)}input(e={},t=wt.None){return this.controller.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.controller.createQuickPick(e)}createInputBox(){return this.controller.createInputBox()}toggleHover(){this.hasController&&this.controller.toggleHover()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:ge(O7),quickInputForeground:ge(P7e),quickInputTitleBackground:ge(O7e),widgetBorder:ge(SY),widgetShadow:ge(ix)},inputBox:yP,toggle:CP,countBadge:ive,button:vKe,progressBar:wKe,keybindingLabel:tve,list:Ww({listBackground:O7,listFocusBackground:NE,listFocusForeground:EE,listInactiveFocusForeground:EE,listInactiveSelectionIconForeground:NY,listInactiveFocusBackground:NE,listFocusOutline:Hi,listInactiveFocusOutline:Hi,treeStickyScrollBackground:O7}),pickerGroup:{pickerGroupBorder:ge(F7e),pickerGroupForeground:ge(_me)}}}};uj=$Ye([aL(0,Ae),aL(1,Xe),aL(2,en),aL(3,Au),aL(4,lt)],uj);var $ve=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Fb=function(n,e){return function(t,i){e(t,i,n)}};let fj=class extends uj{constructor(e,t,i,s,o,r){super(t,i,s,new GV(e.getContainerDomNode(),o),r),this.host=void 0;const a=rN.get(e);if(a){const l=a.widget;this.host={_serviceBrand:void 0,get mainContainer(){return l.getDomNode()},getContainer(){return l.getDomNode()},whenContainerStylesLoaded(){},get containers(){return[l.getDomNode()]},get activeContainer(){return l.getDomNode()},get mainContainerDimension(){return e.getLayoutInfo()},get activeContainerDimension(){return e.getLayoutInfo()},get onDidLayoutMainContainer(){return e.onDidLayoutChange},get onDidLayoutActiveContainer(){return e.onDidLayoutChange},get onDidLayoutContainer(){return ve.map(e.onDidLayoutChange,c=>({container:l.getDomNode(),dimension:c}))},get onDidChangeActiveContainer(){return ve.None},get onDidAddContainer(){return ve.None},get mainContainerOffset(){return{top:0,quickPickTop:0}},get activeContainerOffset(){return{top:0,quickPickTop:0}},focus:()=>e.focus()}}else this.host=void 0}createController(){return super.createController(this.host)}};fj=$ve([Fb(1,Ae),Fb(2,Xe),Fb(3,en),Fb(4,Bt),Fb(5,lt)],fj);let gj=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(fj,e);this.mapEditorToService.set(e,t),q1(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get currentQuickInput(){return this.activeService.currentQuickInput}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t,i=wt.None){return this.activeService.pick(e,t,i)}input(e,t){return this.activeService.input(e,t)}createQuickPick(e={useSeparators:!1}){return this.activeService.createQuickPick(e)}createInputBox(){return this.activeService.createInputBox()}toggleHover(){return this.activeService.toggleHover()}};gj=$ve([Fb(0,Ae),Fb(1,Bt)],gj);const eF=class eF{static get(e){return e.getContribution(eF.ID)}constructor(e){this.editor=e,this.widget=new pj(this.editor)}dispose(){this.widget.dispose()}};eF.ID="editor.controller.quickInput";let rN=eF;const tF=class tF{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return tF.ID}getDomNode(){return this.domNode}getPosition(){return{preference:{top:0,left:0}}}dispose(){this.codeEditor.removeOverlayWidget(this)}};tF.ID="editor.contrib.quickInputWidget";let pj=tF;At(rN.ID,rN,4);class UYe{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function qYe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const u=QYe(d.token,h.token);return u!==0?u:d.index-h.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new YYe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new tX(t,r,a),c=new iX(l);for(let d=0,h=n.length;d"u"){const s=this._match(t),o=XYe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const ZYe=/\b(comment|string|regex|regexp)\b/;function XYe(n){const e=n.match(ZYe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function QYe(n,e){return ne?1:0}class tX{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new tX(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class iX{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new iX(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function JYe(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>Cs(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Cs(o.format)&&Cs(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:He.parse(o.location)}))}}n.fromJSONObject=t})(_re||(_re={}));const oZe=/^([\w_-]+)$/,rZe=_(2024,"The font ID must only contain letters, numbers, underscores and dashes.");class aZe extends G{constructor(){super(),this._onDidChange=this._register(new q),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:_(2025,"The id of the font to use. If not set, the font that is defined first is used."),pattern:oZe.source,patternErrorMessage:rZe},fontCharacter:{type:"string",description:_(2026,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${$e.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;$e.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${$e.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!$e.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` +`)}}const zw=new aZe;Ji.add(sZe.IconContribution,zw);function Ri(n,e,t,i){return zw.registerIcon(n,e,t,i)}function qve(){return zw}function lZe(){const n=Sge();for(const e in n){const t="\\"+n[e].toString(16);zw.registerIcon(e,{fontCharacter:t})}}lZe();const Kve="vscode://schemas/icons",Gve=Ji.as(i3.JSONContribution);Gve.registerSchema(Kve,zw.getIconSchema());const bre=new ai(()=>Gve.notifySchemaChanged(Kve),200);zw.onDidChange(()=>{bre.isScheduled()||bre.schedule()});const Yve=Ri("widget-close",de.close,_(2027,"Icon for the close action in widgets."));Ri("goto-previous-location",de.arrowUp,_(2028,"Icon for goto previous editor location."));Ri("goto-next-location",de.arrowDown,_(2029,"Icon for goto next editor location."));$e.modify(de.sync,"spin");$e.modify(de.loading,"spin");function cZe(n){const e=new ne,t=e.add(new q),i=qve();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new Zve,o={},r=new k9,a=new k9;for(const l of i.getIcons()){const c=s.getIcon(l);if(!c)continue;const d=c.font,h=sa`--vscode-icon-${C2(l.id)}-font-family`,u=sa`--vscode-icon-${C2(l.id)}-content`;d?(o[d.id]=d.definition,a.push(sa`${h}: ${hp(d.id)};`,sa`${u}: ${hp(c.fontCharacter)};`),r.push(sa`.codicon-${C2(l.id)}:before { content: ${hp(c.fontCharacter)}; font-family: ${hp(d.id)}; }`)):(a.push(sa`${u}: ${hp(c.fontCharacter)}; ${h}: 'codicon';`),r.push(sa`.codicon-${C2(l.id)}:before { content: ${hp(c.fontCharacter)}; }`))}for(const l in o){const c=o[l],d=c.weight?sa`font-weight: ${zoe(c.weight)};`:sa``,h=c.style?sa`font-style: ${zoe(c.style)};`:sa``,u=new k9;for(const f of c.src)u.push(sa`${xu(f.location)} format(${hp(f.format)})`);r.push(sa`@font-face { src: ${u.join(", ")}; font-family: ${hp(l)};${d}${h} font-display: block; }`)}return r.push(sa`:root { ${a.join(" ")} }`),r.join(` +`)}}}class Zve{getIcon(e){const t=qve();let i=e.defaults;for(;$e.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const Pf="vs",vy="vs-dark",Av="hc-black",Pv="hc-light",Xve=Ji.as(eme.ColorContribution),dZe=Ji.as(Wme.ThemingContribution);class Qve{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(XR(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,se.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=mj(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,se.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=Xve.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case Pf:return $l.LIGHT;case Av:return $l.HIGH_CONTRAST_DARK;case Pv:return $l.HIGH_CONTRAST_LIGHT;default:return $l.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=mj(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=Uve.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=wo.getForeground(o),a=wo.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}get tokenColorMap(){return[]}}function XR(n){return n===Pf||n===vy||n===Av||n===Pv}function mj(n){switch(n){case Pf:return eZe;case vy:return tZe;case Av:return iZe;case Pv:return nZe}}function L2(n){const e=mj(n);return new Qve(n,e)}class hZe extends G{constructor(){super(),this._onColorThemeChange=this._register(new q),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new q),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new Zve,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(Pf,L2(Pf)),this._knownThemes.set(vy,L2(vy)),this._knownThemes.set(Av,L2(Av)),this._knownThemes.set(Pv,L2(Pv));const e=this._register(cZe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(Pf),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),Oge(ri,"(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return pA(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=sc(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),G.None}_registerShadowDomContainer(e){const t=sc(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(Pf),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=ri.matchMedia("(forced-colors: active)").matches;if(e!==Gd(this._theme.type)){let t;Ng(this._theme.type)?t=e?Av:vy:t=e?Pv:Pf,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};dZe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of Xve.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${_Y(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor, .monaco-component { ${s.join(` +`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(JYe(o)),i.addRule(".monaco-editor, .monaco-diff-editor, .monaco-component { forced-color-adjust: none; }"),this._themeCSS=e.join(` `),this._updateCSS(),rn.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ml=mt("themeService");var gZe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},B9=function(n,e){return function(t,i){e(t,i,n)}};let bj=class extends G{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new q,this._onDidChangeReducedMotion=new q,this._onDidChangeLinkUnderline=new q,this._accessibilityModeEnabledContext=ix.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=ri.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(J(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",i),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};bj=gZe([B9(0,Xe),B9(1,Mu),B9(2,lt)],bj);var z3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mu=function(n,e){return function(t,i){e(t,i,n)}},BC,OL;let vj=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new wj(i)}createMenu(e,t,i){return new VP(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const s=new VP(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=s.getActions(i);return s.dispose(),o}resetHiddenStates(e){this._hiddenStates.reset(e)}};vj=z3([mu(0,Ei),mu(1,Ht),mu(2,Qo)],vj);var Gv;let wj=(Gv=class{constructor(e){this._storageService=e,this._disposables=new ne,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(BC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,BC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(BC._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var o;const i=this._isHiddenByDefault(e,t),s=((o=this._data[e.id])==null?void 0:o.includes(t))??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&SMe(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(BC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}},BC=Gv,Gv._key="menu.hiddenCommands",Gv);wj=BC=z3([mu(0,Qo)],wj);class Bk{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(Rs.getMenuItems(this._id));let t;for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(Bk._fillInKbExprKeys(e.when,this._structureContextKeys),iy(e)){if(e.command.precondition&&Bk._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Bk._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(Rs.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let Cj=OL=class extends Bk{constructor(e,t,i,s,o,r){super(e,i),this._hiddenStates=t,this._commandService=s,this._keybindingService=o,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=iy(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=pZe(this._id,l?a.command:a,this._hiddenStates);if(l){const d=n1e(this._commandService,this._keybindingService,a.command.id,a.when);(r??(r=[])).push(new rl(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new OL(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Xn.join(...d.map(u=>u[1]));h.length>0&&(r??(r=[])).push(new Nv(a,c,h))}}r&&r.length>0&&t.push([s,r])}return t}_sort(e){return e.sort(OL._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:OL._compareTitles(iy(e)?e.command.title:e.title,iy(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};Cj=OL=z3([mu(3,Ei),mu(4,Ht),mu(5,Xe)],Cj);let VP=class{constructor(e,t,i,s,o,r){this._disposables=new ne,this._menuInfo=new Cj(e,t,i.emitEventsForSubmenuChanges,s,o,r);const a=new ai(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Rs.onDidChangeMenu(h=>{for(const u of this._menuInfo.allMenuIds)if(h.has(u)){a.schedule();break}}));const l=this._disposables.add(new ne),c=h=>{let u=!1,f=!1,g=!1;for(const p of h)if(u=u||p.isStructuralChange,f=f||p.isEnablementChange,g=g||p.isToggleChange,u&&f&&g)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g}},d=()=>{l.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),g=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||g)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g})})),l.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new fge({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};VP=z3([mu(3,Ei),mu(4,Ht),mu(5,Xe)],VP);function pZe(n,e,t){const i=F4e(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=Iv({id:`hide/${n.id}/${i}`,label:_(1651,"Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=Iv({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function n1e(n,e,t,i=void 0,s=!0){return Iv({id:`configureKeybinding/${t}`,label:_(1652,"Configure Keybinding"),enabled:s,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;n.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}var mZe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Cre=function(n,e){return function(t,i){e(t,i,n)}},yj;const yre="application/vnd.code.resources";var Yv;let Sj=(Yv=class extends G{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(ew||Vge)&&this.installWebKitWriteTextWorkaround(),this._register(ve.runAndSubscribe(hD,({window:i,disposables:s})=>{s.add(J(i.document,"copy",()=>this.clearResourcesState()))},{window:ri,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const t=new Mw;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ii().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(ve.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(J(t,"click",e)),i.add(J(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await ii().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=uD(),i=t.activeElement,s=t.body.appendChild(me("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),hn(i)&&i.focus(),s.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const t=await ii().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async readResources(){try{const t=await ii().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${yre}`)){const s=await i.getType(`web ${yre}`);return JSON.parse(await s.text()).map(r=>He.from(r))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return dD(e.substring(0,yj.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},yj=Yv,Yv.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,Yv);Sj=yj=mZe([Cre(0,Mu),Cre(1,ki)],Sj);const xa=mt("clipboardService");var _Ze=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bZe=function(n,e){return function(t,i){e(t,i,n)}};const Wk="data-keybinding-context";let sX=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};const iF=class iF extends sX{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}};iF.INSTANCE=new iF;let ES=iF;const gE=class gE extends sX{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=by.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new xre(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Nt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new xre(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(gE._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(gE._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}};gE._keyPrefix="config.";let xj=gE;class vZe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Sre{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class xre{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class wZe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function CZe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class s1e extends G{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new Z1({merge:t=>new wZe(t)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new vZe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new yZe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new Sre(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Sre(e))}getContext(e){return this._isDisposed?ES.INSTANCE:this.getContextValuesContainer(SZe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let Lj=class extends s1e{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=UZ.bindTo(this);const t=this._register(new xj(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(ve.runAndSubscribe(hD,({window:i,disposables:s})=>{const o=s.add(new Kt);s.add(J(i,_e.FOCUS_IN,()=>{o.value=new ne,this.updateInputContextKeys(i.document,o.value)},!0))},{window:ri,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&$d(e.activeElement)}const s=i();if(this.inputFocusedContext.set(s),s){const o=t.add(oc(e.activeElement));ve.once(o.onDidBlur)(()=>{ii().document===e&&this.inputFocusedContext.set(i()),o.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?ES.INSTANCE:this._contexts.get(e)||ES.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new sX(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};Lj=_Ze([bZe(0,lt)],Lj);class yZe extends s1e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Kt),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Wk)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(Wk,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;CZe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Wk),super.dispose())}getContextValuesContainer(e){return this._isDisposed?ES.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function SZe(n){for(;n;){if(n.hasAttribute(Wk)){const e=n.getAttribute(Wk);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function xZe(n,e,t){n.get(Xe).createKey(String(e),LZe(t))}function LZe(n){return sge(n,e=>{if(typeof e=="object"&&e.$mid===1)return He.revive(e).toString();if(e instanceof He)return e.toString()})}Rt.registerCommand("_setContext",xZe);Rt.registerCommand({id:"getContextKeyInfo",handler(){return[...Se.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:_(1674,"A command that returns information about context keys"),args:[]}});Rt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Se.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let kZe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Lre{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new kZe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const ml=mt("themeService");var uZe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},B9=function(n,e){return function(t,i){e(t,i,n)}};let _j=class extends G{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new q,this._onDidChangeReducedMotion=new q,this._onDidChangeLinkUnderline=new q,this._accessibilityModeEnabledContext=ex.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=ri.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._linkUnderlinesEnabled=this._configurationService.getValue("accessibility.underlineLinks"),this.initReducedMotionListeners(o),this.initLinkUnderlineListeners()}initReducedMotionListeners(e){this._register(J(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.mainContainer.classList.toggle("monaco-reduce-motion",i),this._layoutService.mainContainer.classList.toggle("monaco-enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}initLinkUnderlineListeners(){this._register(this._configurationService.onDidChangeConfiguration(t=>{if(t.affectsConfiguration("accessibility.underlineLinks")){const i=this._configurationService.getValue("accessibility.underlineLinks");this._linkUnderlinesEnabled=i,this._onDidChangeLinkUnderline.fire()}}));const e=()=>{const t=this._linkUnderlinesEnabled;this._layoutService.mainContainer.classList.toggle("underline-links",t)};e(),this._register(this.onDidChangeLinkUnderlines(()=>e()))}onDidChangeLinkUnderlines(e){return this._onDidChangeLinkUnderline.event(e)}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};_j=uZe([B9(0,Xe),B9(1,Au),B9(2,lt)],_j);var z3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_u=function(n,e){return function(t,i){e(t,i,n)}},MC,OL;let bj=class{constructor(e,t,i){this._commandService=e,this._keybindingService=t,this._hiddenStates=new vj(i)}createMenu(e,t,i){return new VP(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t)}getMenuActions(e,t,i){const s=new VP(e,this._hiddenStates,{emitEventsForSubmenuChanges:!1,eventDebounceDelay:50,...i},this._commandService,this._keybindingService,t),o=s.getActions(i);return s.dispose(),o}resetHiddenStates(e){this._hiddenStates.reset(e)}};bj=z3([_u(0,ki),_u(1,Vt),_u(2,Jo)],bj);var Uv;let vj=(Uv=class{constructor(e){this._storageService=e,this._disposables=new ne,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(MC._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,MC._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(MC._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){return this._hiddenByDefaultCache.get(`${e.id}/${t}`)??!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var o;const i=this._isHiddenByDefault(e,t),s=((o=this._data[e.id])==null?void 0:o.includes(t))??!1;return i?!s:s}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&CMe(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(MC._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}},MC=Uv,Uv._key="menu.hiddenCommands",Uv);vj=MC=z3([_u(0,Jo)],vj);class Bk{constructor(e,t){this._id=e,this._collectContextKeysForSubmenus=t,this._menuGroups=[],this._allMenuIds=new Set,this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get allMenuIds(){return this._allMenuIds}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._allMenuIds.clear(),this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=this._sort(Rs.getMenuItems(this._id));let t;for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeysAndSubmenuIds(i)}this._allMenuIds.add(this._id)}_sort(e){return e}_collectContextKeysAndSubmenuIds(e){if(Bk._fillInKbExprKeys(e.when,this._structureContextKeys),ey(e)){if(e.command.precondition&&Bk._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;Bk._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&(Rs.getMenuItems(e.submenu).forEach(this._collectContextKeysAndSubmenuIds,this),this._allMenuIds.add(e.submenu))}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}}let wj=OL=class extends Bk{constructor(e,t,i,s,o,r){super(e,i),this._hiddenStates=t,this._commandService=s,this._keybindingService=o,this._contextKeyService=r,this.refresh()}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i;let r;for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=ey(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=fZe(this._id,l?a.command:a,this._hiddenStates);if(l){const d=Jve(this._commandService,this._keybindingService,a.command.id,a.when);(r??(r=[])).push(new rl(a.command,a.alt,e,c,d,this._contextKeyService,this._commandService))}else{const d=new OL(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._keybindingService,this._contextKeyService).createActionGroups(e),h=Zn.join(...d.map(u=>u[1]));h.length>0&&(r??(r=[])).push(new kv(a,c,h))}}r&&r.length>0&&t.push([s,r])}return t}_sort(e){return e.sort(OL._compareMenuItems)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:OL._compareTitles(ey(e)?e.command.title:e.title,ey(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};wj=OL=z3([_u(3,ki),_u(4,Vt),_u(5,Xe)],wj);let VP=class{constructor(e,t,i,s,o,r){this._disposables=new ne,this._menuInfo=new wj(e,t,i.emitEventsForSubmenuChanges,s,o,r);const a=new ai(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(a),this._disposables.add(Rs.onDidChangeMenu(h=>{for(const u of this._menuInfo.allMenuIds)if(h.has(u)){a.schedule();break}}));const l=this._disposables.add(new ne),c=h=>{let u=!1,f=!1,g=!1;for(const p of h)if(u=u||p.isStructuralChange,f=f||p.isEnablementChange,g=g||p.isToggleChange,u&&f&&g)break;return{menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g}},d=()=>{l.add(r.onDidChangeContext(h=>{const u=h.affectsSome(this._menuInfo.structureContextKeys),f=h.affectsSome(this._menuInfo.preconditionContextKeys),g=h.affectsSome(this._menuInfo.toggledContextKeys);(u||f||g)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:f,isToggleChange:g})})),l.add(t.onDidChange(h=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new cge({onWillAddFirstListener:d,onDidRemoveLastListener:l.clear.bind(l),delay:i.eventDebounceDelay,merge:c}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};VP=z3([_u(3,ki),_u(4,Vt),_u(5,Xe)],VP);function fZe(n,e,t){const i=P4e(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=Lv({id:`hide/${n.id}/${i}`,label:_(1651,"Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=Lv({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}function Jve(n,e,t,i=void 0,s=!0){return Lv({id:`configureKeybinding/${t}`,label:_(1652,"Configure Keybinding"),enabled:s,run(){const r=!!!e.lookupKeybinding(t)&&i?i.serialize():void 0;n.executeCommand("workbench.action.openGlobalKeybindings",`@command:${t}`+(r?` +when:${r}`:""))}})}var gZe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vre=function(n,e){return function(t,i){e(t,i,n)}},Cj;const wre="application/vnd.code.resources";var qv;let yj=(qv=class extends G{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],this.resourcesStateHash=void 0,(X1||Fge)&&this.installWebKitWriteTextWorkaround(),this._register(ve.runAndSubscribe(hD,({window:i,disposables:s})=>{s.add(J(i.document,"copy",()=>this.clearResourcesState()))},{window:ri,disposables:this._store}))}triggerPaste(){this.logService.trace("BrowserClipboardService#triggerPaste")}installWebKitWriteTextWorkaround(){const e=()=>{const t=new Dw;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,ii().navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(async i=>{(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)})};this._register(ve.runAndSubscribe(this.layoutService.onDidAddContainer,({container:t,disposables:i})=>{i.add(J(t,"click",e)),i.add(J(t,"keydown",e))},{container:this.layoutService.mainContainer,disposables:this._store}))}async writeText(e,t){if(this.logService.trace("BrowserClipboardService#writeText called with type:",t," text.length:",e.length),this.clearResourcesState(),t){this.mapTextToType.set(t,e),this.logService.trace("BrowserClipboardService#writeText");return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return this.logService.trace("before navigator.clipboard.writeText"),await ii().navigator.clipboard.writeText(e)}catch(i){console.error(i)}this.fallbackWriteText(e)}fallbackWriteText(e){this.logService.trace("BrowserClipboardService#fallbackWriteText");const t=uD(),i=t.activeElement,s=t.body.appendChild(me("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),t.execCommand("copy"),hn(i)&&i.focus(),s.remove()}async readText(e){if(this.logService.trace("BrowserClipboardService#readText called with type:",e),e){const t=this.mapTextToType.get(e)||"";return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}try{const t=await ii().navigator.clipboard.readText();return this.logService.trace("BrowserClipboardService#readText text.length:",t.length),t}catch(t){console.error(t)}return""}async readFindText(){return this.findText}async writeFindText(e){this.findText=e}async readResources(){try{const t=await ii().navigator.clipboard.read();for(const i of t)if(i.types.includes(`web ${wre}`)){const s=await i.getType(`web ${wre}`);return JSON.parse(await s.text()).map(r=>He.from(r))}}catch{}const e=await this.computeResourcesStateHash();return this.resourcesStateHash!==e&&this.clearResourcesState(),this.resources}async computeResourcesStateHash(){if(this.resources.length===0)return;const e=await this.readText();return dD(e.substring(0,Cj.MAX_RESOURCE_STATE_SOURCE_LENGTH))}clearInternalState(){this.clearResourcesState()}clearResourcesState(){this.resources=[],this.resourcesStateHash=void 0}},Cj=qv,qv.MAX_RESOURCE_STATE_SOURCE_LENGTH=1e3,qv);yj=Cj=gZe([vre(0,Au),vre(1,Li)],yj);const La=mt("clipboardService");var pZe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mZe=function(n,e){return function(t,i){e(t,i,n)}};const Wk="data-keybinding-context";let nX=class{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return{...this._value}}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}};const iF=class iF extends nX{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}};iF.INSTANCE=new iF;let LS=iF;const gI=class gI extends nX{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=my.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new yre(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...Dt.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new yre(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(gI._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(gI._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}};gI._keyPrefix="config.";let Sj=gI;class _Ze{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Cre{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class yre{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class bZe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function vZe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class e1e extends G{get onDidChangeContext(){return this._onDidChangeContext.event}constructor(e){super(),this._onDidChangeContext=this._register(new K1({merge:t=>new bZe(t)})),this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new _Ze(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new wZe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new Cre(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Cre(e))}getContext(e){return this._isDisposed?LS.INSTANCE:this.getContextValuesContainer(CZe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let xj=class extends e1e{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0,this.inputFocusedContext=$Z.bindTo(this);const t=this._register(new Sj(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t),this._register(ve.runAndSubscribe(hD,({window:i,disposables:s})=>{const o=s.add(new Gt);s.add(J(i,_e.FOCUS_IN,()=>{o.value=new ne,this.updateInputContextKeys(i.document,o.value)},!0))},{window:ri,disposables:this._store}))}updateInputContextKeys(e,t){function i(){return!!e.activeElement&&qd(e.activeElement)}const s=i();if(this.inputFocusedContext.set(s),s){const o=t.add(tc(e.activeElement));ve.once(o.onDidBlur)(()=>{ii().document===e&&this.inputFocusedContext.set(i()),o.dispose()},void 0,t)}}getContextValuesContainer(e){return this._isDisposed?LS.INSTANCE:this._contexts.get(e)||LS.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new nX(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};xj=pZe([mZe(0,lt)],xj);class wZe extends e1e{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new Gt),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Wk)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(Wk,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;vZe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Wk),super.dispose())}getContextValuesContainer(e){return this._isDisposed?LS.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function CZe(n){for(;n;){if(n.hasAttribute(Wk)){const e=n.getAttribute(Wk);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function yZe(n,e,t){n.get(Xe).createKey(String(e),SZe(t))}function SZe(n){return ege(n,e=>{if(typeof e=="object"&&e.$mid===1)return He.revive(e).toString();if(e instanceof He)return e.toString()})}Rt.registerCommand("_setContext",yZe);Rt.registerCommand({id:"getContextKeyInfo",handler(){return[...Se.all()].sort((n,e)=>n.key.localeCompare(e.key))},metadata:{description:_(1674,"A command that returns information about context keys"),args:[]}});Rt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of Se.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let xZe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class Sre{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new xZe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const EZe=!1;class kre extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class zP{constructor(e=new cx,t=!1,i,s=EZe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ae,this),this._globalGraph=s?(i==null?void 0:i._globalGraph)??new Lre(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,Jt(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Rw(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends zP{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t==null||t.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=Hk.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw JM("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a},getIfExists:r=>{if(s)throw JM("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(r,i)}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof Uh?(i=Hk.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Hk.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Bd.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Uh)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof Uh?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var l;const s=new Lre(c=>c.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),s.lookupOrInsertNode(c),o++>1e3)throw new kre(s);for(const d of Bd.getServiceDependencies(c.desc.ctor)){const h=this._getServiceInstanceOrDescriptor(d.id);if(h||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(l=this._globalGraph)==null||l.insertEdge(String(c.id),String(d.id)),h instanceof Uh){const u={id:d.id,desc:h,_trace:c._trace.branch(d.id,!0)};s.insertEdge(c,u),r.push(u)}}}}for(;;){const c=s.roots();if(c.length===0){if(!s.isEmpty())throw new kre(s);break}for(const{data:d}of c){if(this._getServiceInstanceOrDescriptor(d.id)instanceof Uh){const u=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,u)}s.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof Uh)return this._createServiceInstance(e,t,i,s,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o,r){if(s){const a=new zP(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new cOe(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of l){const f=d[h];if(typeof f=="function")for(const g of u)g.disposable=f.apply(d,g.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!c.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let g=l.get(h);return g||(g=new Uo,l.set(h,g)),(m,b,v)=>{if(c.isInitialized)return c.value[h](m,b,v);{const w={listener:[m,b,v],disposable:void 0},C=g.push(w);return Re(()=>{var L;C(),(L=w.disposable)==null||L.dispose()})}}}if(h in d)return d[h];const u=c.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return c.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}const Wa=class Wa{static traceInvocation(e,t){return e?new Wa(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const LZe=!1;class xre extends Error{constructor(e){super("cyclic dependency between services"),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class zP{constructor(e=new ax,t=!1,i,s=LZe){this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(Ae,this),this._globalGraph=s?(i==null?void 0:i._globalGraph)??new Sre(o=>o):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,ei(this._children),this._children.clear();for(const e of this._servicesToMaybeDispose)Nw(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw new Error("InstantiationService has been disposed")}createChild(e,t){this._throwIfDisposed();const i=this,s=new class extends zP{dispose(){i._children.delete(s),super.dispose()}}(e,this._strict,this,this._enableTracing);return this._children.add(s),t==null||t.add(s),s}invokeFunction(e,...t){this._throwIfDisposed();const i=Hk.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw JM("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a},getIfExists:r=>{if(s)throw JM("service accessor is only valid during the invocation of its target method");return this._getOrCreateServiceInstance(r,i)}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){this._throwIfDisposed();let i,s;return e instanceof qh?(i=Hk.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Hk.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Hd.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof qh)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof qh?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var l;const s=new Sre(c=>c.id.toString());let o=0;const r=[{id:e,desc:t,_trace:i}],a=new Set;for(;r.length;){const c=r.pop();if(!a.has(String(c.id))){if(a.add(String(c.id)),s.lookupOrInsertNode(c),o++>1e3)throw new xre(s);for(const d of Hd.getServiceDependencies(c.desc.ctor)){const h=this._getServiceInstanceOrDescriptor(d.id);if(h||this._throwIfStrict(`[createInstance] ${e} depends on ${d.id} which is NOT registered.`,!0),(l=this._globalGraph)==null||l.insertEdge(String(c.id),String(d.id)),h instanceof qh){const u={id:d.id,desc:h,_trace:c._trace.branch(d.id,!0)};s.insertEdge(c,u),r.push(u)}}}}for(;;){const c=s.roots();if(c.length===0){if(!s.isEmpty())throw new xre(s);break}for(const{data:d}of c){if(this._getServiceInstanceOrDescriptor(d.id)instanceof qh){const u=this._createServiceInstanceWithOwner(d.id,d.desc.ctor,d.desc.staticArguments,d.desc.supportsDelayedInstantiation,d._trace);this._setCreatedServiceInstance(d.id,u)}s.removeNode(d)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof qh)return this._createServiceInstance(e,t,i,s,o,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o,r){if(s){const a=new zP(void 0,this._strict,this,this._enableTracing);a._globalGraphImplicitDependency=String(e);const l=new Map,c=new aOe(()=>{const d=a._createInstance(t,i,o);for(const[h,u]of l){const f=d[h];if(typeof f=="function")for(const g of u)g.disposable=f.apply(d,g.listener)}return l.clear(),r.add(d),d});return new Proxy(Object.create(null),{get(d,h){if(!c.isInitialized&&typeof h=="string"&&(h.startsWith("onDid")||h.startsWith("onWill"))){let g=l.get(h);return g||(g=new qo,l.set(h,g)),(m,b,v)=>{if(c.isInitialized)return c.value[h](m,b,v);{const w={listener:[m,b,v],disposable:void 0},C=g.push(w);return Re(()=>{var L;C(),(L=w.disposable)==null||L.dispose()})}}}if(h in d)return d[h];const u=c.value;let f=u[h];return typeof f!="function"||(f=f.bind(u),d[h]=f),f},set(d,h,u){return c.value[h]=u,!0},getPrototypeOf(d){return t.prototype}})}else{const a=this._createInstance(t,i,o);return r.add(a),a}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}const Wa=class Wa{static traceInvocation(e,t){return e?new Wa(2,t.name||new Error().stack.split(` `).slice(3,4).join(` `)):Wa._None}static traceCreation(e,t){return e?new Wa(1,t.name):Wa._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Wa(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Wa._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,h]of r._dep)if(d&&h){t=!0,a.push(`${l}CREATES -> ${c}`);const u=i(o+1,h);u&&a.push(u)}else a.push(`${l}uses -> ${c}`);return a.join(` `)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Wa._totals.toFixed(2)}ms)`];(e>2||t)&&Wa.all.add(s.join(` -`))}};Wa.all=new Set,Wa._None=new class extends Wa{constructor(){super(0,null)}stop(){}branch(){return this}},Wa._totals=0;let Hk=Wa;const IZe=new Set([Ge.inMemory,Ge.vscodeSourceControl,Ge.walkThrough,Ge.walkThroughSnippet,Ge.vscodeChatCodeBlock,Ge.vscodeTerminal]);class NZe{constructor(){this._byResource=new kn,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new kn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i;return typeof e=="string"?((t=this._byOwner.get(e))==null?void 0:t.values())??Nt.empty():He.isUri(e)?((i=this._byResource.get(e))==null?void 0:i.values())??Nt.empty():Nt.map(Nt.concat(...this._byOwner.values()),s=>s[1])}}class DZe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new kn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(IZe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Xi.Error?t.errors+=1:i===Xi.Warning?t.warnings+=1:i===Xi.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Wb{constructor(){this._onMarkerChanged=new fge({delay:0,merge:Wb._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new NZe,this._stats=new DZe(this),this._filteredResources=new kn}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Jfe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Wb._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=Nt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Go(t)){const o=new kn;for(const{resource:r,marker:a}of t){const l=Wb._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=t.length===1?_(1738,'Problems are paused because: "{0}"',t[0]):_(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:Xi.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r!=null&&r.length)return[this._createFilteredMarker(i,r)];const a=this._data.get(i,t);if(!a)return[];const l=[];for(const c of a){if(o>0&&l.length===o)break;const d=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);d!=null&&d.length?l.push(this._createFilteredMarker(i,d)):Wb._accept(c,s)&&l.push(c)}return l}else{const r=!t&&!i?this._data.values():this._data.values(i??t),a=[],l=new H4e;for(const c of r)for(const d of c){if(l.has(d.resource))continue;if(o>0&&a.length===o)break;const h=e.ignoreResourceFilters?void 0:this._filteredResources.get(d.resource);h!=null&&h.length?(a.push(this._createFilteredMarker(d.resource,h)),l.add(d.resource)):Wb._accept(d,s)&&a.push(d)}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new kn;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class TZe extends G{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Vs.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Vs.createEmptyModel(this.logService);const e=Ji.as(ah.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.setValue(s,o):r?this._configurationModel.setValue(s,jh(r.default)):this._configurationModel.removeValue(s)}}}const Kg=mt("accessibilitySignalService"),pt=class pt{static register(e){return new pt(e.fileName)}constructor(e){this.fileName=e}};pt.error=pt.register({fileName:"error.mp3"}),pt.warning=pt.register({fileName:"warning.mp3"}),pt.success=pt.register({fileName:"success.mp3"}),pt.foldedArea=pt.register({fileName:"foldedAreas.mp3"}),pt.break=pt.register({fileName:"break.mp3"}),pt.quickFixes=pt.register({fileName:"quickFixes.mp3"}),pt.taskCompleted=pt.register({fileName:"taskCompleted.mp3"}),pt.taskFailed=pt.register({fileName:"taskFailed.mp3"}),pt.terminalBell=pt.register({fileName:"terminalBell.mp3"}),pt.diffLineInserted=pt.register({fileName:"diffLineInserted.mp3"}),pt.diffLineDeleted=pt.register({fileName:"diffLineDeleted.mp3"}),pt.diffLineModified=pt.register({fileName:"diffLineModified.mp3"}),pt.requestSent=pt.register({fileName:"requestSent.mp3"}),pt.responseReceived1=pt.register({fileName:"responseReceived1.mp3"}),pt.responseReceived2=pt.register({fileName:"responseReceived2.mp3"}),pt.responseReceived3=pt.register({fileName:"responseReceived3.mp3"}),pt.responseReceived4=pt.register({fileName:"responseReceived4.mp3"}),pt.clear=pt.register({fileName:"clear.mp3"}),pt.save=pt.register({fileName:"save.mp3"}),pt.format=pt.register({fileName:"format.mp3"}),pt.voiceRecordingStarted=pt.register({fileName:"voiceRecordingStarted.mp3"}),pt.voiceRecordingStopped=pt.register({fileName:"voiceRecordingStopped.mp3"}),pt.progress=pt.register({fileName:"progress.mp3"}),pt.chatEditModifiedFile=pt.register({fileName:"chatEditModifiedFile.mp3"}),pt.editsKept=pt.register({fileName:"editsKept.mp3"}),pt.editsUndone=pt.register({fileName:"editsUndone.mp3"}),pt.nextEditSuggestion=pt.register({fileName:"nextEditSuggestion.mp3"}),pt.terminalCommandSucceeded=pt.register({fileName:"terminalCommandSucceeded.mp3"}),pt.chatUserActionRequired=pt.register({fileName:"chatUserActionRequired.mp3"}),pt.codeActionTriggered=pt.register({fileName:"codeActionTriggered.mp3"}),pt.codeActionApplied=pt.register({fileName:"codeActionApplied.mp3"});let di=pt;class RZe{constructor(e){this.randomOneOf=e}}const ot=class ot{constructor(e,t,i,s,o,r,a=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.managesOwnEnablement=a}static register(e){const t=new RZe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new ot(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return ot._signals.add(i),i}};ot._signals=new Set,ot.errorAtPosition=ot.register({name:_(1576,"Error at Position"),sound:di.error,announcementMessage:_(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),ot.warningAtPosition=ot.register({name:_(1578,"Warning at Position"),sound:di.warning,announcementMessage:_(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),ot.errorOnLine=ot.register({name:_(1580,"Error on Line"),sound:di.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:_(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),ot.warningOnLine=ot.register({name:_(1582,"Warning on Line"),sound:di.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:_(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),ot.foldedArea=ot.register({name:_(1584,"Folded Area on Line"),sound:di.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:_(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),ot.break=ot.register({name:_(1586,"Breakpoint on Line"),sound:di.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:_(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),ot.inlineSuggestion=ot.register({name:_(1588,"Inline Suggestion on Line"),sound:di.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),ot.nextEditSuggestion=ot.register({name:_(1589,"Next Edit Suggestion on Line"),sound:di.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:_(1590,"Next Edit Suggestion")}),ot.terminalQuickFix=ot.register({name:_(1591,"Terminal Quick Fix"),sound:di.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:_(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),ot.onDebugBreak=ot.register({name:_(1593,"Debugger Stopped on Breakpoint"),sound:di.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:_(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),ot.noInlayHints=ot.register({name:_(1595,"No Inlay Hints on Line"),sound:di.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:_(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),ot.taskCompleted=ot.register({name:_(1597,"Task Completed"),sound:di.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:_(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),ot.taskFailed=ot.register({name:_(1599,"Task Failed"),sound:di.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:_(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),ot.terminalCommandFailed=ot.register({name:_(1601,"Terminal Command Failed"),sound:di.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:_(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),ot.terminalCommandSucceeded=ot.register({name:_(1603,"Terminal Command Succeeded"),sound:di.terminalCommandSucceeded,announcementMessage:_(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),ot.terminalBell=ot.register({name:_(1605,"Terminal Bell"),sound:di.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:_(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),ot.notebookCellCompleted=ot.register({name:_(1607,"Notebook Cell Completed"),sound:di.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:_(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),ot.notebookCellFailed=ot.register({name:_(1609,"Notebook Cell Failed"),sound:di.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:_(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),ot.diffLineInserted=ot.register({name:_(1611,"Diff Line Inserted"),sound:di.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),ot.diffLineDeleted=ot.register({name:_(1612,"Diff Line Deleted"),sound:di.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),ot.diffLineModified=ot.register({name:_(1613,"Diff Line Modified"),sound:di.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),ot.chatEditModifiedFile=ot.register({name:_(1614,"Chat Edit Modified File"),sound:di.chatEditModifiedFile,announcementMessage:_(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"}),ot.chatRequestSent=ot.register({name:_(1616,"Chat Request Sent"),sound:di.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:_(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),ot.chatResponseReceived=ot.register({name:_(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[di.responseReceived1,di.responseReceived2,di.responseReceived3,di.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),ot.codeActionTriggered=ot.register({name:_(1619,"Code Action Request Triggered"),sound:di.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:_(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"}),ot.codeActionApplied=ot.register({name:_(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:di.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"}),ot.progress=ot.register({name:_(1622,"Progress"),sound:di.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:_(1623,"Progress"),settingsKey:"accessibility.signals.progress"}),ot.clear=ot.register({name:_(1624,"Clear"),sound:di.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:_(1625,"Clear"),settingsKey:"accessibility.signals.clear"}),ot.save=ot.register({name:_(1626,"Save"),sound:di.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:_(1627,"Save"),settingsKey:"accessibility.signals.save"}),ot.format=ot.register({name:_(1628,"Format"),sound:di.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:_(1629,"Format"),settingsKey:"accessibility.signals.format"}),ot.voiceRecordingStarted=ot.register({name:_(1630,"Voice Recording Started"),sound:di.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),ot.voiceRecordingStopped=ot.register({name:_(1631,"Voice Recording Stopped"),sound:di.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"}),ot.editsKept=ot.register({name:_(1632,"Edits Kept"),sound:di.editsKept,announcementMessage:_(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"}),ot.editsUndone=ot.register({name:_(1634,"Undo Edits"),sound:di.editsUndone,announcementMessage:_(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"}),ot.chatUserActionRequired=ot.register({name:_(1636,"Chat User Action Required"),sound:di.chatUserActionRequired,announcementMessage:_(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0});let dr=ot;class MZe extends G{constructor(e,t=[]){super(),this.logger=new Q4e([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const o1e=[];function fx(n){o1e.push(n)}function AZe(){return o1e.slice(0)}class PZe{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}}const oX=mt("dataChannelService");class OZe{getDataChannel(e){return{sendData:()=>{}}}}var Ou=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Fn=function(n,e){return function(t,i){e(t,i,n)}};class FZe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new q}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let kj=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new ZMe(new FZe(t))):Promise.reject(new Error("Model not found"))}};kj=Ou([Fn(0,qi)],kj);const nF=class nF{show(){return nF.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};nF.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let Ej=nF;class BZe{withProgress(e,t,i){return t({report:()=>{}})}}class WZe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class HZe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` +`))}};Wa.all=new Set,Wa._None=new class extends Wa{constructor(){super(0,null)}stop(){}branch(){return this}},Wa._totals=0;let Hk=Wa;const kZe=new Set([Ge.inMemory,Ge.vscodeSourceControl,Ge.walkThrough,Ge.walkThroughSnippet,Ge.vscodeChatCodeBlock,Ge.vscodeTerminal]);class IZe{constructor(){this._byResource=new En,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new En,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i;return typeof e=="string"?((t=this._byOwner.get(e))==null?void 0:t.values())??Dt.empty():He.isUri(e)?((i=this._byResource.get(e))==null?void 0:i.values())??Dt.empty():Dt.map(Dt.concat(...this._byOwner.values()),s=>s[1])}}class EZe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new En,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(kZe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===Xi.Error?t.errors+=1:i===Xi.Warning?t.warnings+=1:i===Xi.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Bb{constructor(){this._onMarkerChanged=new cge({delay:0,merge:Bb._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new IZe,this._stats=new EZe(this),this._filteredResources=new En}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Yfe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Bb._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,h=h>0?h:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:h,relatedInformation:u,tags:f,origin:g}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=Dt.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(Yo(t)){const o=new En;for(const{resource:r,marker:a}of t){const l=Bb._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}_createFilteredMarker(e,t){const i=t.length===1?_(1738,'Problems are paused because: "{0}"',t[0]):_(1739,'Problems are paused because: "{0}" and {1} more',t[0],t.length-1);return{owner:"markersFilter",resource:e,severity:Xi.Info,message:i,startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1}}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);if(r!=null&&r.length)return[this._createFilteredMarker(i,r)];const a=this._data.get(i,t);if(!a)return[];const l=[];for(const c of a){if(o>0&&l.length===o)break;const d=e.ignoreResourceFilters?void 0:this._filteredResources.get(i);d!=null&&d.length?l.push(this._createFilteredMarker(i,d)):Bb._accept(c,s)&&l.push(c)}return l}else{const r=!t&&!i?this._data.values():this._data.values(i??t),a=[],l=new B4e;for(const c of r)for(const d of c){if(l.has(d.resource))continue;if(o>0&&a.length===o)break;const h=e.ignoreResourceFilters?void 0:this._filteredResources.get(d.resource);h!=null&&h.length?(a.push(this._createFilteredMarker(d.resource,h)),l.add(d.resource)):Bb._accept(d,s)&&a.push(d)}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new En;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class NZe extends G{get configurationModel(){return this._configurationModel}constructor(e){super(),this.logService=e,this._configurationModel=Vs.createEmptyModel(e)}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=Vs.createEmptyModel(this.logService);const e=Ji.as(ch.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.setValue(s,o):r?this._configurationModel.setValue(s,$h(r.default)):this._configurationModel.removeValue(s)}}}const Kg=mt("accessibilitySignalService"),pt=class pt{static register(e){return new pt(e.fileName)}constructor(e){this.fileName=e}};pt.error=pt.register({fileName:"error.mp3"}),pt.warning=pt.register({fileName:"warning.mp3"}),pt.success=pt.register({fileName:"success.mp3"}),pt.foldedArea=pt.register({fileName:"foldedAreas.mp3"}),pt.break=pt.register({fileName:"break.mp3"}),pt.quickFixes=pt.register({fileName:"quickFixes.mp3"}),pt.taskCompleted=pt.register({fileName:"taskCompleted.mp3"}),pt.taskFailed=pt.register({fileName:"taskFailed.mp3"}),pt.terminalBell=pt.register({fileName:"terminalBell.mp3"}),pt.diffLineInserted=pt.register({fileName:"diffLineInserted.mp3"}),pt.diffLineDeleted=pt.register({fileName:"diffLineDeleted.mp3"}),pt.diffLineModified=pt.register({fileName:"diffLineModified.mp3"}),pt.requestSent=pt.register({fileName:"requestSent.mp3"}),pt.responseReceived1=pt.register({fileName:"responseReceived1.mp3"}),pt.responseReceived2=pt.register({fileName:"responseReceived2.mp3"}),pt.responseReceived3=pt.register({fileName:"responseReceived3.mp3"}),pt.responseReceived4=pt.register({fileName:"responseReceived4.mp3"}),pt.clear=pt.register({fileName:"clear.mp3"}),pt.save=pt.register({fileName:"save.mp3"}),pt.format=pt.register({fileName:"format.mp3"}),pt.voiceRecordingStarted=pt.register({fileName:"voiceRecordingStarted.mp3"}),pt.voiceRecordingStopped=pt.register({fileName:"voiceRecordingStopped.mp3"}),pt.progress=pt.register({fileName:"progress.mp3"}),pt.chatEditModifiedFile=pt.register({fileName:"chatEditModifiedFile.mp3"}),pt.editsKept=pt.register({fileName:"editsKept.mp3"}),pt.editsUndone=pt.register({fileName:"editsUndone.mp3"}),pt.nextEditSuggestion=pt.register({fileName:"nextEditSuggestion.mp3"}),pt.terminalCommandSucceeded=pt.register({fileName:"terminalCommandSucceeded.mp3"}),pt.chatUserActionRequired=pt.register({fileName:"chatUserActionRequired.mp3"}),pt.codeActionTriggered=pt.register({fileName:"codeActionTriggered.mp3"}),pt.codeActionApplied=pt.register({fileName:"codeActionApplied.mp3"});let di=pt;class DZe{constructor(e){this.randomOneOf=e}}const rt=class rt{constructor(e,t,i,s,o,r,a=!1){this.sound=e,this.name=t,this.legacySoundSettingsKey=i,this.settingsKey=s,this.legacyAnnouncementSettingsKey=o,this.announcementMessage=r,this.managesOwnEnablement=a}static register(e){const t=new DZe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new rt(t,e.name,e.legacySoundSettingsKey,e.settingsKey,e.legacyAnnouncementSettingsKey,e.announcementMessage,e.managesOwnEnablement);return rt._signals.add(i),i}};rt._signals=new Set,rt.errorAtPosition=rt.register({name:_(1576,"Error at Position"),sound:di.error,announcementMessage:_(1577,"Error"),settingsKey:"accessibility.signals.positionHasError",delaySettingsKey:"accessibility.signalOptions.delays.errorAtPosition"}),rt.warningAtPosition=rt.register({name:_(1578,"Warning at Position"),sound:di.warning,announcementMessage:_(1579,"Warning"),settingsKey:"accessibility.signals.positionHasWarning",delaySettingsKey:"accessibility.signalOptions.delays.warningAtPosition"}),rt.errorOnLine=rt.register({name:_(1580,"Error on Line"),sound:di.error,legacySoundSettingsKey:"audioCues.lineHasError",legacyAnnouncementSettingsKey:"accessibility.alert.error",announcementMessage:_(1581,"Error on Line"),settingsKey:"accessibility.signals.lineHasError"}),rt.warningOnLine=rt.register({name:_(1582,"Warning on Line"),sound:di.warning,legacySoundSettingsKey:"audioCues.lineHasWarning",legacyAnnouncementSettingsKey:"accessibility.alert.warning",announcementMessage:_(1583,"Warning on Line"),settingsKey:"accessibility.signals.lineHasWarning"}),rt.foldedArea=rt.register({name:_(1584,"Folded Area on Line"),sound:di.foldedArea,legacySoundSettingsKey:"audioCues.lineHasFoldedArea",legacyAnnouncementSettingsKey:"accessibility.alert.foldedArea",announcementMessage:_(1585,"Folded"),settingsKey:"accessibility.signals.lineHasFoldedArea"}),rt.break=rt.register({name:_(1586,"Breakpoint on Line"),sound:di.break,legacySoundSettingsKey:"audioCues.lineHasBreakpoint",legacyAnnouncementSettingsKey:"accessibility.alert.breakpoint",announcementMessage:_(1587,"Breakpoint"),settingsKey:"accessibility.signals.lineHasBreakpoint"}),rt.inlineSuggestion=rt.register({name:_(1588,"Inline Suggestion on Line"),sound:di.quickFixes,legacySoundSettingsKey:"audioCues.lineHasInlineSuggestion",settingsKey:"accessibility.signals.lineHasInlineSuggestion"}),rt.nextEditSuggestion=rt.register({name:_(1589,"Next Edit Suggestion on Line"),sound:di.nextEditSuggestion,legacySoundSettingsKey:"audioCues.nextEditSuggestion",settingsKey:"accessibility.signals.nextEditSuggestion",announcementMessage:_(1590,"Next Edit Suggestion")}),rt.terminalQuickFix=rt.register({name:_(1591,"Terminal Quick Fix"),sound:di.quickFixes,legacySoundSettingsKey:"audioCues.terminalQuickFix",legacyAnnouncementSettingsKey:"accessibility.alert.terminalQuickFix",announcementMessage:_(1592,"Quick Fix"),settingsKey:"accessibility.signals.terminalQuickFix"}),rt.onDebugBreak=rt.register({name:_(1593,"Debugger Stopped on Breakpoint"),sound:di.break,legacySoundSettingsKey:"audioCues.onDebugBreak",legacyAnnouncementSettingsKey:"accessibility.alert.onDebugBreak",announcementMessage:_(1594,"Breakpoint"),settingsKey:"accessibility.signals.onDebugBreak"}),rt.noInlayHints=rt.register({name:_(1595,"No Inlay Hints on Line"),sound:di.error,legacySoundSettingsKey:"audioCues.noInlayHints",legacyAnnouncementSettingsKey:"accessibility.alert.noInlayHints",announcementMessage:_(1596,"No Inlay Hints"),settingsKey:"accessibility.signals.noInlayHints"}),rt.taskCompleted=rt.register({name:_(1597,"Task Completed"),sound:di.taskCompleted,legacySoundSettingsKey:"audioCues.taskCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.taskCompleted",announcementMessage:_(1598,"Task Completed"),settingsKey:"accessibility.signals.taskCompleted"}),rt.taskFailed=rt.register({name:_(1599,"Task Failed"),sound:di.taskFailed,legacySoundSettingsKey:"audioCues.taskFailed",legacyAnnouncementSettingsKey:"accessibility.alert.taskFailed",announcementMessage:_(1600,"Task Failed"),settingsKey:"accessibility.signals.taskFailed"}),rt.terminalCommandFailed=rt.register({name:_(1601,"Terminal Command Failed"),sound:di.error,legacySoundSettingsKey:"audioCues.terminalCommandFailed",legacyAnnouncementSettingsKey:"accessibility.alert.terminalCommandFailed",announcementMessage:_(1602,"Command Failed"),settingsKey:"accessibility.signals.terminalCommandFailed"}),rt.terminalCommandSucceeded=rt.register({name:_(1603,"Terminal Command Succeeded"),sound:di.terminalCommandSucceeded,announcementMessage:_(1604,"Command Succeeded"),settingsKey:"accessibility.signals.terminalCommandSucceeded"}),rt.terminalBell=rt.register({name:_(1605,"Terminal Bell"),sound:di.terminalBell,legacySoundSettingsKey:"audioCues.terminalBell",legacyAnnouncementSettingsKey:"accessibility.alert.terminalBell",announcementMessage:_(1606,"Terminal Bell"),settingsKey:"accessibility.signals.terminalBell"}),rt.notebookCellCompleted=rt.register({name:_(1607,"Notebook Cell Completed"),sound:di.taskCompleted,legacySoundSettingsKey:"audioCues.notebookCellCompleted",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellCompleted",announcementMessage:_(1608,"Notebook Cell Completed"),settingsKey:"accessibility.signals.notebookCellCompleted"}),rt.notebookCellFailed=rt.register({name:_(1609,"Notebook Cell Failed"),sound:di.taskFailed,legacySoundSettingsKey:"audioCues.notebookCellFailed",legacyAnnouncementSettingsKey:"accessibility.alert.notebookCellFailed",announcementMessage:_(1610,"Notebook Cell Failed"),settingsKey:"accessibility.signals.notebookCellFailed"}),rt.diffLineInserted=rt.register({name:_(1611,"Diff Line Inserted"),sound:di.diffLineInserted,legacySoundSettingsKey:"audioCues.diffLineInserted",settingsKey:"accessibility.signals.diffLineInserted"}),rt.diffLineDeleted=rt.register({name:_(1612,"Diff Line Deleted"),sound:di.diffLineDeleted,legacySoundSettingsKey:"audioCues.diffLineDeleted",settingsKey:"accessibility.signals.diffLineDeleted"}),rt.diffLineModified=rt.register({name:_(1613,"Diff Line Modified"),sound:di.diffLineModified,legacySoundSettingsKey:"audioCues.diffLineModified",settingsKey:"accessibility.signals.diffLineModified"}),rt.chatEditModifiedFile=rt.register({name:_(1614,"Chat Edit Modified File"),sound:di.chatEditModifiedFile,announcementMessage:_(1615,"File Modified from Chat Edits"),settingsKey:"accessibility.signals.chatEditModifiedFile"}),rt.chatRequestSent=rt.register({name:_(1616,"Chat Request Sent"),sound:di.requestSent,legacySoundSettingsKey:"audioCues.chatRequestSent",legacyAnnouncementSettingsKey:"accessibility.alert.chatRequestSent",announcementMessage:_(1617,"Chat Request Sent"),settingsKey:"accessibility.signals.chatRequestSent"}),rt.chatResponseReceived=rt.register({name:_(1618,"Chat Response Received"),legacySoundSettingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[di.responseReceived1,di.responseReceived2,di.responseReceived3,di.responseReceived4]},settingsKey:"accessibility.signals.chatResponseReceived"}),rt.codeActionTriggered=rt.register({name:_(1619,"Code Action Request Triggered"),sound:di.codeActionTriggered,legacySoundSettingsKey:"audioCues.codeActionRequestTriggered",legacyAnnouncementSettingsKey:"accessibility.alert.codeActionRequestTriggered",announcementMessage:_(1620,"Code Action Request Triggered"),settingsKey:"accessibility.signals.codeActionTriggered"}),rt.codeActionApplied=rt.register({name:_(1621,"Code Action Applied"),legacySoundSettingsKey:"audioCues.codeActionApplied",sound:di.codeActionApplied,settingsKey:"accessibility.signals.codeActionApplied"}),rt.progress=rt.register({name:_(1622,"Progress"),sound:di.progress,legacySoundSettingsKey:"audioCues.chatResponsePending",legacyAnnouncementSettingsKey:"accessibility.alert.progress",announcementMessage:_(1623,"Progress"),settingsKey:"accessibility.signals.progress"}),rt.clear=rt.register({name:_(1624,"Clear"),sound:di.clear,legacySoundSettingsKey:"audioCues.clear",legacyAnnouncementSettingsKey:"accessibility.alert.clear",announcementMessage:_(1625,"Clear"),settingsKey:"accessibility.signals.clear"}),rt.save=rt.register({name:_(1626,"Save"),sound:di.save,legacySoundSettingsKey:"audioCues.save",legacyAnnouncementSettingsKey:"accessibility.alert.save",announcementMessage:_(1627,"Save"),settingsKey:"accessibility.signals.save"}),rt.format=rt.register({name:_(1628,"Format"),sound:di.format,legacySoundSettingsKey:"audioCues.format",legacyAnnouncementSettingsKey:"accessibility.alert.format",announcementMessage:_(1629,"Format"),settingsKey:"accessibility.signals.format"}),rt.voiceRecordingStarted=rt.register({name:_(1630,"Voice Recording Started"),sound:di.voiceRecordingStarted,legacySoundSettingsKey:"audioCues.voiceRecordingStarted",settingsKey:"accessibility.signals.voiceRecordingStarted"}),rt.voiceRecordingStopped=rt.register({name:_(1631,"Voice Recording Stopped"),sound:di.voiceRecordingStopped,legacySoundSettingsKey:"audioCues.voiceRecordingStopped",settingsKey:"accessibility.signals.voiceRecordingStopped"}),rt.editsKept=rt.register({name:_(1632,"Edits Kept"),sound:di.editsKept,announcementMessage:_(1633,"Edits Kept"),settingsKey:"accessibility.signals.editsKept"}),rt.editsUndone=rt.register({name:_(1634,"Undo Edits"),sound:di.editsUndone,announcementMessage:_(1635,"Edits Undone"),settingsKey:"accessibility.signals.editsUndone"}),rt.chatUserActionRequired=rt.register({name:_(1636,"Chat User Action Required"),sound:di.chatUserActionRequired,announcementMessage:_(1637,"Chat User Action Required"),settingsKey:"accessibility.signals.chatUserActionRequired",managesOwnEnablement:!0});let ur=rt;class TZe extends G{constructor(e,t=[]){super(),this.logger=new Z4e([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const t1e=[];function hx(n){t1e.push(n)}function RZe(){return t1e.slice(0)}class MZe{getParserClass(){throw new Error("not implemented in StandaloneTreeSitterLibraryService")}supportsLanguage(e,t){return!1}getLanguage(e,t,i){}getInjectionQueries(e,t){return null}getHighlightingQueries(e,t){return null}}const sX=mt("dataChannelService");class AZe{getDataChannel(e){return{sendData:()=>{}}}}var Fu=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Pn=function(n,e){return function(t,i){e(t,i,n)}};class PZe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new q}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let Lj=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new GMe(new PZe(t))):Promise.reject(new Error("Model not found"))}};Lj=Fu([Pn(0,Ui)],Lj);const nF=class nF{show(){return nF.NULL_PROGRESS_RUNNER}async showWhile(e,t){await e}};nF.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};let kj=nF;class OZe{withProgress(e,t,i){return t({report:()=>{}})}}class FZe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class BZe{async confirm(e){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),ri.confirm(i)}async prompt(e){var s;let t;if(this.doConfirm(e.message,e.detail)){const o=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&o.push(e.cancelButton),t=await((s=o[0])==null?void 0:s.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:Yi.Error,message:e,detail:t})}}const pE=class pE{info(e){return this.notify({severity:Yi.Info,message:e})}warn(e){return this.notify({severity:Yi.Warning,message:e})}error(e){return this.notify({severity:Yi.Error,message:e})}notify(e){switch(e.severity){case Yi.Error:console.error(e.message);break;case Yi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return pE.NO_OP}prompt(e,t,i,s){return pE.NO_OP}status(e,t){return{close:()=>{}}}};pE.NO_OP=new GBe;let Ij=pE,Nj=class{constructor(e){this._onWillExecuteCommand=new q,this._onDidExecuteCommand=new q,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Rt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};Nj=Ou([Fn(0,Ae)],Nj);let IS=class extends hqe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new ne;g.add(J(f,_e.KEY_DOWN,p=>{const m=new ui(p);this._dispatch(m,m.target)&&(m.preventDefault(),m.stopPropagation())})),g.add(J(f,_e.KEY_UP,p=>{const m=new ui(p);this._singleModifierDispatch(m,m.target)&&m.preventDefault()})),this._domNodeListeners.push(new VZe(f,g))},l=f=>{for(let g=0;g{f.getOption(70)||a(f.getContainerDomNode())},d=f=>{f.getOption(70)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,s){return Hc(Rt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:hH(i.keybinding,ha),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Re(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return ri.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new Hoe(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=YI.resolveKeybinding(a,ha);for(const c of l)i[s++]=new Hoe(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Lg(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new YI([t],ha)}};IS=Ou([Fn(0,Xe),Fn(1,Ei),Fn(2,Ro),Fn(3,fn),Fn(4,ki),Fn(5,Ft)],IS);class VZe extends G{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Ere(n){return!!n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof He)}let jP=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new q,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new TZe(e);this._configuration=new D3(t.reload(),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),new kn,Vs.createEmptyModel(e),new kn,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=Ere(e)?e:Ere(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new aqe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=8,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};jP=Ou([Fn(0,ki)],jP);let Dj=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new q,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=U.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};Dj=Ou([Fn(0,lt),Fn(1,qi),Fn(2,un)],Dj);let Tj=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:jr||wt?` +`+t),ri.confirm(i)}async prompt(e){var s;let t;if(this.doConfirm(e.message,e.detail)){const o=[...e.buttons??[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&o.push(e.cancelButton),t=await((s=o[0])==null?void 0:s.run({checkboxChecked:!1}))}return{result:t}}async error(e,t){await this.prompt({type:Yi.Error,message:e,detail:t})}}const pI=class pI{info(e){return this.notify({severity:Yi.Info,message:e})}warn(e){return this.notify({severity:Yi.Warning,message:e})}error(e){return this.notify({severity:Yi.Error,message:e})}notify(e){switch(e.severity){case Yi.Error:console.error(e.message);break;case Yi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return pI.NO_OP}prompt(e,t,i,s){return pI.NO_OP}status(e,t){return{close:()=>{}}}};pI.NO_OP=new qBe;let Ij=pI,Ej=class{constructor(e){this._onWillExecuteCommand=new q,this._onDidExecuteCommand=new q,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Rt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};Ej=Fu([Pn(0,Ae)],Ej);let kS=class extends cqe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new ne;g.add(J(f,_e.KEY_DOWN,p=>{const m=new ui(p);this._dispatch(m,m.target)&&(m.preventDefault(),m.stopPropagation())})),g.add(J(f,_e.KEY_UP,p=>{const m=new ui(p);this._singleModifierDispatch(m,m.target)&&m.preventDefault()})),this._domNodeListeners.push(new WZe(f,g))},l=f=>{for(let g=0;g{f.getOption(70)||a(f.getContainerDomNode())},d=f=>{f.getOption(70)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const h=f=>{a(f.getContainerDomNode())},u=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(h)),this._register(r.onDiffEditorRemove(u)),r.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,s){return Vc(Rt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>({keybinding:dH(i.keybinding,ua),command:i.command??null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Re(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return ri.document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new Boe(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=YE.resolveKeybinding(a,ua);for(const c of l)i[s++]=new Boe(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new Lg(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new YE([t],ua)}};kS=Fu([Pn(0,Xe),Pn(1,ki),Pn(2,To),Pn(3,fn),Pn(4,Li),Pn(5,Bt)],kS);class WZe extends G{constructor(e,t){super(),this.domNode=e,this._register(t)}}function Lre(n){return!!n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof He)}let jP=class{constructor(e){this.logService=e,this._onDidChangeConfiguration=new q,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const t=new NZe(e);this._configuration=new D3(t.reload(),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),Vs.createEmptyModel(e),new En,Vs.createEmptyModel(e),new En,e),t.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=Lre(e)?e:Lre(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new oqe({keys:i,overrides:[]},t,this._configuration,void 0,this.logService);s.source=8,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}};jP=Fu([Pn(0,Li)],jP);let Nj=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new q,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=U.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};Nj=Fu([Pn(0,lt),Pn(1,Ui),Pn(2,un)],Nj);let Dj=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Ur||yt?` `:`\r -`}};Tj=Ou([Fn(0,lt)],Tj);class zZe{publicLog2(){}}const mE=class mE{constructor(){const e=He.from({scheme:mE.SCHEME,authority:"model",path:"/"});this.workspace={id:Gbe,folders:[new Lqe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===mE.SCHEME?this.workspace.folders[0]:null}};mE.SCHEME="inmemory";let Rj=mE;function $P(n,e,t){if(!e||!(n instanceof jP))return;const i=[];Object.keys(e).forEach(s=>{iqe(s)&&i.push([`editor.${s}`,e[s]]),t&&nqe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let Mj=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:NZ.convert(e),s=new Map;for(const a of i){if(!(a instanceof Em))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=s.get(l);c||(c=[],s.set(l,c)),c.push(ln.replaceMove(D.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:J1(Iz.bulkEditServiceSummary,o,r),isApplied:o>0}}};Mj=Ou([Fn(0,qi)],Mj);class jZe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return rc(e)}}let Aj=class extends jUe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};Aj=Ou([Fn(0,Mu),Fn(1,Ft)],Aj);class $Ze{constructor(){this._neverEmitter=new q,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class UZe extends Dz{constructor(){super()}}class qZe extends MZe{constructor(){super(new X4e)}}let Pj=class extends Wz{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};Pj=Ou([Fn(0,Ro),Fn(1,fn),Fn(2,zg),Fn(3,Ht),Fn(4,uc),Fn(5,Xe)],Pj);const KZe={esmModuleLocation:void 0,label:"editorWorkerService"};let Oj=class extends HH{constructor(e,t,i,s,o){super(KZe,e,t,i,s,o)}};Oj=Ou([Fn(0,qi),Fn(1,s3),Fn(2,ki),Fn(3,Ki),Fn(4,De)],Oj);class GZe{async playSignal(e,t){}}xt(ki,qZe,0);xt(lt,jP,0);xt(s3,Dj,0);xt(Ype,Tj,0);xt(Rg,Rj,0);xt(hw,jZe,0);xt(Ro,zZe,0);xt(SD,HZe,0);xt(dZ,WZe,0);xt(fn,Ij,0);xt(Pu,Wb,0);xt(un,UZe,0);xt(ml,fZe,0);xt(qi,Uz,0);xt(_Y,$z,0);xt(Xe,Lj,0);xt(Kbe,BZe,0);xt(Tg,Ej,0);xt(Qo,XUe,0);xt(Zr,Oj,0);xt(ID,Mj,0);xt(Ybe,$Ze,0);xt(Xo,kj,0);xt(Us,bj,0);xt(mc,CYe,0);xt(Ei,Nj,0);xt(Ht,IS,0);xt(Do,pj,0);xt(zg,Aj,0);xt(jg,jz,0);xt(xa,Sj,0);xt(gl,Pj,0);xt(uc,vj,0);xt(Kg,GZe,0);xt(nZ,PZe,0);xt(vpe,tFe,0);xt(oX,OZe,0);var et;(function(n){const e=new cx;for(const[l,c]of Rie())e.set(l,c);const t=new zP(e,!0);e.set(Ae,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof Uh?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new q;function r(l){if(s)return t;s=!0;for(const[d,h]of Rie())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=mt(d);e.get(h)instanceof Uh&&e.set(h,l[d])}const c=AZe();for(const d of c)try{t.createInstance(d)}catch(h){Je(h)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new ne,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(et||(et={}));function lf(n,e){return n}function j3(n){return Ci(n)}function Ire(n,e,t,i=ls.ofCaller()){return Xge({debugName:()=>`Configuration Key "${n}"`},s=>t.onDidChangeConfiguration(o=>{o.affectsConfiguration(n)&&s(o)}),()=>t.getValue(n)??e,i)}function Nh(n,e,t,i=ls.ofCaller()){const s=n.bindTo(e),o=new ne;return no({debugName:()=>`Set Context Key "${n.key}"`},r=>{const a=t(r);return s.set(a),a},i).recomputeInitiallyAndOnChange(o),o}class nh{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new nh(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new nh(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}function YZe(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function w0(n,e){return n.appendChild(e),Re(()=>{e.remove()})}function ZZe(n,e){return n.prepend(e),Re(()=>{e.remove()})}class r1e extends G{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new eme(e,t)),this._width=Ze(this,this.elementSizeObserver.getWidth()),this._height=Ze(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>wi(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Nre(n,e,t){let i=e.get(),s=i,o=i;const r=Ze("animatedValue",i);let a=-1;const l=300;let c;t.add(ZS({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(n.cancelAnimationFrame(c),c=void 0),s=o,i=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;o=Math.floor(XZe(h,s,i-s,l)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const sF=class sF{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${sF._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};sF._counter=0;let Fj=sF;function d_(n,e){return qe(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function qP(n,e,t,i){const s=new ne,o=[];return s.add(Eo((r,a)=>{const l=e.read(r),c=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(const u of o)h.removeZone(u),i==null||i.delete(u);o.length=0;for(const u of l){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i==null||i.add(f),c.set(u,f)}}),t&&t(!1),a.add(ZS({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}}},(h,u)=>{for(const f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(const g of u.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),s}class QZe extends Wi{dispose(){super.dispose(!0)}}function Dre(n,e){const t=_I(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return D.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return D.fromPositions(new U(s,n.column))}if(!t.innerChanges)return D.fromPositions(new U(t.modified.startLineNumber,1));const i=_I(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return D.fromPositions(new U(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=JZe(i.originalRange.getEndPosition(),n);return D.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function JZe(n,e){return n.lineNumber===e.lineNumber?new rs(0,e.column-n.column):new rs(e.lineNumber-n.lineNumber,e.column-1)}function eXe(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}class KP{static create(e,t=void 0){return new Tre(e,e,t)}static createWithDisposable(e,t,i=void 0){const s=new ne;return s.add(t),s.add(e),new Tre(e,s,i)}}class Tre extends KP{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new tXe(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class tXe extends KP{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}var aX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lX=function(n,e){return function(t,i){e(t,i,n)}};const iXe=Ai("diff-review-insert",de.add,_(97,"Icon for 'Insert' in accessible diff viewer.")),nXe=Ai("diff-review-remove",de.remove,_(98,"Icon for 'Remove' in accessible diff viewer.")),sXe=Ai("diff-review-close",de.close,_(99,"Icon for 'Close' in accessible diff viewer."));var Ny;let _v=(Ny=class extends G{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=oe(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(Bj,this._diffs,this._models,this._setVisible,this._canClose)),f=d.store.add(this._instantiationService.createInstance(Wj,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){wi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){wi(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){wi(e=>{this._setVisible(!1,e)})}},Ny._ttPolicy=Tu("diffReview",{createHTML:e=>e}),Ny);_v=aX([lX(8,Ae)],_v);let Bj=class extends G{constructor(e,t,i,s,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=o,this._groups=Ze(this,[]),this._currentGroupIdx=Ze(this,0),this._currentElementIdx=Ze(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))==null?void 0:l.lines[r]}),this._register(qe(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=oXe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());wi(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===hr.Deleted?this._accessibilitySignalService.playSignal(dr.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===hr.Added&&this._accessibilitySignalService.playSignal(dr.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(qe(r=>{const a=this.currentElement.read(r);if(a&&a.type!==hr.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(D.fromPositions(new U(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||cS(t,s=>{this._currentGroupIdx.set(Me.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||wi(i=>{this._currentElementIdx.set(Me.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&wi(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===hr.Deleted?this._models.originalReveal(D.fromPositions(new U(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==hr.Header?D.fromPositions(new U(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};Bj=aX([lX(4,Kg)],Bj);const lL=3;function oXe(n,e,t){const i=[];for(const s of CG(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*lL)){const o=[];o.push(new aXe);const r=new Ye(Math.max(1,s[0].original.startLineNumber-lL),Math.min(s[s.length-1].original.endLineNumberExclusive+lL,e+1)),a=new Ye(Math.max(1,s[0].modified.startLineNumber-lL),Math.min(s[s.length-1].modified.endLineNumberExclusive+lL,t+1));Qfe(s,(d,h)=>{const u=new Ye(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new Ye(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(g=>{o.push(new dXe(g,f.startLineNumber+(g-u.startLineNumber)))}),h&&(h.original.forEach(g=>{o.push(new lXe(h,g))}),h.modified.forEach(g=>{o.push(new cXe(h,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new rXe(new $o(l,c),o))}return i}var hr;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(hr||(hr={}));class rXe{constructor(e,t){this.range=e,this.lines=t}}class aXe{constructor(){this.type=hr.Header}}class lXe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=hr.Deleted,this.modifiedLineNumber=void 0}}class cXe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=hr.Added,this.originalLineNumber=void 0}}class dXe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=hr.Unchanged}}let Wj=class extends G{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new Vr(a)),this._register(qe(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(Iv({id:"diffreview.close",label:_(100,"Close"),class:"close-diff-review "+Ue.asClassName(sXe),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new wD(this._content,{})),ys(this.domNode,this._scrollbar.getDomNode(),a),this._register(qe(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Re(()=>{ys(this.domNode)})),this._register(d_(this.domNode,{width:this._width,height:this._height})),this._register(d_(this._content,{width:this._width,height:this._height})),this._register(Eo((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(xn(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",_(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Ms(s,i.get(59)),ys(this._content,s);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(75),d=this._model.currentGroup.get();for(const h of(d==null?void 0:d.lines)||[]){if(!d)break;let u;if(h.type===hr.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,m=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,v=L=>L===0?_(102,"no lines changed"):L===1?_(103,"1 line changed"):_(104,"{0} lines changed",L),w=v(p.original.length),C=v(p.modified.length);g.setAttribute("aria-label",_(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",m+1,b,p.original.startLineNumber,w,p.modified.startLineNumber,C));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${m+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),u=g}else u=this._createRow(h,c,this._width.get(),t,o,a,i,r,l);s.appendChild(u);const f=oe(g=>this._model.currentElement.read(g)===h);e.add(qe(g=>{const p=f.read(g);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(J(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let b=null;switch(e.type){case hr.Added:g="diff-review-row line-insert",p=" char-insert",b=iXe;break;case hr.Deleted:g="diff-review-row line-delete",p=" char-delete",b=nXe;break}const v=document.createElement("div");v.style.minWidth=i+"px",v.className=g,v.setAttribute("role","listitem"),v.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,v.appendChild(w);const C=document.createElement("span");C.style.width=h+"px",C.style.minWidth=h+"px",C.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",w.appendChild(C);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const L=document.createElement("span");if(L.className=m,b){const I=document.createElement("span");I.className=Ue.asClassName(b),I.innerText="  ",L.appendChild(I)}else L.innerText="  ";w.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let I=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);_v._ttPolicy&&(I=_v._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),x=l.getLineContent(e.modifiedLineNumber)}else{let I=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);_v._ttPolicy&&(I=_v._ttPolicy.createHTML(I)),w.insertAdjacentHTML("beforeend",I),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=_(106,"blank"));let E="";switch(e.type){case hr.Unchanged:e.originalLineNumber===e.modifiedLineNumber?E=_(107,"{0} unchanged line {1}",x,e.originalLineNumber):E=_(108,"{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case hr.Added:E=_(109,"+ {0} modified line {1}",x,e.modifiedLineNumber);break;case hr.Deleted:E=_(110,"- {0} original line {1}",x,e.originalLineNumber);break}return v.setAttribute("aria-label",E),v}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=vn.createEmpty(r,o),d=hl.isBasicASCII(r,e.mightContainNonBasicASCII()),h=hl.containsRTL(r,d,e.mightContainRTL());return r3(new Vg(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,r,!1,d,h,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==Cg.OFF,null,null,l)).html}};Wj=aX([lX(5,un)],Wj);class hXe{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}F("diffEditor.move.border","#8b8b8b9c",_(137,"The border color for text that got moved in the diff editor."));F("diffEditor.moveActive.border","#FFA500",_(138,"The active border color for text that got moved in the diff editor."));F("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},_(139,"The color of the shadow around unchanged region widgets."));const uXe=Ai("diff-insert",de.add,_(140,"Line decoration for inserts in the diff editor.")),a1e=Ai("diff-remove",de.remove,_(141,"Line decoration for removals in the diff editor.")),Rre=nt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Ue.asClassName(uXe),marginClassName:"gutter-insert"}),Mre=nt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Ue.asClassName(a1e),marginClassName:"gutter-delete"}),Are=nt.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Pre=nt.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Ore=nt.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),fXe=nt.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),gXe=nt.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),Hj=nt.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),pXe=nt.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),mXe=nt.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var l1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vj=function(n,e){return function(t,i){e(t,i,n)}},_b;const c1e=mt("diffProviderFactoryService");let zj=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(jj,e)}};zj=l1e([Vj(0,Ae)],zj);xt(c1e,zj,1);var Zv;let jj=(Zv=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new q,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)==null||e.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new cl(new Ye(1,2),new Ye(1,t.getLineCount()+1),[new lr(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=_b.diffCache.get(o);if(a&&a.context===r)return a.result;const l=xs.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:(c==null?void 0:c.quitEarly)??!0,detectedMoves:i.computeMoves?(c==null?void 0:c.moves.length)??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return _b.diffCache.size>10&&_b.diffCache.delete(_b.diffCache.keys().next().value),_b.diffCache.set(o,{result:c,context:r}),c}setOptions(e){var i;let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((i=this.diffAlgorithmOnDidChangeSubscription)==null||i.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},_b=Zv,Zv.diffCache=new Map,Zv);jj=_b=l1e([Vj(1,Zr),Vj(2,Ro)],jj);function d1e(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,o)=>{let r=!0,a=!1;const l=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=qe(d=>{const{isFinished:h,error:u,state:f}=l.read(d);(h||u)&&(r?a=!0:c.dispose(),u?o(u===!0?f:u):s(f))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),o(new ic)});if(i.isCancellationRequested){c.dispose(),d.dispose(),o(new ic);return}}r=!1,a&&c.dispose()})}function da(n,e,t=ls.ofCaller()){return new _Xe(typeof n=="string"?n:new ho(n,void 0,void 0),e,t)}class _Xe extends YS{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{wi(s=>{for(const o of this._observers)s.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}var bXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vXe=function(n,e){return function(t,i){e(t,i,n)}};let $j=class extends G{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Ze(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ze(this,void 0),this.diff=this._diff,this._unchangedRegions=Ze(this,void 0),this.unchangedRegions=oe(this,a=>{var l;return this._options.hideUnchangedRegions.read(a)?((l=this._unchangedRegions.read(a))==null?void 0:l.regions)??[]:(wi(c=>{var d;for(const h of((d=this._unchangedRegions.read(void 0))==null?void 0:d.regions)||[])h.collapseAll(c)}),[])}),this.movedTextToCompare=Ze(this,void 0),this._activeMovedText=Ze(this,void 0),this._hoveredMovedText=Ze(this,void 0),this.activeMovedText=oe(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new Wi,this._diffProvider=oe(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=da("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Re(()=>this._cancellationTokenSource.cancel()));const s=Ul("contentChangedSignal"),o=this._register(new ai(()=>s.trigger(void 0),200));this._register(qe(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?Ye.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?Ye.fromRangeInclusive(g):void 0),h=l.regions.map((g,p)=>!c[p]||!d[p]?void 0:new om(c[p].startLineNumber,d[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Ts),u=[];let f=!1;for(const g of CG(h,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((b,v)=>b+v.lineCount,0),m=new om(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.read(void 0),g[g.length-1].visibleLineCountBottom.read(void 0));u.push(m)}else u.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));wi(m=>{this._unchangedRegions.set({regions:u,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const r=(a,l,c)=>{const d=om.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const m=u.originalDecorationIds.map(C=>e.original.getDecorationRange(C)).map(C=>C?Ye.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?Ye.fromRangeInclusive(C):void 0);let w=eXe(u.regions.map((C,S)=>{if(!m[S]||!b[S])return;const L=m[S].length;return new om(m[S].startLineNumber,b[S].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Ts),(C,S)=>!S||C.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&C.originalLineNumber>=S.originalLineNumber+S.lineCount).map(C=>new $o(C.getHiddenOriginalRange(c),C.getHiddenModifiedRange(c)));w=$o.clip(w,Ye.ofLength(1,e.original.getLineCount()),Ye.ofLength(1,e.modified.getLineCount())),h=$o.inverse(w,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const m of d){const b=h.filter(v=>v.original.intersectsStrict(m.originalUnchangedRange)&&v.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(b,l))}else f.push(...d);const g=e.original.deltaDecorations((u==null?void 0:u.originalDecorationIds)||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((u==null?void 0:u.modifiedDecorationIds)||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Kf.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Kf.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(Eo(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),s.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(f=>{const g=Kf.fromModelContentChanges(f.changes);d=iP(d,g)}));let h=[];l.add(e.modified.onDidChangeContent(f=>{const g=Kf.fromModelContentChanges(f.changes);h=iP(h,g)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=wXe(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,wi(f=>{r(u,f),this._lastDiff=u;const g=cX.fromDiffResult(u);this._diff.set(g,f),this._isDiffUpToDate.set(!0,f);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(m=>m.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){var o,r;if(((o=this.diff.get())==null?void 0:o.mappings.length)===0)return;const s=((r=this._unchangedRegions.get())==null?void 0:r.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var o,r;if(((o=this.diff.get())==null?void 0:o.mappings.length)===0)return;const s=((r=this._unchangedRegions.get())==null?void 0:r.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await d1e(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var s;const t=(s=e.collapsedRegions)==null?void 0:s.map(o=>Ye.deserialize(o.range)),i=this._unchangedRegions.get();!i||!t||wi(o=>{for(const r of i.regions)for(const a of t)if(r.modifiedUnchangedRange.intersect(a)){r.setHiddenModifiedRange(a,o);break}})}};$j=bXe([vXe(2,c1e)],$j);function wXe(n,e,t){return{changes:n.changes.map(i=>new cl(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>CXe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function CXe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return i.startColumn===1&&s.startColumn===1&&(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew h1e(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class h1e{constructor(e){this.lineRangeMapping=e}}class om{static fromDiffs(e,t,i,s,o){const r=cl.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,f=c+h===t+1&&d+h===i+1;(u||f)&&h>=o+s?(u&&!f&&(h-=o),f&&!u&&(c+=o,d+=o,h-=o),a.push(new om(c,d,h,0,0))):h>=o*2+s&&(c+=o,d+=o,h-=o*2,a.push(new om(c,d,h,0,0)))}return a}get originalUnchangedRange(){return Ye.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ye.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Ze(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ze(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=oe(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Ze(this,void 0);const r=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-s),0);Wte(s===r),Wte(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new $l(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of s.ranges){const d=l===s.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-r,u=new om(o,r,h,0,0);u.setHiddenModifiedRange(c,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ye.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ye.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&s{a.preventDefault();const l=e.ownerDocument.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0);if(!c||c.collapsed)return;const d=c.startContainer.nodeType===Node.TEXT_NODE?c.startContainer.parentElement:c.startContainer,h=c.endContainer.nodeType===Node.TEXT_NODE?c.endContainer.parentElement:c.endContainer;if(!d||!h)return;const u=t.getModelPositionAt(d,c.startOffset),f=t.getModelPositionAt(h,c.endOffset);if(!u||!f)return;const g=u.delta(i.original.startLineNumber-1),p=f.delta(i.original.startLineNumber-1),m=p.isBefore(g)?D.fromPositions(p,g):D.fromPositions(g,p),b=s.getValueInRange(m);o.writeText(b)})),r}class SXe extends G{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=s,this._diff=o,this._editor=r,this._renderLinesResult=a,this._originalTextModel=l,this._contextMenuService=c,this._clipboardService=d,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=Ue.asClassName(de.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${h}px`,this._diffActions.style.lineHeight=`${h}px`,this._marginDomNode.appendChild(this._diffActions);let u=0;const f=s.getOption(144)&&!nc,g=(p,m,b)=>{this._contextMenuService.showContextMenu({domForShadowRoot:f?s.getDomNode()??void 0:void 0,getAnchor:()=>p,onHide:b,getActions:()=>{const v=[],w=o.modified.isEmpty;return v.push(new ol("diff.clipboard.copyDeletedContent",w?o.original.length>1?_(112,"Copy deleted lines"):_(113,"Copy deleted line"):o.original.length>1?_(114,"Copy changed lines"):_(115,"Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());await this._clipboardService.writeText(S)})),o.original.length>1&&v.push(new ol("diff.clipboard.copyDeletedLineContent",w?_(116,"Copy deleted line ({0})",o.original.startLineNumber+u):_(117,"Copy changed line ({0})",o.original.startLineNumber+u),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(o.original.startLineNumber+u);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` +`}};Dj=Fu([Pn(0,lt)],Dj);class HZe{publicLog2(){}}const mI=class mI{constructor(){const e=He.from({scheme:mI.SCHEME,authority:"model",path:"/"});this.workspace={id:$be,folders:[new Sqe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===mI.SCHEME?this.workspace.folders[0]:null}};mI.SCHEME="inmemory";let Tj=mI;function $P(n,e,t){if(!e||!(n instanceof jP))return;const i=[];Object.keys(e).forEach(s=>{eqe(s)&&i.push([`editor.${s}`,e[s]]),t&&tqe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let Rj=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}async apply(e,t){const i=Array.isArray(e)?e:EZ.convert(e),s=new Map;for(const a of i){if(!(a instanceof km))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=s.get(l);c||(c=[],s.set(l,c)),c.push(ln.replaceMove(D.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:Z1(Iz.bulkEditServiceSummary,o,r),isApplied:o>0}}};Rj=Fu([Pn(0,Ui)],Rj);class VZe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ic(e)}}let Mj=class extends VUe{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};Mj=Fu([Pn(0,Au),Pn(1,Bt)],Mj);class zZe{constructor(){this._neverEmitter=new q,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class jZe extends Nz{constructor(){super()}}class $Ze extends TZe{constructor(){super(new Y4e)}}let Aj=class extends Bz{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};Aj=Fu([Pn(0,To),Pn(1,fn),Pn(2,zg),Pn(3,Vt),Pn(4,lc),Pn(5,Xe)],Aj);const UZe={esmModuleLocation:void 0,label:"editorWorkerService"};let Pj=class extends WH{constructor(e,t,i,s,o){super(UZe,e,t,i,s,o)}};Pj=Fu([Pn(0,Ui),Pn(1,s3),Pn(2,Li),Pn(3,qi),Pn(4,De)],Pj);class qZe{async playSignal(e,t){}}Lt(Li,$Ze,0);Lt(lt,jP,0);Lt(s3,Nj,0);Lt(Upe,Dj,0);Lt(Rg,Tj,0);Lt(lw,VZe,0);Lt(To,HZe,0);Lt(SD,BZe,0);Lt(cZ,FZe,0);Lt(fn,Ij,0);Lt(Ou,Bb,0);Lt(un,jZe,0);Lt(ml,hZe,0);Lt(Ui,$z,0);Lt(mY,jz,0);Lt(Xe,xj,0);Lt(jbe,OZe,0);Lt(Tg,kj,0);Lt(Jo,YUe,0);Lt(Qr,Pj,0);Lt(ED,Rj,0);Lt(Ube,zZe,0);Lt(Qo,Lj,0);Lt(Us,_j,0);Lt(uc,vYe,0);Lt(ki,Ej,0);Lt(Vt,kS,0);Lt(No,gj,0);Lt(zg,Mj,0);Lt(jg,zz,0);Lt(La,yj,0);Lt(gl,Aj,0);Lt(lc,bj,0);Lt(Kg,qZe,0);Lt(iZ,MZe,0);Lt(ppe,J4e,0);Lt(sX,AZe,0);var et;(function(n){const e=new ax;for(const[l,c]of Die())e.set(l,c);const t=new zP(e,!0);e.set(Ae,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof qh?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new q;function r(l){if(s)return t;s=!0;for(const[d,h]of Die())e.get(d)||e.set(d,h);for(const d in l)if(l.hasOwnProperty(d)){const h=mt(d);e.get(h)instanceof qh&&e.set(h,l[d])}const c=RZe();for(const d of c)try{t.createInstance(d)}catch(h){Je(h)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new ne,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(et||(et={}));function lf(n,e){return n}function j3(n){return wi(n)}function kre(n,e,t,i=ds.ofCaller()){return Kge({debugName:()=>`Configuration Key "${n}"`},s=>t.onDidChangeConfiguration(o=>{o.affectsConfiguration(n)&&s(o)}),()=>t.getValue(n)??e,i)}function Dh(n,e,t,i=ds.ofCaller()){const s=n.bindTo(e),o=new ne;return so({debugName:()=>`Set Context Key "${n.key}"`},r=>{const a=t(r);return s.set(a),a},i).recomputeInitiallyAndOnChange(o),o}class oh{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new oh(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new oh(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i,1)}}function KZe(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function b0(n,e){return n.appendChild(e),Re(()=>{e.remove()})}function GZe(n,e){return n.prepend(e),Re(()=>{e.remove()})}class i1e extends G{get width(){return this._width}get height(){return this._height}get automaticLayout(){return this._automaticLayout}constructor(e,t){super(),this._automaticLayout=!1,this.elementSizeObserver=this._register(new Zpe(e,t)),this._width=Ze(this,this.elementSizeObserver.getWidth()),this._height=Ze(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>vi(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){this._automaticLayout=e,e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function Ire(n,e,t){let i=e.get(),s=i,o=i;const r=Ze("animatedValue",i);let a=-1;const l=300;let c;t.add(GS({changeTracker:{createChangeSummary:()=>({animate:!1}),handleChange:(h,u)=>(h.didChange(e)&&(u.animate=u.animate||h.change),!0)}},(h,u)=>{c!==void 0&&(n.cancelAnimationFrame(c),c=void 0),s=o,i=e.read(h),a=Date.now()-(u.animate?0:l),d()}));function d(){const h=Date.now()-a;o=Math.floor(YZe(h,s,i-s,l)),h{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}const sF=class sF{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${sF._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}};sF._counter=0;let Oj=sF;function c_(n,e){return qe(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function qP(n,e,t,i){const s=new ne,o=[];return s.add(ko((r,a)=>{const l=e.read(r),c=new Map,d=new Map;t&&t(!0),n.changeViewZones(h=>{for(const u of o)h.removeZone(u),i==null||i.delete(u);o.length=0;for(const u of l){const f=h.addZone(u);u.setZoneId&&u.setZoneId(f),o.push(f),i==null||i.add(f),c.set(u,f)}}),t&&t(!1),a.add(GS({changeTracker:{createChangeSummary(){return{zoneIds:[]}},handleChange(h,u){const f=d.get(h.changedObservable);return f!==void 0&&u.zoneIds.push(f),!0}}},(h,u)=>{for(const f of l)f.onChange&&(d.set(f.onChange,c.get(f)),f.onChange.read(h));t&&t(!0),n.changeViewZones(f=>{for(const g of u.zoneIds)f.layoutZone(g)}),t&&t(!1)}))})),s.add({dispose(){t&&t(!0),n.changeViewZones(r=>{for(const a of o)r.removeZone(a)}),i==null||i.clear(),t&&t(!1)}}),s}class ZZe extends Bi{dispose(){super.dispose(!0)}}function Ere(n,e){const t=_E(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return D.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return D.fromPositions(new U(s,n.column))}if(!t.innerChanges)return D.fromPositions(new U(t.modified.startLineNumber,1));const i=_E(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return D.fromPositions(new U(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=XZe(i.originalRange.getEndPosition(),n);return D.fromPositions(s.addToPosition(i.modifiedRange.getEndPosition()))}}function XZe(n,e){return n.lineNumber===e.lineNumber?new ls(0,e.column-n.column):new ls(e.lineNumber-n.lineNumber,e.column-1)}function QZe(n,e){let t;return n.filter(i=>{const s=e(i,t);return t=i,s})}class KP{static create(e,t=void 0){return new Nre(e,e,t)}static createWithDisposable(e,t,i=void 0){const s=new ne;return s.add(t),s.add(e),new Nre(e,s,i)}}class Nre extends KP{constructor(e,t,i){super(),this.object=e,this._disposable=t,this._debugOwner=i,this._refCount=1,this._isDisposed=!1,this._owners=[],i&&this._addOwner(i)}_addOwner(e){e&&this._owners.push(e)}createNewRef(e){return this._refCount++,e&&this._addOwner(e),new JZe(this,e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._decreaseRefCount(this._debugOwner))}_decreaseRefCount(e){if(this._refCount--,this._refCount===0&&this._disposable.dispose(),e){const t=this._owners.indexOf(e);t!==-1&&this._owners.splice(t,1)}}}class JZe extends KP{constructor(e,t){super(),this._base=e,this._debugOwner=t,this._isDisposed=!1}get object(){return this._base.object}createNewRef(e){return this._base.createNewRef(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this._base._decreaseRefCount(this._debugOwner))}}var rX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},aX=function(n,e){return function(t,i){e(t,i,n)}};const eXe=Ri("diff-review-insert",de.add,_(97,"Icon for 'Insert' in accessible diff viewer.")),tXe=Ri("diff-review-remove",de.remove,_(98,"Icon for 'Remove' in accessible diff viewer.")),iXe=Ri("diff-review-close",de.close,_(99,"Icon for 'Close' in accessible diff viewer."));var Iy;let gv=(Iy=class extends G{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._models=l,this._instantiationService=c,this._state=oe(this,d=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const u=d.store.add(this._instantiationService.createInstance(Fj,this._diffs,this._models,this._setVisible,this._canClose)),f=d.store.add(this._instantiationService.createInstance(Bj,this._parentNode,u,this._width,this._height,this._models));return{model:u,view:f}}).recomputeInitiallyAndOnChange(this._store)}next(){vi(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this._state.get().model.nextGroup(e)})}prev(){vi(e=>{this._setVisible(!0,e),this._state.get().model.previousGroup(e)})}close(){vi(e=>{this._setVisible(!1,e)})}},Iy._ttPolicy=Ru("diffReview",{createHTML:e=>e}),Iy);gv=rX([aX(8,Ae)],gv);let Fj=class extends G{constructor(e,t,i,s,o){super(),this._diffs=e,this._models=t,this._setVisible=i,this.canClose=s,this._accessibilitySignalService=o,this._groups=Ze(this,[]),this._currentGroupIdx=Ze(this,0),this._currentElementIdx=Ze(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))==null?void 0:l.lines[r]}),this._register(qe(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=nXe(a,this._models.getOriginalModel().getLineCount(),this._models.getModifiedModel().getLineCount());vi(c=>{const d=this._models.getModifiedPosition();if(d){const h=l.findIndex(u=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===fr.Deleted?this._accessibilitySignalService.playSignal(ur.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===fr.Added&&this._accessibilitySignalService.playSignal(ur.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(qe(r=>{const a=this.currentElement.read(r);if(a&&a.type!==fr.Header){const l=a.modifiedLineNumber??a.diff.modified.startLineNumber;this._models.modifiedSetSelection(D.fromPositions(new U(l,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||aS(t,s=>{this._currentGroupIdx.set(Me.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||vi(i=>{this._currentElementIdx.set(Me.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&vi(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){if(!this.canClose.get())return;this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===fr.Deleted?this._models.originalReveal(D.fromPositions(new U(e.originalLineNumber,1))):this._models.modifiedReveal(e.type!==fr.Header?D.fromPositions(new U(e.modifiedLineNumber,1)):void 0))}close(){this.canClose.get()&&(this._setVisible(!1,void 0),this._models.modifiedFocus())}};Fj=rX([aX(4,Kg)],Fj);const lL=3;function nXe(n,e,t){const i=[];for(const s of wG(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*lL)){const o=[];o.push(new oXe);const r=new Ye(Math.max(1,s[0].original.startLineNumber-lL),Math.min(s[s.length-1].original.endLineNumberExclusive+lL,e+1)),a=new Ye(Math.max(1,s[0].modified.startLineNumber-lL),Math.min(s[s.length-1].modified.endLineNumberExclusive+lL,t+1));Gfe(s,(d,h)=>{const u=new Ye(d?d.original.endLineNumberExclusive:r.startLineNumber,h?h.original.startLineNumber:r.endLineNumberExclusive),f=new Ye(d?d.modified.endLineNumberExclusive:a.startLineNumber,h?h.modified.startLineNumber:a.endLineNumberExclusive);u.forEach(g=>{o.push(new lXe(g,f.startLineNumber+(g-u.startLineNumber)))}),h&&(h.original.forEach(g=>{o.push(new rXe(h,g))}),h.modified.forEach(g=>{o.push(new aXe(h,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new sXe(new Uo(l,c),o))}return i}var fr;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(fr||(fr={}));class sXe{constructor(e,t){this.range=e,this.lines=t}}class oXe{constructor(){this.type=fr.Header}}class rXe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=fr.Deleted,this.modifiedLineNumber=void 0}}class aXe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=fr.Added,this.originalLineNumber=void 0}}class lXe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=fr.Unchanged}}let Bj=class extends G{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._models=o,this._languageService=r,this.domNode=this._element,this.domNode.className="monaco-component diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new jr(a)),this._register(qe(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(Lv({id:"diffreview.close",label:_(100,"Close"),class:"close-diff-review "+$e.asClassName(iXe),enabled:!0,run:async()=>t.close()}),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new wD(this._content,{})),Ss(this.domNode,this._scrollbar.getDomNode(),a),this._register(qe(l=>{this._height.read(l),this._width.read(l),this._scrollbar.scanDomNode()})),this._register(Re(()=>{Ss(this.domNode)})),this._register(c_(this.domNode,{width:this._width,height:this._height})),this._register(c_(this._content,{width:this._width,height:this._height})),this._register(ko((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(kn(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._models.getOriginalOptions(),i=this._models.getModifiedOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",_(101,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Ms(s,i.get(59)),Ss(this._content,s);const o=this._models.getOriginalModel(),r=this._models.getModifiedModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(75),d=this._model.currentGroup.get();for(const h of(d==null?void 0:d.lines)||[]){if(!d)break;let u;if(h.type===fr.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,m=this._model.currentGroupIndex.get(),b=this._model.groups.get().length,v=L=>L===0?_(102,"no lines changed"):L===1?_(103,"1 line changed"):_(104,"{0} lines changed",L),w=v(p.original.length),C=v(p.modified.length);g.setAttribute("aria-label",_(105,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",m+1,b,p.original.startLineNumber,w,p.modified.startLineNumber,C));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${m+1}/${b}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),u=g}else u=this._createRow(h,c,this._width.get(),t,o,a,i,r,l);s.appendChild(u);const f=oe(g=>this._model.currentElement.read(g)===h);e.add(qe(g=>{const p=f.read(g);u.tabIndex=p?0:-1,p&&u.focus()})),e.add(J(u,"focus",()=>{this._model.goToLine(h)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(165),h=d.glyphMarginWidth+d.lineNumbersWidth,u=a.get(165),f=10+u.glyphMarginWidth+u.lineNumbersWidth;let g="diff-review-row",p="";const m="diff-review-spacer";let b=null;switch(e.type){case fr.Added:g="diff-review-row line-insert",p=" char-insert",b=eXe;break;case fr.Deleted:g="diff-review-row line-delete",p=" char-delete",b=tXe;break}const v=document.createElement("div");v.style.minWidth=i+"px",v.className=g,v.setAttribute("role","listitem"),v.ariaLevel="";const w=document.createElement("div");w.className="diff-review-cell",w.style.height=`${t}px`,v.appendChild(w);const C=document.createElement("span");C.style.width=h+"px",C.style.minWidth=h+"px",C.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.originalLineNumber))):C.innerText=" ",w.appendChild(C);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",w.appendChild(S);const L=document.createElement("span");if(L.className=m,b){const E=document.createElement("span");E.className=$e.asClassName(b),E.innerText="  ",L.appendChild(E)}else L.innerText="  ";w.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let E=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);gv._ttPolicy&&(E=gv._ttPolicy.createHTML(E)),w.insertAdjacentHTML("beforeend",E),x=l.getLineContent(e.modifiedLineNumber)}else{let E=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);gv._ttPolicy&&(E=gv._ttPolicy.createHTML(E)),w.insertAdjacentHTML("beforeend",E),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=_(106,"blank"));let I="";switch(e.type){case fr.Unchanged:e.originalLineNumber===e.modifiedLineNumber?I=_(107,"{0} unchanged line {1}",x,e.originalLineNumber):I=_(108,"{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case fr.Added:I=_(109,"+ {0} modified line {1}",x,e.modifiedLineNumber);break;case fr.Deleted:I=_(110,"- {0} original line {1}",x,e.originalLineNumber);break}return v.setAttribute("aria-label",I),v}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(59),l=t.get(117).verticalScrollbarSize,c=vn.createEmpty(r,o),d=hl.isBasicASCII(r,e.mightContainNonBasicASCII()),h=hl.containsRTL(r,d,e.mightContainRTL());return r3(new Vg(a.isMonospace&&!t.get(40),a.canUseHalfwidthRightwardsArrow,r,!1,d,h,0,c,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(133),t.get(113),t.get(108),t.get(60)!==Cg.OFF,null,null,l)).html}};Bj=rX([aX(5,un)],Bj);class cXe{constructor(e){this.editors=e}getOriginalModel(){return this.editors.original.getModel()}getOriginalOptions(){return this.editors.original.getOptions()}originalReveal(e){this.editors.original.revealRange(e),this.editors.original.setSelection(e),this.editors.original.focus()}getModifiedModel(){return this.editors.modified.getModel()}getModifiedOptions(){return this.editors.modified.getOptions()}modifiedReveal(e){e&&(this.editors.modified.revealRange(e),this.editors.modified.setSelection(e)),this.editors.modified.focus()}modifiedSetSelection(e){this.editors.modified.setSelection(e)}modifiedFocus(){this.editors.modified.focus()}getModifiedPosition(){return this.editors.modified.getPosition()??void 0}}F("diffEditor.move.border","#8b8b8b9c",_(137,"The border color for text that got moved in the diff editor."));F("diffEditor.moveActive.border","#FFA500",_(138,"The active border color for text that got moved in the diff editor."));F("diffEditor.unchangedRegionShadow",{dark:"#000000",light:"#737373BF",hcDark:"#000000",hcLight:"#737373BF"},_(139,"The color of the shadow around unchanged region widgets."));const dXe=Ri("diff-insert",de.add,_(140,"Line decoration for inserts in the diff editor.")),n1e=Ri("diff-remove",de.remove,_(141,"Line decoration for removals in the diff editor.")),Dre=st.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+$e.asClassName(dXe),marginClassName:"gutter-insert"}),Tre=st.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+$e.asClassName(n1e),marginClassName:"gutter-delete"}),Rre=st.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),Mre=st.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),Are=st.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),hXe=st.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),uXe=st.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),Wj=st.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),fXe=st.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),gXe=st.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"});var s1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hj=function(n,e){return function(t,i){e(t,i,n)}},mb;const o1e=mt("diffProviderFactoryService");let Vj=class{constructor(e){this.instantiationService=e}createDiffProvider(e){return this.instantiationService.createInstance(zj,e)}};Vj=s1e([Hj(0,Ae)],Vj);Lt(o1e,Vj,1);var Kv;let zj=(Kv=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new q,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)==null||e.dispose()}async computeDiff(e,t,i,s){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.isDisposed()||t.isDisposed())return{changes:[],identical:!0,quitEarly:!1,moves:[]};if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new cl(new Ye(1,2),new Ye(1,t.getLineCount()+1),[new dr(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const o=JSON.stringify([e.uri.toString(),t.uri.toString()]),r=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),a=mb.diffCache.get(o);if(a&&a.context===r)return a.result;const l=Ls.create(),c=await this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),d=l.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:d,timedOut:(c==null?void 0:c.quitEarly)??!0,detectedMoves:i.computeMoves?(c==null?void 0:c.moves.length)??0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!c)throw new Error("no diff result available");return mb.diffCache.size>10&&mb.diffCache.delete(mb.diffCache.keys().next().value),mb.diffCache.set(o,{result:c,context:r}),c}setOptions(e){var i;let t=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((i=this.diffAlgorithmOnDidChangeSubscription)==null||i.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),t=!0),t&&this.onDidChangeEventEmitter.fire()}},mb=Kv,Kv.diffCache=new Map,Kv);zj=mb=s1e([Hj(1,Qr),Hj(2,To)],zj);function r1e(n,e,t,i){return e||(e=s=>s!=null),new Promise((s,o)=>{let r=!0,a=!1;const l=n.map(d=>({isFinished:e(d),error:t?t(d):!1,state:d})),c=qe(d=>{const{isFinished:h,error:u,state:f}=l.read(d);(h||u)&&(r?a=!0:c.dispose(),u?o(u===!0?f:u):s(f))});if(i){const d=i.onCancellationRequested(()=>{c.dispose(),d.dispose(),o(new Ql)});if(i.isCancellationRequested){c.dispose(),d.dispose(),o(new Ql);return}}r=!1,a&&c.dispose()})}function ha(n,e,t=ds.ofCaller()){return new pXe(typeof n=="string"?n:new uo(n,void 0,void 0),e,t)}class pXe extends KS{constructor(e,t,i){super(i),this.event=t,this.handleEvent=()=>{vi(s=>{for(const o of this._observers)s.updateObserver(o,this),o.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}var mXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_Xe=function(n,e){return function(t,i){e(t,i,n)}};let jj=class extends G{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i){super(),this.model=e,this._options=t,this._diffProviderFactoryService=i,this._isDiffUpToDate=Ze(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Ze(this,void 0),this.diff=this._diff,this._unchangedRegions=Ze(this,void 0),this.unchangedRegions=oe(this,a=>{var l;return this._options.hideUnchangedRegions.read(a)?((l=this._unchangedRegions.read(a))==null?void 0:l.regions)??[]:(vi(c=>{var d;for(const h of((d=this._unchangedRegions.read(void 0))==null?void 0:d.regions)||[])h.collapseAll(c)}),[])}),this.movedTextToCompare=Ze(this,void 0),this._activeMovedText=Ze(this,void 0),this._hoveredMovedText=Ze(this,void 0),this.activeMovedText=oe(this,a=>this.movedTextToCompare.read(a)??this._hoveredMovedText.read(a)??this._activeMovedText.read(a)),this._cancellationTokenSource=new Bi,this._diffProvider=oe(this,a=>{const l=this._diffProviderFactoryService.createDiffProvider({diffAlgorithm:this._options.diffAlgorithm.read(a)}),c=ha("onDidChange",l.onDidChange);return{diffProvider:l,onChangeSignal:c}}),this._register(Re(()=>this._cancellationTokenSource.cancel()));const s=Vl("contentChangedSignal"),o=this._register(new ai(()=>s.trigger(void 0),200));this._register(qe(a=>{const l=this._unchangedRegions.read(a);if(!l||l.regions.some(g=>g.isDragged.read(a)))return;const c=l.originalDecorationIds.map(g=>e.original.getDecorationRange(g)).map(g=>g?Ye.fromRangeInclusive(g):void 0),d=l.modifiedDecorationIds.map(g=>e.modified.getDecorationRange(g)).map(g=>g?Ye.fromRangeInclusive(g):void 0),h=l.regions.map((g,p)=>!c[p]||!d[p]?void 0:new sm(c[p].startLineNumber,d[p].startLineNumber,c[p].length,g.visibleLineCountTop.read(a),g.visibleLineCountBottom.read(a))).filter(Ts),u=[];let f=!1;for(const g of wG(h,(p,m)=>p.getHiddenModifiedRange(a).endLineNumberExclusive===m.getHiddenModifiedRange(a).startLineNumber))if(g.length>1){f=!0;const p=g.reduce((b,v)=>b+v.lineCount,0),m=new sm(g[0].originalLineNumber,g[0].modifiedLineNumber,p,g[0].visibleLineCountTop.read(void 0),g[g.length-1].visibleLineCountBottom.read(void 0));u.push(m)}else u.push(g[0]);if(f){const g=e.original.deltaDecorations(l.originalDecorationIds,u.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations(l.modifiedDecorationIds,u.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));vi(m=>{this._unchangedRegions.set({regions:u,originalDecorationIds:g,modifiedDecorationIds:p},m)})}}));const r=(a,l,c)=>{const d=sm.fromDiffs(a.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(c),this._options.hideUnchangedRegionsContextLineCount.read(c));let h;const u=this._unchangedRegions.get();if(u){const m=u.originalDecorationIds.map(C=>e.original.getDecorationRange(C)).map(C=>C?Ye.fromRangeInclusive(C):void 0),b=u.modifiedDecorationIds.map(C=>e.modified.getDecorationRange(C)).map(C=>C?Ye.fromRangeInclusive(C):void 0);let w=QZe(u.regions.map((C,S)=>{if(!m[S]||!b[S])return;const L=m[S].length;return new sm(m[S].startLineNumber,b[S].startLineNumber,L,Math.min(C.visibleLineCountTop.get(),L),Math.min(C.visibleLineCountBottom.get(),L-C.visibleLineCountTop.get()))}).filter(Ts),(C,S)=>!S||C.modifiedLineNumber>=S.modifiedLineNumber+S.lineCount&&C.originalLineNumber>=S.originalLineNumber+S.lineCount).map(C=>new Uo(C.getHiddenOriginalRange(c),C.getHiddenModifiedRange(c)));w=Uo.clip(w,Ye.ofLength(1,e.original.getLineCount()),Ye.ofLength(1,e.modified.getLineCount())),h=Uo.inverse(w,e.original.getLineCount(),e.modified.getLineCount())}const f=[];if(h)for(const m of d){const b=h.filter(v=>v.original.intersectsStrict(m.originalUnchangedRange)&&v.modified.intersectsStrict(m.modifiedUnchangedRange));f.push(...m.setVisibleRanges(b,l))}else f.push(...d);const g=e.original.deltaDecorations((u==null?void 0:u.originalDecorationIds)||[],f.map(m=>({range:m.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),p=e.modified.deltaDecorations((u==null?void 0:u.modifiedDecorationIds)||[],f.map(m=>({range:m.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));this._unchangedRegions.set({regions:f,originalDecorationIds:g,modifiedDecorationIds:p},l)};this._register(e.modified.onDidChangeContent(a=>{if(this._diff.get()){const c=Kf.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(e.original.onDidChangeContent(a=>{if(this._diff.get()){const c=Kf.fromModelContentChanges(a.changes);this._lastDiff,e.original,e.modified}this._isDiffUpToDate.set(!1,void 0),o.schedule()})),this._register(ko(async(a,l)=>{this._options.hideUnchangedRegionsMinimumLineCount.read(a),this._options.hideUnchangedRegionsContextLineCount.read(a),o.cancel(),s.read(a);const c=this._diffProvider.read(a);c.onChangeSignal.read(a),this._isDiffUpToDate.set(!1,void 0);let d=[];l.add(e.original.onDidChangeContent(f=>{const g=Kf.fromModelContentChanges(f.changes);d=iP(d,g)}));let h=[];l.add(e.modified.onDidChangeContent(f=>{const g=Kf.fromModelContentChanges(f.changes);h=iP(h,g)}));let u=await c.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(a),maxComputationTimeMs:this._options.maxComputationTimeMs.read(a),computeMoves:this._options.showMoves.read(a)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||e.original.isDisposed()||e.modified.isDisposed()||(u=bXe(u,e.original,e.modified),u=(e.original,e.modified,void 0)??u,u=(e.original,e.modified,void 0)??u,vi(f=>{r(u,f),this._lastDiff=u;const g=lX.fromDiffResult(u);this._diff.set(g,f),this._isDiffUpToDate.set(!0,f);const p=this.movedTextToCompare.read(void 0);this.movedTextToCompare.set(p?this._lastDiff.moves.find(m=>m.lineRangeMapping.modified.intersect(p.lineRangeMapping.modified)):void 0,f)}))}))}ensureModifiedLineIsVisible(e,t,i){var o,r;if(((o=this.diff.get())==null?void 0:o.mappings.length)===0)return;const s=((r=this._unchangedRegions.get())==null?void 0:r.regions)||[];for(const a of s)if(a.getHiddenModifiedRange(void 0).contains(e)){a.showModifiedLine(e,t,i);return}}ensureOriginalLineIsVisible(e,t,i){var o,r;if(((o=this.diff.get())==null?void 0:o.mappings.length)===0)return;const s=((r=this._unchangedRegions.get())==null?void 0:r.regions)||[];for(const a of s)if(a.getHiddenOriginalRange(void 0).contains(e)){a.showOriginalLine(e,t,i);return}}async waitForDiff(){await r1e(this.isDiffUpToDate,e=>e)}serializeState(){const e=this._unchangedRegions.get();return{collapsedRegions:e==null?void 0:e.regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){var s;const t=(s=e.collapsedRegions)==null?void 0:s.map(o=>Ye.deserialize(o.range)),i=this._unchangedRegions.get();!i||!t||vi(o=>{for(const r of i.regions)for(const a of t)if(r.modifiedUnchangedRange.intersect(a)){r.setHiddenModifiedRange(a,o);break}})}};jj=mXe([_Xe(2,o1e)],jj);function bXe(n,e,t){return{changes:n.changes.map(i=>new cl(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>vXe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function vXe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return i.startColumn===1&&s.startColumn===1&&(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew a1e(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class a1e{constructor(e){this.lineRangeMapping=e}}class sm{static fromDiffs(e,t,i,s,o){const r=cl.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,h=l.original.length;const u=c===1&&d===1,f=c+h===t+1&&d+h===i+1;(u||f)&&h>=o+s?(u&&!f&&(h-=o),f&&!u&&(c+=o,d+=o,h-=o),a.push(new sm(c,d,h,0,0))):h>=o*2+s&&(c+=o,d+=o,h-=o*2,a.push(new sm(c,d,h,0,0)))}return a}get originalUnchangedRange(){return Ye.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Ye.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Ze(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Ze(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=oe(this,l=>this.visibleLineCountTop.read(l)+this.visibleLineCountBottom.read(l)===this.lineCount&&!this.isDragged.read(l)),this.isDragged=Ze(this,void 0);const r=Math.max(Math.min(s,this.lineCount),0),a=Math.max(Math.min(o,this.lineCount-s),0);Fte(s===r),Fte(o===a),this._visibleLineCountTop.set(r,void 0),this._visibleLineCountBottom.set(a,void 0)}setVisibleRanges(e,t){const i=[],s=new Hl(e.map(l=>l.modified)).subtractFrom(this.modifiedUnchangedRange);let o=this.originalLineNumber,r=this.modifiedLineNumber;const a=this.modifiedLineNumber+this.lineCount;if(s.ranges.length===0)this.showAll(t),i.push(this);else{let l=0;for(const c of s.ranges){const d=l===s.ranges.length-1;l++;const h=(d?a:c.endLineNumberExclusive)-r,u=new sm(o,r,h,0,0);u.setHiddenModifiedRange(c,t),i.push(u),o=u.originalUnchangedRange.endLineNumberExclusive,r=u.modifiedUnchangedRange.endLineNumberExclusive}}return i}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Ye.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Ye.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t,i){const s=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),o=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;t===0&&s{a.preventDefault();const l=e.ownerDocument.getSelection();if(!l||l.rangeCount===0)return;const c=l.getRangeAt(0);if(!c||c.collapsed)return;const d=c.startContainer.nodeType===Node.TEXT_NODE?c.startContainer.parentElement:c.startContainer,h=c.endContainer.nodeType===Node.TEXT_NODE?c.endContainer.parentElement:c.endContainer;if(!d||!h)return;const u=t.getModelPositionAt(d,c.startOffset),f=t.getModelPositionAt(h,c.endOffset);if(!u||!f)return;const g=u.delta(i.original.startLineNumber-1),p=f.delta(i.original.startLineNumber-1),m=p.isBefore(g)?D.fromPositions(p,g):D.fromPositions(g,p),b=s.getValueInRange(m);o.writeText(b)})),r}class CXe extends G{get visibility(){return this._visibility}set visibility(e){this._visibility!==e&&(this._visibility=e,this._diffActions.style.visibility=e?"visible":"hidden")}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._getViewZoneId=e,this._marginDomNode=t,this._deletedCodeDomNode=i,this._modifiedEditor=s,this._diff=o,this._editor=r,this._renderLinesResult=a,this._originalTextModel=l,this._contextMenuService=c,this._clipboardService=d,this._visibility=!1,this._marginDomNode.style.zIndex="10",this._diffActions=document.createElement("div"),this._diffActions.className=$e.asClassName(de.lightBulb)+" lightbulb-glyph",this._diffActions.style.position="absolute";const h=this._modifiedEditor.getOption(75);this._diffActions.style.right="0px",this._diffActions.style.visibility="hidden",this._diffActions.style.height=`${h}px`,this._diffActions.style.lineHeight=`${h}px`,this._marginDomNode.appendChild(this._diffActions);let u=0;const f=s.getOption(144)&&!Jl,g=(p,m,b)=>{this._contextMenuService.showContextMenu({domForShadowRoot:f?s.getDomNode()??void 0:void 0,getAnchor:()=>p,onHide:b,getActions:()=>{const v=[],w=o.modified.isEmpty;return v.push(new ol("diff.clipboard.copyDeletedContent",w?o.original.length>1?_(112,"Copy deleted lines"):_(113,"Copy deleted line"):o.original.length>1?_(114,"Copy changed lines"):_(115,"Copy changed line"),void 0,!0,async()=>{const S=this._originalTextModel.getValueInRange(o.original.toExclusiveRange());await this._clipboardService.writeText(S)})),o.original.length>1&&v.push(new ol("diff.clipboard.copyDeletedLineContent",w?_(116,"Copy deleted line ({0})",o.original.startLineNumber+u):_(117,"Copy changed line ({0})",o.original.startLineNumber+u),void 0,!0,async()=>{let S=this._originalTextModel.getLineContent(o.original.startLineNumber+u);S===""&&(S=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),await this._clipboardService.writeText(S)})),s.getOption(104)||v.push(new ol("diff.inline.revertChange",_(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(xn(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:b}=dn(this._diffActions),v=Math.floor(h/3);p.preventDefault(),g({x:p.posx,y:m+b+v})})),this._register(s.onMouseMove(p=>{(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,h),this.visibility=!0):this.visibility=!1})),this._register(yXe({domNode:this._deletedCodeDomNode,diffEntry:o,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:d}))}_updateLightBulbPosition(e,t,i){const{top:s}=dn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._renderLinesResult.viewLineCounts){let l=0;for(let c=0;cn});function MD(n,e,t,i,s=!1){Ms(i,e.fontInfo);const o=t.length>0,r=new w_(1e4);let a=0,l=0;const c=[],d=[];for(let g=0;gnull),i=!0,s=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=s}}class hg{static fromEditor(e){var o;const t=e.getOptions(),i=t.get(59),s=t.get(165);return new hg(((o=e.getModel())==null?void 0:o.getOptions().tabSize)||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),s.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=s,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=f}withSetWidth(e){return new hg(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new hg(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class xXe{constructor(e,t,i,s,o){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=s,this._source=o}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;const s=i.parentElement;if(!s)return;const o=s.querySelectorAll(".view-line");let r=-1;for(let h=0;h=this._renderOutputs.length)return;let a=1,l=r;for(let h=0;hthis._source.lineTokens.length)return;const c=this._renderOutputs[r];if(!c)return;const d=vS(c.characterMapping,e,t)+c.offset;return new U(a,d)}}class Bre extends NA{constructor(e,t,i){super(e,t),this.offset=i}}function Wre(n,e,t,i,s,o,r,a,l){a.appendString('

'):a.appendString('px;">');const c=e.getLineContent(),d=hl.isBasicASCII(c,s),h=hl.containsRTL(c,d,o),u=tx(new Vg(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Cg.OFF,null,null,r.verticalScrollbarSize),a);a.appendString("
");const f=u.characterMapping.getHorizontalOffset(u.characterMapping.length);return{output:u,maxCharWidth:f}}var LXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hre=function(n,e){return function(t,i){e(t,i,n)}};let Uj=class extends G{constructor(e,t,i,s,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Ze(this,0),this._originalScrollOffset=Ze(this,0),this._originalScrollOffsetAnimated=Nre(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Ze(this,0),this._modifiedScrollOffset=Ze(this,0),this._modifiedScrollOffsetAnimated=Nre(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Ze("invalidateAlignmentsState",0),u=this._register(new ai(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()}));const f=this._diffModel.map(w=>w?Ut(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,C)=>w==null?void 0:w.read(C)),g=oe(w=>{const C=this._diffModel.read(w),S=C==null?void 0:C.diff.read(w);if(!C||!S)return null;h.read(w);const x=this._options.renderSideBySide.read(w);return Vre(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,x)}),p=oe(w=>{var L;const C=(L=this._diffModel.read(w))==null?void 0:L.movedTextToCompare.read(w);if(!C)return null;h.read(w);const S=C.changes.map(x=>new h1e(x));return Vre(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const w=document.createElement("div");return w.className="diagonal-fill",w}const b=this._register(new ne);this.viewZones=oe(this,w=>{var j,Q,Y,te;b.clear();const C=g.read(w)||[],S=[],L=[],x=this._modifiedTopPadding.read(w);x>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:x,showInHiddenAreas:!0,suppressMouseDown:!0});const E=this._originalTopPadding.read(w);E>0&&S.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:E,showInHiddenAreas:!0,suppressMouseDown:!0});const I=this._options.renderSideBySide.read(w),R=I||(j=this._editors.modified._getViewModel())==null?void 0:j.createLineBreaksComputer();if(R){const ce=this._editors.original.getModel();for(const Ce of C)if(Ce.diff)for(let xe=Ce.originalRange.startLineNumber;xece.getLineCount())return{orig:S,mod:L};R==null||R.addRequest(ce.getLineContent(xe),null,null)}}const M=(R==null?void 0:R.finalize())??[];let A=0;const W=this._editors.modified.getOption(75),P=(Q=this._diffModel.read(w))==null?void 0:Q.movedTextToCompare.read(w),B=((Y=this._editors.original.getModel())==null?void 0:Y.mightContainNonBasicASCII())??!1,V=((te=this._editors.original.getModel())==null?void 0:te.mightContainRTL())??!1,K=hg.fromEditor(this._editors.modified);for(const ce of C)if(ce.diff&&!I&&(!this._options.useTrueInlineDiffRendering.read(w)||!dX(ce.diff))){if(!ce.originalRange.isEmpty){f.read(w);const xe=document.createElement("div");xe.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const je=this._editors.original.getModel();if(ce.originalRange.endLineNumberExclusive-1>je.getLineCount())return{orig:S,mod:L};const ke=new AD(ce.originalRange.mapToLineArray(Be=>je.tokenization.getLineTokens(Be)),ce.originalRange.mapToLineArray(Be=>M[A++]),B,V),Le=[];for(const Be of ce.diff.innerChanges||[])Le.push(new Ov(Be.originalRange.delta(-(ce.diff.original.startLineNumber-1)),Hj.className,0));const Ve=MD(ke,K,Le,xe),ct=document.createElement("div");if(ct.className="inline-deleted-margin-view-zone",Ms(ct,K.fontInfo),this._options.renderIndicators.read(w))for(let Be=0;BeKp(dt),ct,xe,this._editors.modified,ce.diff,this._diffEditorWidget,Ve,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Be=0;Be1&&S.push({afterLineNumber:ce.originalRange.startLineNumber+Be,domNode:m(),heightInPx:(tt-1)*W,showInHiddenAreas:!0,suppressMouseDown:!0})}L.push({afterLineNumber:ce.modifiedRange.startLineNumber-1,domNode:xe,heightInPx:Ve.heightInLines*W,minWidthInPx:Ve.minWidthInPx,marginDomNode:ct,setZoneId(Be){dt=Be},showInHiddenAreas:!0,suppressMouseDown:!1})}const Ce=document.createElement("div");Ce.className="gutter-delete",S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:ce.modifiedHeightInPx,marginDomNode:Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ce=ce.modifiedHeightInPx-ce.originalHeightInPx;if(Ce>0){if(P!=null&&P.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ce.originalRange.endLineNumberExclusive-1))continue;S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xe=function(){const ke=document.createElement("div");return ke.className="arrow-revert-change "+Ue.asClassName(de.arrowRight),w.store.add(J(ke,"mousedown",Le=>Le.stopPropagation())),w.store.add(J(ke,"click",Le=>{Le.stopPropagation(),o.revert(ce.diff)})),me("div",{},ke)};var z=xe;if(P!=null&&P.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ce.modifiedRange.endLineNumberExclusive-1))continue;let je;ce.diff&&ce.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(je=xe()),L.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ce,marginDomNode:je,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ce of p.read(w)??[]){if(!(P!=null&&P.lineRangeMapping.original.intersect(ce.originalRange))||!(P!=null&&P.lineRangeMapping.modified.intersect(ce.modifiedRange)))continue;const Ce=ce.modifiedHeightInPx-ce.originalHeightInPx;Ce>0?S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ce,showInHiddenAreas:!0,suppressMouseDown:!0}):L.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:S,mod:L}});let v=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.modified.setScrollLeft(w.scrollLeft),v=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.original.setScrollLeft(w.scrollLeft),v=!1)})),this._originalScrollTop=Ut(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ut(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(qe(w=>{const C=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(w));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,1)})),this._register(qe(w=>{const C=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(w));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,1)})),this._register(qe(w=>{var L;const C=(L=this._diffModel.read(w))==null?void 0:L.movedTextToCompare.read(w);let S=0;if(C){const x=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);S=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-x}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+S,void 0,!0)}))}};Uj=LXe([Hre(8,xa),Hre(9,gl)],Uj);function Vre(n,e,t,i,s,o){const r=new vg(zre(n,i)),a=new vg(zre(e,s)),l=n.getOption(75),c=e.getOption(75),d=[];let h=0,u=0;function f(p,m){for(;;){let b=r.peek(),v=a.peek();if(b&&b.lineNumber>=p&&(b=void 0),v&&v.lineNumber>=m&&(v=void 0),!b&&!v)break;const w=b?b.lineNumber-h:Number.MAX_VALUE,C=v?v.lineNumber-u:Number.MAX_VALUE;wC?(a.dequeue(),b={lineNumber:v.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ye.ofLength(b.lineNumber,1),modifiedRange:Ye.ofLength(v.lineNumber,1),originalHeightInPx:l+b.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const p of t){let C=function(S,L,x=!1){var A,W;if(SP.lineNumberP+B.heightInPx,0))??0,M=((W=a.takeWhile(P=>P.lineNumberP+B.heightInPx,0))??0;d.push({originalRange:E,modifiedRange:I,originalHeightInPx:E.length*l+R,modifiedHeightInPx:I.length*c+M,diff:p.lineRangeMapping}),w=S,v=L};var g=C;const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let b=!0,v=m.modified.startLineNumber,w=m.original.startLineNumber;if(o)for(const S of m.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&C(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=n.getModel(),x=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new U(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return YZe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function dX(n){return n.innerChanges?n.innerChanges.every(e=>GP(e.modifiedRange)&&GP(e.originalRange)||e.originalRange.equalsRange(new D(1,1,1,1))):!1}function GP(n){return n.startLineNumber===n.endLineNumber}const _E=class _E extends G{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Ut(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Ut(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=da("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ze(this,0),this._modifiedViewZonesChangedSignal=da("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=da("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=oe(this,d=>{var L;this._element.replaceChildren();const h=this._diffModel.read(d),u=(L=h==null?void 0:h.diff.read(d))==null?void 0:L.movedTexts;if(!u||u.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const f=this._originalEditorLayoutInfo.read(d),g=this._modifiedEditorLayoutInfo.read(d);if(!f||!g){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const p=u.map(x=>{function E(K,z){const j=z.getTopForLineNumber(K.startLineNumber,!0),Q=z.getTopForLineNumber(K.endLineNumberExclusive,!0);return(j+Q)/2}const I=E(x.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(d),M=E(x.lineRangeMapping.modified,this._editors.modified),A=this._modifiedScrollTop.read(d),W=I-R,P=M-A,B=Math.min(I,M),V=Math.max(I,M);return{range:new Me(B,V),from:W,to:P,fromWithoutScroll:I,toWithoutScroll:M,move:x}});p.sort(EMe(lo(x=>x.fromWithoutScroll>x.toWithoutScroll,tge),lo(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,pa)));const m=hX.compute(p.map(x=>x.range)),b=10,v=f.verticalScrollbarWidth,w=(m.getTrackCount()-1)*10+b*2,C=v+w+(g.contentLeft-_E.movedCodeBlockPadding);let S=0;for(const x of p){const E=m.getTrack(S),I=v+b+E*10,R=15,M=15,A=C,W=g.glyphMarginWidth+g.lineNumbersWidth,P=18,B=document.createElementNS("http://www.w3.org/2000/svg","rect");B.classList.add("arrow-rectangle"),B.setAttribute("x",`${A-W}`),B.setAttribute("y",`${x.to-P/2}`),B.setAttribute("width",`${W}`),B.setAttribute("height",`${P}`),this._element.appendChild(B);const V=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M 0 ${x.from} L ${I} ${x.from} L ${I} ${x.to} L ${A-M} ${x.to}`),K.setAttribute("fill","none"),V.appendChild(K);const z=document.createElementNS("http://www.w3.org/2000/svg","polygon");z.classList.add("arrow"),d.store.add(qe(j=>{K.classList.toggle("currentMove",x.move===h.activeMovedText.read(j)),z.classList.toggle("currentMove",x.move===h.activeMovedText.read(j))})),z.setAttribute("points",`${A-M},${x.to-R/2} ${A},${x.to} ${A-M},${x.to+R/2}`),V.appendChild(z),this._element.appendChild(V),S++}this.width.set(w,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Re(()=>this._element.remove())),this._register(qe(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-_E.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(dS(this._state));const r=oe(d=>{const h=this._diffModel.read(d),u=h==null?void 0:h.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new C0(Ci(f.lineRangeMapping.original.startLineNumber-1),18),modified:new C0(Ci(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(qP(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(qP(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(Eo((d,h)=>{const u=r.read(d);for(const f of u)h.add(new jre(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new jre(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=da("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=da("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(ZS({changeTracker:{createChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)}},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&c==="original"){const g=this._editors.originalCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(u&&c==="modified"){const g=this._editors.modifiedCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==h.movedTextToCompare.read(void 0)&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};_E.movedCodeBlockPadding=4;let yy=_E;class hX{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=m5e(t,lo(a=>a.intersectWithRangeLength(s),pa)):(o=t.length,t.push(new lY))),t[o].addRange(s),i.push(o)}return new hX(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class jre extends rX{constructor(e,t,i,s,o){const r=Pt("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=Pt("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Pt("div.text-content@textContent"),Pt("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Ut(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(d_(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?_(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?_(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new Vr(this._nodes.actionBar,{highlightToggledItems:!0})),d=new ol("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new ol("","Compare",Ue.asClassName(de.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(qe(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),c.push(h,{icon:!1,label:!0})}}class kXe extends G{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=oe(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),h=[],u=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Mre:Pre}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?Rre:Are}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:pXe}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:fXe});else{const p=this._options.useTrueInlineDiffRendering.read(o)&&dX(g.lineRangeMapping);for(const m of g.lineRangeMapping.innerChanges||[])if(g.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&h.push({range:m.originalRange,options:m.originalRange.isEmpty()&&d?mXe:Hj}),g.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&u.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&d&&!p?gXe:Ore}),p){const b=r.model.original.getValueInRange(m.originalRange);u.push({range:m.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&h.push({range:p,options:c?Mre:Pre});const m=g.modified.toInclusiveRange();m&&u.push({range:m,options:c?Rre:Are});for(const b of g.innerChanges||[])h.push({range:b.originalRange,options:Hj}),u.push({range:b.modifiedRange,options:Ore})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[yy.movedCodeBlockPadding,0,yy.movedCodeBlockPadding,yy.movedCodeBlockPadding]}}),u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(UP(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(UP(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class bs{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new bs(this.x+e.x,this.y+e.y)}deltaX(e){return new bs(this.x+e,this.y)}deltaY(e){return new bs(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new bs(this.x-e.x,this.y-e.y)}scale(e){return new bs(this.x*e,this.y*e)}mapComponents(e){return new bs(e(this.x),e(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function Ui(n){return qj.get(n)}const Ip=class Ip extends G{static get(e){let t=Ip._map.get(e);if(!t){t=new Ip(e),Ip._map.set(e,t);const i=e.onDidDispose(()=>{const s=Ip._map.get(e);s&&(Ip._map.delete(e),s.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new XS(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){var t;super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Ze(this,this.editor.getModel()),this.model=this._model,this.isReadonly=Ut(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=Lk({owner:this,lazy:!0},((t=this.editor.getModel())==null?void 0:t.getVersionId())??null),this.versionId=this._versionId,this._selections=Lk({owner:this,equalsFn:rv(lI(Ie.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=no({owner:this,equalsFn:rv(lI(U.equals))},i=>{var s;return((s=this.selections.read(i))==null?void 0:s.map(o=>o.getStartPosition()))??null}),this.isFocused=Ut(this,i=>{const s=this.editor.onDidFocusEditorWidget(i),o=this.editor.onDidBlurEditorWidget(i);return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=Ut(this,i=>{const s=this.editor.onDidFocusEditorText(i),o=this.editor.onDidBlurEditorText(i);return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=Ut(this,i=>{const s=this.editor.onDidCompositionStart(()=>{i(void 0)}),o=this.editor.onDidCompositionEnd(()=>{i(void 0)});return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.inComposition),this.value=YG(this,i=>{var s;return this.versionId.read(i),((s=this.model.read(i))==null?void 0:s.getValue())??""},(i,s)=>{const o=this.model.get();o!==null&&i!==o.getValue()&&o.setValue(i)}),this.valueIsEmpty=oe(this,i=>{var s;return this.versionId.read(i),((s=this.editor.getModel())==null?void 0:s.getValueLength())===0}),this.cursorSelection=no({owner:this,equalsFn:rv(Ie.selectionsEqual)},i=>{var s;return((s=this.selections.read(i))==null?void 0:s[0])??null}),this.cursorPosition=no({owner:this,equalsFn:U.equals},i=>{var s,o;return((o=(s=this.selections.read(i))==null?void 0:s[0])==null?void 0:o.getPosition())??null}),this.cursorLineNumber=oe(this,i=>{var s;return((s=this.cursorPosition.read(i))==null?void 0:s.lineNumber)??null}),this.onDidType=Ul(this),this.onDidPaste=Ul(this),this.scrollTop=Ut(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=Ut(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=Ut(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(i=>i.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(i=>i.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(i=>i.width),this.layoutInfoHeight=this.layoutInfo.map(i=>i.height),this.layoutInfoMinimap=this.layoutInfo.map(i=>i.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(i=>i.verticalScrollbarWidth),this.contentWidth=Ut(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=Ut(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Ze(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(i=>{var s;this._beginUpdate();try{this._versionId.set(((s=this.editor.getModel())==null?void 0:s.getVersionId())??null,this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(i=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=oe(i=>(this.model.read(i),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var e;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(((e=this.editor.getModel())==null?void 0:e.getVersionId())??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=ls.ofCaller()){return Ut(this,i=>this.editor.onDidChangeConfiguration(s=>{s.hasChanged(e)&&i(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new ne,i=this.editor.createDecorationsCollection();return t.add(B5({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const s=qe(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return Re(()=>{s.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const s=qe(o=>{e.position.read(o),this.editor.layoutContentWidget(i)});return Re(()=>{s.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){const i=this.observePosition(e.map(o=>new U(o.startLineNumber,1)),t),s=this.observePosition(e.map(o=>new U(o.endLineNumberExclusive+1,1)),t);return oe(o=>{var d;i.read(o),s.read(o);const r=e.read(o),a=(d=this.model.read(o))==null?void 0:d.getLineCount(),l=(typeof a<"u"&&r.startLineNumber>a?this.editor.getBottomForLineNumber(a):this.editor.getTopForLineNumber(r.startLineNumber))-this.scrollTop.read(o),c=r.isEmpty?l:this.editor.getBottomForLineNumber(r.endLineNumberExclusive-1)-this.scrollTop.read(o);return new Me(l,c)})}observePosition(e,t){let i=e.get();const s=Lk({owner:this,debugName:()=>`topLeftOfPosition${i==null?void 0:i.toString()}`,equalsFn:rv(bs.equals)},new bs(0,0)),o="observablePositionWidget"+this._widgetCounter++,r=document.createElement("div"),a={getDomNode:()=>r,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>o,allowEditorOverflow:!1,afterRender:(l,c)=>{const d=this._model.get();d&&i&&i.lineNumber>d.getLineCount()?s.set(new bs(0,this.editor.getBottomForLineNumber(d.getLineCount())-this.scrollTop.get()),void 0):s.set(c?new bs(c.left,c.top):null,void 0)}};return this.editor.addContentWidget(a),t.add(qe(l=>{i=e.read(l),this.editor.layoutContentWidget(a)})),t.add(Re(()=>{this.editor.removeContentWidget(a)})),s}isTargetHovered(e,t){const i=Ze("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(s=>{const o=e(s);i.set(o,void 0)})),t.add(this.editor.onMouseLeave(s=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return oe(t=>{const i=e instanceof U?e:e.read(t);return i===null?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return typeof e=="number"?this.observeLineHeightForPosition(new U(e,1)):oe(t=>{const i=e.read(t);return i===null?null:this.observeLineHeightForPosition(new U(i,1)).read(t)})}observeLineHeightsForLineRange(e){return oe(t=>{const i=e instanceof Ye?e:e.read(t),s=[];for(let o=i.startLineNumber;o=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},IXe=function(n,e){return function(t,i){e(t,i,n)}},ud,Qf;let aN=(Qf=class extends G{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=ud.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=Ut(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=oe(u=>{const f=l.read(u),g=f.getColor(S8e)||(f.getColor(dv)||YH).transparent(2),p=f.getColor(x8e)||(f.getColor(Jp)||ZH).transparent(2);return{insertColor:g,removeColor:p}}),d=qt(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Pt("div.diffOverview",{style:{position:"absolute",top:"0px",width:ud.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(w0(h,d.domNode)),this._register(xn(h,_e.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(J(h,_e.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(w0(this._rootElement,h)),this._register(Eo((u,f)=>{const g=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(w0(h,p.getDomNode())));const m=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(m&&(f.add(m),f.add(w0(h,m.getDomNode()))),!p||!m)return;const b=da("viewZoneChanged",this._editors.original.onDidChangeViewZones),v=da("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=da("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=da("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(qe(S=>{var M;b.read(S),v.read(S),w.read(S),C.read(S);const L=c.read(S),x=(M=g==null?void 0:g.diff.read(S))==null?void 0:M.mappings;function E(A,W,P){const B=P._getViewModel();return B?A.filter(V=>V.length>0).map(V=>{const K=B.coordinatesConverter.convertModelPositionToViewPosition(new U(V.startLineNumber,1)),z=B.coordinatesConverter.convertModelPositionToViewPosition(new U(V.endLineNumberExclusive,1)),j=z.lineNumber-K.lineNumber;return new a_e(K.lineNumber,z.lineNumber,j,W.toString())}):[]}const I=E((x||[]).map(A=>A.lineRangeMapping.original),L.removeColor,this._editors.original),R=E((x||[]).map(A=>A.lineRangeMapping.modified),L.insertColor,this._editors.modified);p==null||p.setZones(I),m==null||m.setZones(R)})),f.add(qe(S=>{const L=this._rootHeight.read(S),x=this._rootWidth.read(S),E=this._modifiedEditorLayoutInfo.read(S);if(E){const I=ud.ENTIRE_DIFF_OVERVIEW_WIDTH-2*ud.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:L,right:I+ud.ONE_OVERVIEW_WIDTH,width:ud.ONE_OVERVIEW_WIDTH}),m.setLayout({top:0,height:L,right:0,width:ud.ONE_OVERVIEW_WIDTH});const R=this._editors.modifiedScrollTop.read(S),M=this._editors.modifiedScrollHeight.read(S),A=this._editors.modified.getOption(117),W=new yS(A.verticalHasArrows?A.arrowSize:0,A.verticalScrollbarSize,0,E.height,M,R);d.setTop(W.getSliderPosition()),d.setHeight(W.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=x-ud.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(ud.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},ud=Qf,Qf.ONE_OVERVIEW_WIDTH=15,Qf.ENTIRE_DIFF_OVERVIEW_WIDTH=Qf.ONE_OVERVIEW_WIDTH*2,Qf);aN=ud=EXe([IXe(6,en)],aN);var NXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W9=function(n,e){return function(t,i){e(t,i,n)}};let Kj=class extends G{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,o,r,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=o,this._contextKeyService=r,this._instantiationService=a,this._keybindingService=l,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new q),this.modifiedScrollTop=Ut(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=Ut(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=Ui(this.modified),this.originalObs=Ui(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=Ut(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=no({owner:this,equalsFn:U.equals},c=>{var d;return((d=this.modifiedSelections.read(c)[0])==null?void 0:d.getPosition())??new U(1,1)}),this.originalCursor=Ut(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new U(1,1)),this.isOriginalFocused=Ui(this.original).isFocused,this.isModifiedFocused=Ui(this.modified).isFocused,this.isFocused=oe(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(ZS({changeTracker:{createChangeSummary:()=>({}),handleChange:(c,d)=>(c.didChange(i.editorOptions)&&Object.assign(d,c.change.changedOptions),!0)}},(c,d)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,d))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffLeftEditor",s.hasWidgetFocus());return this._register(s.onDidFocusEditorWidget(()=>o.set(!0))),this._register(s.onDidBlurEditorWidget(()=>o.set(!1))),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffRightEditor",s.hasWidgetFocus());return this._register(s.onDidFocusEditorWidget(()=>o.set(!0))),this._register(s.onDidBlurEditorWidget(()=>o.set(!1))),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+aN.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=zo.revealHorizontalRightPadding.defaultValue+aN.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var i;e||(e="");const t=_(111," use {0} to open the accessibility help.",(i=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:i.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};Kj=NXe([W9(5,Xe),W9(6,Ae),W9(7,Ht)],Kj);class DXe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=YG(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,s)}),this._sashRatio=Ze(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class u1e extends G{constructor(e,t,i,s,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new bo(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(qe(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(qe(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}const oF=class oF extends G{constructor(){super(...arguments),this._id=++oF.idCounter,this._onDidDispose=this._register(new q),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};oF.idCounter=0;let Gj=oF;function TXe(n,e){return Hg(n,(t,i)=>i??e(t))}var RXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},MXe=function(n,e){return function(t,i){e(t,i,n)}};let Yj=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Ze(this,0),this._screenReaderMode=Ut(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=oe(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=oe(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=oe(this,s=>this.compactMode.read(s)&&this.shouldRenderInlineViewInSmartMode.read(s)?!1:this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=oe(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=oe(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=oe(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=oe(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=oe(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=oe(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=oe(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=oe(this,s=>this._options.read(s).maxComputationTime),this.showMoves=oe(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=oe(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=oe(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=oe(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=oe(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=oe(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=oe(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=oe(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=oe(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.compactMode=oe(this,s=>this._options.read(s).compactMode),this.trueInlineDiffRenderingEnabled=oe(this,s=>this._options.read(s).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=oe(this,s=>!this.renderSideBySide.read(s)&&this.trueInlineDiffRenderingEnabled.read(s)),this.hideUnchangedRegions=oe(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount),this._model=Ze(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,s=>TXe(this,o=>{const r=s==null?void 0:s.diff.read(o);return r?AXe(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,s=>!!s),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...$re(e,Ys)};this._options=Ze(this,i)}updateOptions(e){const t=$re(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};Yj=RXe([MXe(1,Us)],Yj);function AXe(n,e){return n.mappings.every(t=>PXe(t.lineRangeMapping)||OXe(t.lineRangeMapping)||e&&dX(t.lineRangeMapping))}function PXe(n){return n.original.length===0}function OXe(n){return n.modified.length===0}function $re(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:Fe(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:uAe(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Fe(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Fe(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:xf(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:xf(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Fe(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Fe(n.renderIndicators,e.renderIndicators),originalEditable:Fe(n.originalEditable,e.originalEditable),diffCodeLens:Fe(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Fe(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Di(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Di(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Fe(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Fe((t=n.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Fe((i=n.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Fe((s=n.experimental)==null?void 0:s.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Fe(((o=n.hideUnchangedRegions)==null?void 0:o.enabled)??((r=n.experimental)==null?void 0:r.collapseUnchangedRegions),e.hideUnchangedRegions.enabled),contextLineCount:xf((a=n.hideUnchangedRegions)==null?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:xf((l=n.hideUnchangedRegions)==null?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:xf((c=n.hideUnchangedRegions)==null?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Fe(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Fe(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:xf(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Fe(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Fe(n.renderGutterMenu,e.renderGutterMenu),compactMode:Fe(n.compactMode,e.compactMode)}}const Ure=24;class FXe extends G{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new sAe),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new ne),i.hoverDelegate=i.hoverDelegate??this._register(Xbe()),this.options=i,this.toggleMenuAction=this._register(new lN(()=>{var s;return(s=this.toggleMenuActionViewItem)==null?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Vr(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,o)=>{if(s.id===lN.ID)return this.toggleMenuActionViewItem=new wP(s,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Ue.asClassNameArray(i.moreIcon??de.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(s,o);if(r)return r}if(s instanceof hS){const r=new wP(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}})),this.options.responsive){this.element.classList.add("responsive");const s=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});s.observe(this.element),this._store.add(Re(()=>s.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){var t;this.actionBar.context=e,(t=this.toggleMenuActionViewItem)==null||t.setActionContext(e);for(const i of this.submenuActionViewItems)i.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>0&&this.options.trailingSeparator&&i.push(new Xn),i.forEach(s=>{this.actionBar.push(s,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(s)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){var i,s;const t=(s=(i=this.options).getKeyBinding)==null?void 0:s.call(i,e);return(t==null?void 0:t.getLabel())??void 0}getItemsWidthResponsive(){return this.actionBar.length()*Ure}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&this.hiddenActions.length===0)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){const i=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(i<0)break;const s=Math.min(Ure,this.getItemWidth(i)),o=this.originalPrimaryActions[i];this.hiddenActions.unshift({action:o,size:s}),this.actionBar.pull(i),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const i=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+i.size>e){this.hiddenActions.unshift(i);break}this.actionBar.push(i.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(i.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const t=this.hiddenActions.map(i=>i.action);if(this.originalSecondaryActions.length>0||t.length>0){const i=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=Xn.join(t,i)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const rF=class rF extends ol{constructor(e,t){t=t||_(17,"More Actions..."),super(rF.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};rF.ID="toolbar.toggle.more";let lN=rF;const f1e=mt("IActionViewItemService");class BXe{constructor(){this._providers=new Map,this._onDidChange=new q,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof Te?t.id:t}`}}xt(f1e,BXe,1);var g1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ua=function(n,e){return function(t,i){e(t,i,n)}};let YP=class extends FXe{constructor(e,t,i,s,o,r,a,l){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new ne);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var d,h,u;this._sessionDisposables.clear();const s=e.slice(),o=t.slice(),r=[];let a=0;const l=[];let c=!1;if(((d=this._options)==null?void 0:d.hiddenItemStrategy)!==-1)for(let f=0;fm==null?void 0:m.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let m=0;m=g&&(s[m]=void 0,l[m]=b))}}Bte(s),Bte(l),super.setActions(s,Xn.join(l,o)),(r.length>0||s.length>0)&&this._sessionDisposables.add(J(this.getElement(),"contextmenu",f=>{var v,w,C,S,L;const g=new ao(Oe(this.getElement()),f),p=this.getItemAction(g.target);if(!p)return;g.preventDefault(),g.stopPropagation();const m=[];if(p instanceof rl&&p.menuKeybinding)m.push(p.menuKeybinding);else if(!(p instanceof Nv||p instanceof lN)){const x=!!this._keybindingService.lookupKeybinding(p.id);m.push(n1e(this._commandService,this._keybindingService,p.id,void 0,x))}if(r.length>0){let x=!1;if(a===1&&((v=this._options)==null?void 0:v.hiddenItemStrategy)===0){x=!0;for(let E=0;Ethis._menuService.resetHiddenStates(i)}))),b.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>g,getActions:()=>b,menuId:(C=this._options)==null?void 0:C.contextMenu,menuActionOptions:{renderShortTitle:!0,...(S=this._options)==null?void 0:S.menuOptions},skipTelemetry:typeof((L=this._options)==null?void 0:L.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};YP=g1e([Ua(2,uc),Ua(3,Xe),Ua(4,gl),Ua(5,Ht),Ua(6,Ei),Ua(7,Ro)],YP);let cN=class extends YP{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,s,o,r,a,l,c,d,h){super(e,{resetMenu:t,...i,actionViewItemProvider:(g,p)=>{let m=d.lookUp(t,g instanceof Nv?g.item.submenu.id:g.id);m||(m=i==null?void 0:i.actionViewItemProvider);const b=m==null?void 0:m(g,p,h,Oe(e).vscodeWindowId);return b||AZ(h,g,p)}},s,o,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new q);const u=this._store.add(s.createMenu(t,o,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i==null?void 0:i.eventDebounceDelay})),f=()=>{var m,b,v;const{primary:g,secondary:p}=lve(u.getActions(i==null?void 0:i.menuOptions),(m=i==null?void 0:i.toolbarOptions)==null?void 0:m.primaryGroup,(b=i==null?void 0:i.toolbarOptions)==null?void 0:b.shouldInlineSubmenu,(v=i==null?void 0:i.toolbarOptions)==null?void 0:v.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(u.onDidChange(()=>{f(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(g=>{g===t&&f()})),f()}setActions(){throw new ze("This toolbar is populated from a menu.")}};cN=g1e([Ua(3,uc),Ua(4,Xe),Ua(5,gl),Ua(6,Ht),Ua(7,Ei),Ua(8,Ro),Ua(9,f1e),Ua(10,Ae)],cN);class mw extends dY{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new rs(e-1,t)}}class p1e extends iw{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class WXe extends G{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=Ut(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=Ut(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=da("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=da("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Ul("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(Pt("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{wi(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Re(()=>o.disconnect())),this._register(qe(r=>{s.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(qe(r=>this.render(r)))}dispose(){super.dispose(),ys(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),o=Me.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new Ye(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);wi(c=>{for(const d of l){if(!d.range.intersect(a))continue;s.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const m=Ze("item",d),b=this.itemProvider.createView(m,p);h=new HXe(m,b,p),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:d.range.startLineNumber>1?this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t:0,g=(d.range.endLineNumberExclusive===1?Math.max(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${g}px`,h.gutterItemView.layout(Me.ofStartAndLength(u,g),o)}})}for(const r of s){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class HXe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var m1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},XR=function(n,e){return function(t,i){e(t,i,n)}};const H9=[],L2=35;let Zj=class extends G{constructor(e,t,i,s,o,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(Te.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=Ut(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(h=>h.length>0),this._showSash=oe(this,h=>this._options.renderSideBySide.read(h)&&this._hasActions.read(h)),this.width=oe(this,h=>this._hasActions.read(h)?L2:0),this.elements=Pt("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:L2+"px"}},[]),this._currentDiff=oe(this,h=>{var p;const u=this._diffModel.read(h);if(!u)return;const f=(p=u.diff.read(h))==null?void 0:p.mappings,g=this._editors.modifiedCursor.read(h);if(g)return f==null?void 0:f.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=oe(this,h=>{const u=this._diffModel.read(h),f=u==null?void 0:u.diff.read(h);if(!f)return H9;const g=this._editors.modifiedSelections.read(h);if(g.every(v=>v.isEmpty()))return H9;const p=new $l(g.map(v=>Ye.fromRangeInclusive(v))),b=f.mappings.filter(v=>v.lineRangeMapping.innerChanges&&p.intersects(v.lineRangeMapping.modified)).map(v=>({mapping:v,rangeMappings:v.lineRangeMapping.innerChanges.filter(w=>g.some(C=>D.areIntersecting(w.modifiedRange,C)))}));return b.length===0||b.every(v=>v.rangeMappings.length===0)?H9:b}),this._register(ZZe(e,this.elements.root)),this._register(J(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(d_(this.elements.root,{display:this._hasActions.map(h=>h?"block":"none")})),Ml(this,h=>this._showSash.read(h)?new u1e(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,YG(this,f=>this._sashLayout.sashLeft.read(f)-L2,(f,g)=>this._sashLayout.sashLeft.set(f+L2,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const d=oe(this,h=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const g=this._selectedDiffs.read(h);if(g.length>0){const m=cl.fromRangeMappings(g.flatMap(b=>b.rangeMappings));return[new qre(m,!0,Te.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return f.mappings.map(m=>new qre(m.lineRangeMapping.withInnerChangesFromLineRanges(),m.lineRangeMapping===(p==null?void 0:p.lineRangeMapping),Te.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))});this._register(new WXe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(h,u)=>d.read(u),createView:(h,u)=>this._instantiationService.createInstance(Xj,h,u,this)})),this._register(J(this.elements.gutter,_e.MOUSE_WHEEL,h=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new mw(this._editors.modifiedModel.get()),s=new mw(this._editors.original.getModel());return new fa(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};Zj=m1e([XR(6,Ae),XR(7,Xe),XR(8,uc)],Zj);class qre{constructor(e,t,i,s,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let Xj=class extends G{constructor(e,t,i,s){super(),this._item=e,this._elements=Pt("div.gutterItem",{style:{height:"20px",width:"34px"}},[Pt("div.background@background",{},[]),Pt("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Ze(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(s.createInstance(SS,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(w0(t,this._elements.root)),this._register(qe(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(Eo((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(s.createInstance(cN,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:a.add(new p1e(()=>{const c=this._item.read(void 0),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,o=i;let r=e.start+s;const a=Me.tryCreate(o,t.endExclusive-o-i),l=Me.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zXe=function(n,e){return function(t,i){e(t,i,n)}},Qj,Mm;let ZP=(Mm=class extends G{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=s,this._modifiedOutlineSource=Ml(this,l=>{const c=this._editors.modifiedModel.read(l),d=Qj._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();wi(d=>{for(const h of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();wi(d=>{for(const h of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const o=this._diffModel.map((l,c)=>{var h;const d=(l==null?void 0:l.unchangedRegions.read(c))??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===((h=this._editors.modifiedModel.read(c))==null?void 0:h.getLineCount())?[]:d});this.viewZones=oe(this,l=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const d=[],h=[],u=this._options.renderSideBySide.read(l),f=this._options.compactMode.read(l),g=o.read(l);for(let p=0;pm.getHiddenOriginalRange(w).startLineNumber-1),v=new C0(b,12);d.push(v),l.store.add(new Kre(this._editors.original,v,m,!u))}{const b=oe(this,w=>m.getHiddenModifiedRange(w).startLineNumber-1),v=new C0(b,12);h.push(v),l.store.add(new Kre(this._editors.modified,v,m))}}else{{const b=oe(this,w=>m.getHiddenOriginalRange(w).startLineNumber-1),v=new C0(b,24);d.push(v),l.store.add(new Gre(this._editors.original,v,m,m.originalUnchangedRange,!u,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{const b=oe(this,w=>m.getHiddenModifiedRange(w).startLineNumber-1),v=new C0(b,24);h.push(v),l.store.add(new Gre(this._editors.modified,v,m,m.modifiedUnchangedRange,!1,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new yo(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(_(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Ue.asClassName(de.fold),zIndex:10001};this._register(UP(this._editors.original,oe(this,l=>{const c=o.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:D.fromPositions(new U(h.originalLineNumber,1)),options:a});return d}))),this._register(UP(this._editors.modified,oe(this,l=>{const c=o.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:Ye.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(qe(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Ts)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Ts))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.contains(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(f=>f.originalUnchangedRange.contains(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},Qj=Mm,Mm._breadcrumbsSourceFactory=Ze(Mm,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),Mm);ZP=Qj=VXe([zXe(3,Ae)],ZP);class Kre extends rX{constructor(e,t,i,s=!1){const o=Pt("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=s,this._nodes=Pt("div.diff-hidden-lines-compact",[Pt("div.line-left",[]),Pt("div.text@text",[]),Pt("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(qe(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=_(125,"{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class Gre extends rX{constructor(e,t,i,s,o,r,a,l){const c=Pt("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Pt("div.diff-hidden-lines",[Pt("div.top@top",{title:_(126,"Click or drag to show more above")}),Pt("div.center@content",{style:{display:"flex"}},[Pt("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[me("a",{title:_(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...Lm("$(unfold)"))]),Pt("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Pt("div.bottom@bottom",{title:_(128,"Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?ys(this._nodes.first):this._register(d_(this._nodes.first,{width:Ui(this._editor).layoutInfoContentLeft})),this._register(qe(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),g=this._editor.getDomNode();g&&(g.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(g.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),g.classList.toggle("canMoveBottom",!u)):f==="bottom"?(g.classList.toggle("canMoveTop",!u),g.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(g.classList.toggle("canMoveTop",!1),g.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(J(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=Oe(this._nodes.top),m=J(p,"mousemove",v=>{const C=v.clientY-u;f=f||Math.abs(C)>2;const S=Math.round(C/d.getOption(75)),L=Math.max(0,Math.min(g+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=J(p,"mouseup",v=>{f||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),m.dispose(),b.dispose()})})),this._register(J(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=Oe(this._nodes.bottom),m=J(p,"mousemove",v=>{const C=v.clientY-u;f=f||Math.abs(C)>2;const S=Math.round(C/d.getOption(75)),L=Math.max(0,Math.min(g-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const E=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(E-x))}),b=J(p,"mouseup",v=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),m.dispose(),b.dispose()})})),this._register(qe(h=>{const u=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,g=_(129,"{0} hidden lines",f),p=me("span",{title:_(130,"Double click to unfold")},g);p.addEventListener("dblclick",v=>{v.button===0&&(v.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const m=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(b.length>0){u.push(me("span",void 0,"  |  "));for(let v=0;v{this._revealModifiedHiddenLine(w.startLineNumber)}}}}ys(this._nodes.others,...u)}))}}const V9=[];class jXe extends G{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=oe(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return V9;const l=this._editors.modifiedSelections.read(o);if(l.every(u=>u.isEmpty()))return V9;const c=new $l(l.map(u=>Ye.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>l.some(g=>D.areIntersecting(f.modifiedRange,g)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?V9:h}),this._register(Eo((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new XP(u[u.length-1].positionLineNumber,this._widget,d.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new XP(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}r.add(Re(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const aF=class aF extends G{getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${aF.counter++}`,this._domNode=Pt("div.revertButton",{title:this._revertSelection?_(135,"Revert Selected Changes"):_(136,"Revert Change")},[eh(de.arrowRight)]).root,this._register(J(this._domNode,_e.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(J(this._domNode,_e.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(J(this._domNode,_e.CLICK,o=>{this._diffs instanceof $o?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Zd.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};aF.counter=0;let XP=aF;var $Xe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cL=function(n,e){return function(t,i){e(t,i,n)}};let Eu=class extends Gj{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,s,o,r,a,l){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._codeEditorService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Pt("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Pt("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Pt("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Pt("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(QG(this,void 0)),this._diffModel=oe(this,C=>{var S;return(S=this._diffModelSrc.read(C))==null?void 0:S.object}),this.onDidChangeModel=ve.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new cx([Xe,this._contextKeyService]))),this._boundarySashes=Ze(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ze(this,!1),this._accessibleDiffViewerVisible=oe(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=Ze(this,void 0),this._layoutInfo=oe(this,C=>{var K,z;const S=this._rootSizeObserver.width.read(C),L=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const x=this._sash.read(C),E=this._gutter.read(C),I=(E==null?void 0:E.width.read(C))??0,R=((K=this._overviewRulerPart.read(C))==null?void 0:K.width)??0;let M,A,W,P,B;if(!!x){const j=x.sashLeft.read(C),Q=((z=this._movedBlocksLinesPart.read(C))==null?void 0:z.width.read(C))??0;M=0,A=j-I-Q,B=j-I,W=j,P=S-W-R}else{B=0;const j=this._options.inlineViewHideOriginalLineNumbers.read(C);M=I,j?A=0:A=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),W=I+A,P=S-W-R}return this.elements.original.style.left=M+"px",this.elements.original.style.width=A+"px",this._editors.original.layout({width:A,height:L},!0),E==null||E.layout(B),this.elements.modified.style.left=W+"px",this.elements.modified.style.width=P+"px",this._editors.modified.layout({width:P,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,S)=>C==null?void 0:C.diff.read(S)),this.onDidUpdateDiff=ve.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Re(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new r1e(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(Yj,t),this._register(qe(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(H.isEmbeddedDiffEditor.key,!1),this._register(Nh(H.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Nh(H.comparingMovedCode,this._contextKeyService,C=>{var S;return!!((S=this._diffModel.read(C))!=null&&S.movedTextToCompare.read(C))})),this._register(Nh(H.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Nh(H.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Nh(H.hasChanges,this._contextKeyService,C=>{var S,L;return(((L=(S=this._diffModel.read(C))==null?void 0:S.diff.read(C))==null?void 0:L.mappings.length)??0)>0})),this._editors=this._register(this._instantiationService.createInstance(Kj,this.elements.original,this.elements.modified,this._options,i,(C,S,L,x)=>this._createInnerEditor(C,S,L,x))),this._register(Nh(H.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Nh(H.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Nh(H.diffEditorOriginalUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.original.uri.toString())??""})),this._register(Nh(H.diffEditorModifiedUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.modified.uri.toString())??""})),this._overviewRulerPart=Ml(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(lf(aN),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,S)=>{var L;return C-(((L=this._overviewRulerPart.read(S))==null?void 0:L.width)??0)})};this._sashLayout=new DXe(this._options,c),this._sash=Ml(this,C=>{const S=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",S),S?new u1e(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=Ml(this,C=>this._instantiationService.createInstance(lf(ZP),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Ml(this,C=>this._instantiationService.createInstance(lf(kXe),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const g=Ml(this,C=>this._instantiationService.createInstance(lf(Uj),Oe(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.read(void 0).isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=oe(this,C=>{const S=g.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return S.concat(L)}),m=oe(this,C=>{const S=g.read(C).viewZones.read(C).mod,L=d.read(C).viewZones.read(C).modViewZones;return S.concat(L)});this._register(qP(this._editors.original,p,C=>{f=C},h));let b;this._register(qP(this._editors.modified,m,C=>{f=C,f?b=nh.capture(this._editors.modified):(b==null||b.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=Ml(this,C=>this._instantiationService.createInstance(lf(_v),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,L)=>this._accessibleDiffViewerShouldBeVisible.set(S,L),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,L)=>{var x;return(x=S==null?void 0:S.diff.read(L))==null?void 0:x.mappings.map(E=>E.lineRangeMapping)}),new hXe(this._editors))).recomputeInitiallyAndOnChange(this._store);const v=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(d_(this.elements.modified,{visibility:v})),this._register(d_(this.elements.original,{visibility:v})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(Re(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=Ml(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(lf(Zj),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(dS(this._layoutInfo)),Ml(this,C=>new(lf(yy))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(ve.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(ve.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const w=this._diffModel.map(this,(C,S)=>{if(C)return C.diff.read(S)===void 0&&!C.isDiffUpToDate.read(S)});this._register(Eo((C,S)=>{if(w.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);S.add(Re(()=>L.done()))}})),this._register(Eo((C,S)=>{S.add(new(lf(jXe))(this._editors,this._diffModel,this._options,this))})),this._register(Eo((C,S)=>{const L=this._diffModel.read(C);if(L)for(const x of[L.model.original,L.model.modified])S.add(x.onWillDispose(E=>{Je(new ze("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(qe(C=>{this._options.setModel(this._diffModel.read(C))}))}_createInnerEditor(e,t,i,s){return e.createInstance(lw,t,i,s)}_createDiffEditorContributions(){const e=ny.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Je(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return pD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var i;const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:(i=this._diffModel.get())==null?void 0:i.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())==null||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance($j,e,this._options)}getModel(){var e;return((e=this._diffModel.get())==null?void 0:e.model)??null}setModel(e){const t=e?"model"in e?KP.create(e).createNewRef(this):KP.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(e==null?void 0:e.object)&&cS(t,s=>{var a;const o=e==null?void 0:e.object;Ut.batchEventsGlobally(s,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=(a=this._diffModelSrc.get())==null?void 0:a.createNewRef(this);this._diffModelSrc.set(e==null?void 0:e.createNewRef(this),s),setTimeout(()=>{r==null||r.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?UXe(e):null}getDiffComputationResult(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(i=>i.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){var l,c;const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=(c=(l=this._diffModel.get())==null?void 0:l.diff.get())==null?void 0:c.mappings;if(!t||t.length===0)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const s=i.getPosition().lineNumber,o=i.getSelection(),r=Ye.fromRange(o||new D(s,0,s,0)),a=t.filter(d=>d.lineRangeMapping.modified.intersect(r));i.pushUndoStop(),i.executeEdits("diffEditor",a.map(d=>({range:d.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new U(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var o,r;const t=(r=(o=this._diffModel.get())==null?void 0:o.diff.get())==null?void 0:r.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?this._editors.modified.getModel().getLineCount()===i?s=t[0]:s=t.find(l=>l.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=_I(t,a=>a.lineRangeMapping.modified.startLineNumber{var i;const t=(i=e.diff.get())==null?void 0:i.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var r,a;const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const o=t.getSelection();if(o){const l=(a=(r=this._diffModel.get())==null?void 0:r.diff.get())==null?void 0:a.mappings.map(c=>e?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Dre(o.getStartPosition(),l),d=Dre(o.getEndPosition(),l);s=D.plusRange(c,d)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&wi(i=>{for(const s of e)s.collapseAll(i)})}showAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&wi(i=>{for(const s of e)s.showAll(i)})}_handleCursorPositionChange(e,t){var i,s;if((e==null?void 0:e.reason)===3){const o=(s=(i=this._diffModel.get())==null?void 0:i.diff.get())==null?void 0:s.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));o!=null&&o.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(dr.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):o!=null&&o.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(dr.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):o&&this._accessibilitySignalService.playSignal(dr.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Eu=$Xe([cL(3,Xe),cL(4,Ae),cL(5,Ft),cL(6,Kg),cL(7,Tg)],Eu);function UXe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}function sh(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===pD.ICodeEditor:!1}function uX(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===pD.IDiffEditor:!1}function qXe(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function _1e(n){return sh(n)?n:uX(n)?n.getModifiedEditor():qXe(n)&&sh(n.activeCodeEditor)?n.activeCodeEditor:null}var KXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yre=function(n,e){return function(t,i){e(t,i,n)}},QR,Xv;let Jj=(Xv=class{constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){var d;const s=sh(i.context)?i.context:void 0;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):s&&(o=(d=s.getModel())==null?void 0:d.getLanguageId()),o||(o=al);const r=await fze(this._languageService,t,o),a=QR._ttpTokenizer?QR._ttpTokenizer.createHTML(r)??r:r,l=document.createElement("span");l.innerHTML=a;const c=l.querySelector(".monaco-tokenized-source");return hn(c)?(Ms(c,this.getFontInfo(s)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):j3e({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}},QR=Xv,Xv._ttpTokenizer=Tu("tokenizeToString",{createHTML(e){return e}}),Xv);Jj=QR=KXe([Yre(0,lt),Yre(1,un)],Jj);var fX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vi=function(n,e){return function(t,i){e(t,i,n)}};let GXe=0,Zre=!1;function YXe(n){if(!n){if(Zre)return;Zre=!0}O3e(n||ri.document.body)}let QP=class extends lw{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g){const p={...t};p.ariaLabel=p.ariaLabel||kz.editorViewAccessibleLabel,super(e,p,{},i,s,o,r,c,d,h,u,f),l instanceof IS?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,YXe(p.ariaContainerElement),Fqe((m,b)=>i.createInstance(SS,m,{instantHover:b},{})),Bqe(a),g.setDefaultCodeBlockRenderer(i.createInstance(Jj))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++GXe,o=le.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None;const t=e.id,i=e.label,s=le.and(le.equals("editorId",this.getId()),le.deserialize(e.precondition)),o=e.keybindings,r=le.and(s,le.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new ne,h=this.getId()+":"+t;if(d.add(Rt.registerCommand(h,c)),a){const f={command:{id:h,title:i},when:s,group:a,order:l};d.add(Rs.appendMenuItem(Te.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,c,r));const u=new b_e(h,i,i,void 0,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Re(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof aP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};QP=fX([vi(2,Ae),vi(3,Ft),vi(4,Ei),vi(5,Xe),vi(6,Cr),vi(7,Ht),vi(8,en),vi(9,fn),vi(10,Us),vi(11,Ki),vi(12,De),vi(13,Jc)],QP);let e$=class extends QP{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g,p,m,b){const v={...t};$P(h,v,!1);const w=c.registerEditorContainer(e);typeof v.theme=="string"&&c.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const C=v.model;delete v.model,super(e,v,i,s,o,r,a,l,c,d,u,p,m,b),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let S;if(typeof C>"u"){const L=g.getLanguageIdByMimeType(v.language)||v.language||al;S=b1e(f,g,v.value||"",L,void 0),this._ownsModel=!0}else S=C,this._ownsModel=!1;if(this._attachModel(S),S){const L={oldModelUrl:null,newModelUrl:S.uri};this._onDidChangeModel.fire(L)}}dispose(){super.dispose()}updateOptions(e){$P(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};e$=fX([vi(2,Ae),vi(3,Ft),vi(4,Ei),vi(5,Xe),vi(6,Cr),vi(7,Ht),vi(8,ml),vi(9,fn),vi(10,lt),vi(11,Us),vi(12,qi),vi(13,un),vi(14,Ki),vi(15,De),vi(16,Jc)],e$);let t$=class extends Eu{constructor(e,t,i,s,o,r,a,l,c,d,h,u){const f={...t};$P(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){$P(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(QP,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};t$=fX([vi(2,Ae),vi(3,Xe),vi(4,Ft),vi(5,ml),vi(6,fn),vi(7,lt),vi(8,gl),vi(9,Tg),vi(10,xa),vi(11,Kg)],t$);function b1e(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),Xre(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return Xre(n,t,e.createById(i),s)}function Xre(n,e,t,i){return n.createModel(e,t,i)}F("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},_(142,"The background color of the diff editor's header"));F("multiDiffEditor.background",Ln,_(143,"The background color of the multi file diff editor"));F("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},_(144,"The border color of the multi file diff editor"));var ZXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qre=function(n,e){return function(t,i){e(t,i,n)}};class XXe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let i$=class extends G{constructor(e,t,i,s,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=Ze(this,void 0),this._collapsed=oe(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=Ze(this,500),this.contentHeight=oe(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ze(this,0),this._modifiedWidth=Ze(this,0),this._originalContentWidth=Ze(this,0),this._originalWidth=Ze(this,0),this.maxScroll=oe(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Pt("div.multiDiffEntry",[Pt("div.header@header",[Pt("div.header-content",[Pt("div.collapse-button@collapseButton"),Pt("div.file-path",[Pt("div.title.modified.show-file-icons@primaryPath",[]),Pt("div.status.deleted@status",["R"]),Pt("div.title.original.show-file-icons@secondaryPath",[])]),Pt("div.actions@actions")])]),Pt("div.editorParent",[Pt("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Eu,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=Ui(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=Ui(this.editor.getOriginalEditor()).isFocused,this.isFocused=oe(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new ne),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new EP(this._elements.collapseButton,{});this._register(qe(l=>{r.element.className="",r.icon=this._collapsed.read(l)?de.chevronRight:de.chevronDown})),this._register(r.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(qe(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{IL(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(qe(l=>{var d;const c=(d=this._viewModel.read(l))==null?void 0:d.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new cx([Xe,this._contextKeyService])));this._register(a.createInstance(cN,this._elements.actions,Te.MultiDiffEditorFileToolbar,{actionRunner:this._register(new p1e(()=>{var l,c;return((l=this._viewModel.get())==null?void 0:l.modifiedUri)??((c=this._viewModel.get())==null?void 0:c.originalUri)})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>AZ(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){IL(s=>{this._viewModel.set(void 0,s),this.editor.setDiffModel(null,s),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(IL(s=>{var c,d;(c=this._resourceLabel)==null||c.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(d=this._resourceLabel2)==null||d.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,s),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,s=>{s||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[s,o]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(s,o)}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(s.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,IL(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};i$=ZXe([Qre(3,Ae),Qre(4,Xe)],i$);class QXe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var JXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jre=function(n,e){return function(t,i){e(t,i,n)}};let n$=class extends G{constructor(e,t,i,s,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Pt("div.scrollContent",[Pt("div@content",{style:{overflow:"hidden"}}),Pt("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new rx({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Ur(Oe(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new m3(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Pt("div.monaco-component.multiDiffEditor",{},[Pt("div",{},[this._scrollableElement.getDomNode()]),Pt("div.placeholder@placeholder",{},[Pt("div")])]),this._sizeObserver=this._register(new r1e(this._element,void 0)),this._objectPool=this._register(new QXe(c=>{const d=this._instantiationService.createInstance(i$,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=Ut(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=Ut(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=oe(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:g=>{throw new ze}};const h=d.items.read(c),u=new Map;return{items:h.map(g=>{var b;const p=c.store.add(new tQe(g,this._objectPool,this.scrollLeft,v=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+v})})),m=(b=this._lastDocStates)==null?void 0:b[p.getKey()];return m&&wi(v=>{p.setViewState(m,v)}),u.set(g,p),p}),getItem:g=>u.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=oe(this,c=>{var u,f;const d=(u=this._viewModel.read(c))==null?void 0:u.activeDiffItem.read(c);return d?(f=this._viewItemsInfo.read(c).getItem(d).template.read(c))==null?void 0:f.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new cx([Xe,this._contextKeyService]))),this._contextKeyService.createKey(H.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(Eo((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,f]of Object.entries(h.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(f),d.add(Re(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(H.multiDiffEditorAllCollapsed.key,!1);this._register(qe(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(qe(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=oe(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?_(145,"Loading..."):_(146,"No Changed Files")});this._register(qe(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(qe(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let f=u;const g=this._viewItems.read(c),p=cY(g,lo(m=>m.maxScroll.read(c).maxScroll,pa));if(p){const m=p.maxScroll.read(c);f=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(Re(()=>{e.replaceChildren()})),this._register(qe(c=>{const d=this._viewModel.read(c);if(d&&!d.isLoading.read(c)){if(d.items.read(c).length===0||d.activeDiffItem.read(c))return;this.goToNextChange()}})),this._register(this._register(qe(c=>{IL(d=>{this.render(c)})})))}reveal(e,t){var c;const i=this._viewItems.get(),s=i.findIndex(d=>{var h,u,f,g;return((h=d.viewModel.originalUri)==null?void 0:h.toString())===((u=e.original)==null?void 0:u.toString())&&((f=d.viewModel.modifiedUri)==null?void 0:f.toString())===((g=e.modified)==null?void 0:g.toString())});if(s===-1)throw new ze("Resource not found in diff editor");const o=i[s];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let d=0;df.viewModel===i):-1;if(s===-1){this._goToFile(0,"first");return}const o=t[s];o.viewModel.collapsed.get()&&o.viewModel.collapsed.set(!1,void 0);const r=(c=o.template.get())==null?void 0:c.editor;if((h=(d=r==null?void 0:r.getDiffComputationResult())==null?void 0:d.changes2)!=null&&h.length){const f=((u=r.getModifiedEditor().getPosition())==null?void 0:u.lineNumber)||1,g=r.getDiffComputationResult().changes2;if(e==="next"?g.some(m=>m.modified.startLineNumber>f):g.some(m=>m.modified.endLineNumberExclusive<=f)){r.goToDiff(e);return}}const a=(s+(e==="next"?1:-1)+t.length)%t.length;this._goToFile(a,e==="next"?"first":"last")}_goToFile(e,t){var o,r,a;const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const s=(o=i.template.get())==null?void 0:o.editor;if((a=(r=s==null?void 0:s.getDiffComputationResult())==null?void 0:r.changes2)!=null&&a.length)if(t==="first")s.revealFirstDiff();else{const l=s.getDiffComputationResult().changes2.at(-1),c=s.getModifiedEditor();c.setPosition({lineNumber:l.modified.startLineNumber,column:1}),c.revealLineInCenter(l.modified.startLineNumber)}s==null||s.focus()}render(e){const t=this.scrollTop.read(e);let i=0,s=0,o=0;const r=this._sizeObserver.height.read(e),a=Me.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=Me.ofStartAndLength(s,h),f=Me.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,d-h));i-=g;const p=Me.ofStartAndLength(t+i,r);c.render(u,g,l,p)}s+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};n$=JXe([Jre(4,Xe),Jre(5,Ae)],n$);function eQe(n,e){const t=n.getModel(),i=n.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{n.getModel()===t&&i.clear()},350)}class tQe extends G{constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(QG(this,void 0)),this.contentHeight=oe(this,o=>{var r,a;return((a=(r=this._templateRef.read(o))==null?void 0:r.object.contentHeight)==null?void 0:a.read(o))??this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=oe(this,o=>{var r;return((r=this._templateRef.read(o))==null?void 0:r.object.maxScroll.read(o))??{maxScroll:0,scrollWidth:0}}),this.template=oe(this,o=>{var r;return(r=this._templateRef.read(o))==null?void 0:r.object}),this._isHidden=Ze(this,!1),this._isFocused=oe(this,o=>{var r;return((r=this.template.read(o))==null?void 0:r.isFocused.read(o))??!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(qe(o=>{var a;const r=this._scrollLeft.read(o);(a=this._templateRef.read(o))==null||a.object.setScrollLeft(r)})),this._register(qe(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.documentDiffItem.modified)==null?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var r;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=(r=e.selections)==null?void 0:r.map(Ie.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&wi(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new XXe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,s)}}var iQe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nQe=function(n,e){return function(t,i){e(t,i,n)}};let s$=class extends G{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Ze(this,void 0),this._viewModel=Ze(this,void 0),this._widgetImpl=oe(this,s=>s.store.add(this._instantiationService.createInstance(lf(n$),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(dS(this._widgetImpl))}};s$=iQe([nQe(2,Ae)],s$);function sQe(n,e,t){return et.initialize(t||{}).createInstance(e$,n,e)}function oQe(n){return et.get(Ft).onCodeEditorAdd(t=>{n(t)})}function rQe(n){return et.get(Ft).onDiffEditorAdd(t=>{n(t)})}function aQe(){return et.get(Ft).listCodeEditors()}function lQe(){return et.get(Ft).listDiffEditors()}function cQe(n,e,t){return et.initialize(t||{}).createInstance(t$,n,e)}function dQe(n,e){const t=et.initialize(e||{});return new s$(n,{},t)}function hQe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rt.registerCommand(n.id,n.run)}function uQe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=le.deserialize(n.precondition),t=(s,...o)=>cs.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new ne;if(i.add(Rt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Rs.appendMenuItem(Te.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=et.get(Ht);if(!(s instanceof IS))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=le.and(e,le.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function fQe(n){return v1e([n])}function v1e(n){const e=et.get(Ht);return e instanceof IS?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:le.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None)}function gQe(n,e,t){const i=et.get(un),s=i.getLanguageIdByMimeType(e)||e;return b1e(et.get(qi),i,n,s,t)}function pQe(n,e){const t=et.get(un),i=t.getLanguageIdByMimeType(e)||e||al;n.setLanguage(t.createById(i))}function mQe(n,e,t){n&&et.get(Pu).changeOne(e,n.uri,t)}function _Qe(n){et.get(Pu).changeAll(n,[])}function bQe(n){return et.get(Pu).read(n)}function vQe(n){return et.get(Pu).onMarkerChanged(n)}function wQe(n){return et.get(qi).getModel(n)}function CQe(){return et.get(qi).getModels()}function yQe(n){return et.get(qi).onModelAdded(n)}function SQe(n){return et.get(qi).onModelRemoved(n)}function xQe(n){return et.get(qi).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function LQe(n){return a3e(et.get(qi),n)}function kQe(n,e){const t=et.get(un),i=et.get(ml);return mY.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function EQe(n,e,t){const i=et.get(un);return et.get(ml).registerEditorContainer(ri.document.body),mY.colorize(i,n,e,t)}function IQe(n,e,t=4){return et.get(ml).registerEditorContainer(ri.document.body),mY.colorizeModelLine(n,e,t)}function NQe(n){const e=rn.get(n);return e||{getInitialState:()=>pS,tokenize:(t,i,s)=>fY(n,s)}}function DQe(n,e){rn.getOrCreate(e);const t=NQe(e),i=wa(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;r{var a;if(!i)return null;const o=(a=t.options)==null?void 0:a.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await n.openCodeEditor(i,t.resource,r)?i:null})}function FQe(){return{create:sQe,getEditors:aQe,getDiffEditors:lQe,onDidCreateEditor:oQe,onDidCreateDiffEditor:rQe,createDiffEditor:cQe,addCommand:hQe,addEditorAction:uQe,addKeybindingRule:fQe,addKeybindingRules:v1e,createModel:gQe,setModelLanguage:pQe,setModelMarkers:mQe,getModelMarkers:bQe,removeAllMarkers:_Qe,onDidChangeMarkers:vQe,getModels:CQe,getModel:wQe,onDidCreateModel:yQe,onWillDisposeModel:SQe,onDidChangeModelLanguage:xQe,createWebWorker:LQe,colorizeElement:kQe,colorize:EQe,colorizeModelLine:IQe,tokenize:DQe,defineTheme:TQe,setTheme:RQe,remeasureFonts:MQe,registerCommand:AQe,registerLinkOpener:PQe,registerEditorOpener:OQe,AccessibilitySupport:fW,ContentWidgetPositionPreference:vW,CursorChangeReason:wW,DefaultEndOfLine:CW,EditorAutoIndentStrategy:SW,EditorOption:xW,EndOfLinePreference:LW,EndOfLineSequence:kW,MinimapPosition:BW,MinimapSectionHeaderStyle:WW,MouseTargetType:HW,OverlayWidgetPositionPreference:jW,OverviewRulerLane:$W,GlyphMarginLane:EW,RenderLineNumbersType:KW,RenderMinimap:GW,ScrollbarVisibility:ZW,ScrollType:YW,TextEditorCursorBlinkingStyle:nH,TextEditorCursorStyle:sH,TrackedRangeStickiness:oH,WrappingIndent:rH,InjectedTextCursorStops:DW,PositionAffinity:qW,ShowLightbulbIconMode:QW,TextDirection:iH,ConfigurationChangedEvent:_ge,BareFontInfo:X1,FontInfo:tA,TextModelResolvedOptions:DR,FindMatch:mI,ApplyUpdateResult:dk,EditorZoom:Vl,createMultiFileDiffEditor:dQe,EditorType:pD,EditorOptions:zo}}function BQe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function k2(n,e){return typeof n=="boolean"?n:e}function eae(n,e){return typeof n=="string"?n:e}function WQe(n){const e={};for(const t of n)e[t]=!0;return e}function tae(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=WQe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function o$(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(r,a){s=!0;let l="";if(typeof n[a]=="string")l=n[a];else if(n[a]&&n[a]instanceof RegExp)l=n[a].source;else throw n[a]===void 0?Oi(n,"language definition does not contain attribute '"+a+"', used at: "+e):Oi(n,"attribute reference '"+a+"' must be a string, used at: "+e);return Nb(l)?"":"(?:"+l+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const o=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(I3e(n,e,c),o)),l)}return new RegExp(e,o)}function HQe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Oi(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Oi(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!N3e(n,Fp(n,s,"",[],""))))throw Oi(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=o$(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=r$(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function w1e(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:n,includeLF:k2(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:k2(e.ignoreCase,!1),unicode:k2(e.unicode,!1),tokenPostfix:eae(e.tokenPostfix,"."+n),defaultToken:eae(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Oi(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Oi(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const h=new zQe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw Oi(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw Oi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=k2(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Oi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Oi(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Oi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:ag(t,a.open),close:ag(t,a.close)});else throw Oi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function jQe(n){uS.registerLanguage(n)}function $Qe(){let n=[];return n=n.concat(uS.getLanguages()),n}function UQe(n){return et.get(un).languageIdCodec.encodeLanguageId(n)}function qQe(n,e){return et.withServices(()=>{const i=et.get(un).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function KQe(n,e){return et.withServices(()=>{const i=et.get(un).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function GQe(n,e){if(!et.get(un).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return et.get(Ki).register(n,e,100)}class YQe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return dN.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new M5(s.tokens,s.endState)}}class dN{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;c===0?f=0:f{const i=await Promise.resolve(e.create());return i?ZQe(i)?y1e(n,i):new yI(et.get(un),et.get(ml),n,w1e(n,i),et.get(lt)):null});return rn.registerFactory(n,t)}function JQe(n,e){if(!et.get(un).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return C1e(e)?gX(n,{create:()=>e}):rn.register(n,y1e(n,e))}function eJe(n,e){const t=i=>new yI(et.get(un),et.get(ml),n,w1e(n,i),et.get(lt));return C1e(e)?gX(n,{create:()=>e}):rn.register(n,t(e))}function tJe(n,e){return et.get(De).referenceProvider.register(n,e)}function iJe(n,e){return et.get(De).renameProvider.register(n,e)}function nJe(n,e){return et.get(De).newSymbolNamesProvider.register(n,e)}function sJe(n,e){return et.get(De).signatureHelpProvider.register(n,e)}function oJe(n,e){return et.get(De).hoverProvider.register(n,{provideHover:async(i,s,o,r)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new D(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),l.range||(l.range=new D(s.lineNumber,s.column,s.lineNumber,s.column)),l})}})}function rJe(n,e){return et.get(De).documentSymbolProvider.register(n,e)}function aJe(n,e){return et.get(De).documentHighlightProvider.register(n,e)}function lJe(n,e){return et.get(De).linkedEditingRangeProvider.register(n,e)}function cJe(n,e){return et.get(De).definitionProvider.register(n,e)}function dJe(n,e){return et.get(De).implementationProvider.register(n,e)}function hJe(n,e){return et.get(De).typeDefinitionProvider.register(n,e)}function uJe(n,e){return et.get(De).codeLensProvider.register(n,e)}function fJe(n,e,t){return et.get(De).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=et.get(Pu).read({resource:s.uri}).filter(d=>D.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function gJe(n,e){return et.get(De).documentFormattingEditProvider.register(n,e)}function pJe(n,e){return et.get(De).documentRangeFormattingEditProvider.register(n,e)}function mJe(n,e){return et.get(De).onTypeFormattingEditProvider.register(n,e)}function _Je(n,e){return et.get(De).linkProvider.register(n,e)}function bJe(n,e){return et.get(De).completionProvider.register(n,e)}function vJe(n,e){return et.get(De).colorProvider.register(n,e)}function wJe(n,e){return et.get(De).foldingRangeProvider.register(n,e)}function CJe(n,e){return et.get(De).declarationProvider.register(n,e)}function yJe(n,e){return et.get(De).selectionRangeProvider.register(n,e)}function SJe(n,e){return et.get(De).documentSemanticTokensProvider.register(n,e)}function xJe(n,e){return et.get(De).documentRangeSemanticTokensProvider.register(n,e)}function LJe(n,e){return et.get(De).inlineCompletionsProvider.register(n,e)}function kJe(n,e){return et.get(De).inlayHintsProvider.register(n,e)}function EJe(){return{register:jQe,getLanguages:$Qe,onLanguage:qQe,onLanguageEncountered:KQe,getEncodedLanguageId:UQe,setLanguageConfiguration:GQe,setColorMap:QQe,registerTokensProviderFactory:gX,setTokensProvider:JQe,setMonarchTokensProvider:eJe,registerReferenceProvider:tJe,registerRenameProvider:iJe,registerNewSymbolNameProvider:nJe,registerCompletionItemProvider:bJe,registerSignatureHelpProvider:sJe,registerHoverProvider:oJe,registerDocumentSymbolProvider:rJe,registerDocumentHighlightProvider:aJe,registerLinkedEditingRangeProvider:lJe,registerDefinitionProvider:cJe,registerImplementationProvider:dJe,registerTypeDefinitionProvider:hJe,registerCodeLensProvider:uJe,registerCodeActionProvider:fJe,registerDocumentFormattingEditProvider:gJe,registerDocumentRangeFormattingEditProvider:pJe,registerOnTypeFormattingEditProvider:mJe,registerLinkProvider:_Je,registerColorProvider:vJe,registerFoldingRangeProvider:wJe,registerDeclarationProvider:CJe,registerSelectionRangeProvider:yJe,registerDocumentSemanticTokensProvider:SJe,registerDocumentRangeSemanticTokensProvider:xJe,registerInlineCompletionsProvider:LJe,registerInlayHintsProvider:kJe,DocumentHighlightKind:yW,CompletionItemKind:mW,CompletionItemTag:_W,CompletionItemInsertTextRule:pW,SymbolKind:eH,SymbolTag:tH,IndentAction:NW,CompletionTriggerKind:bW,SignatureHelpTriggerKind:JW,InlayHintKind:TW,InlineCompletionTriggerKind:AW,CodeActionTriggerType:gW,NewSymbolNameTag:VW,NewSymbolNameTriggerKind:zW,PartialAcceptTriggerKind:UW,HoverVerbosityAction:IW,InlineCompletionEndOfLifeReasonKind:RW,InlineCompletionHintStyle:MW,FoldingRangeKind:yg,SelectedSuggestionInfo:Ige,EditDeltaInfo:VI}}const pX=mt("IEditorCancelService"),S1e=new Se("cancellableOperation",!1,_(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));xt(pX,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=S1e.bindTo(s.get(Xe)),r=new Uo;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class IJe extends Wi{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(pX).add(e,this))}dispose(){this._unregister(),super.dispose()}}ye(new class extends cs{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:S1e})}runEditorCommand(n,e){n.get(pX).cancel(e)}});let x1e=class a${constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?J1("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof a$))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new a$(e,this.flags))}};class Mg extends IJe{constructor(e,t,i,s){super(e,s),this._listener=new ne,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!D.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!D.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class mX extends Wi{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class NS{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=nh.capture(e),o=NS._handleEolEdits(e,t);o.length===1&&NS._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>ln.replace(D.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>ln.replaceMove(D.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class iae{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class NJe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(iae.toKey(e))}has(e){return this._set.has(iae.toKey(e))}}function L1e(n,e,t){const i=[],s=new NJe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const bE=class bE{static setFormatterSelector(e){return{dispose:bE._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const o=Nt.first(bE._selectors);if(o)return await o(e,t,i,s)}};bE._selectors=new Uo;let hN=bE;async function k1e(n,e,t,i,s,o,r){const a=n.get(Ae),{documentRangeFormattingEditProvider:l}=n.get(De),c=sh(e)?e.getModel():e,d=l.ordered(c),h=await hN.select(d,c,i,2);h&&(s.report(h),await a.invokeFunction(DJe,h,e,t,o,r))}async function DJe(n,e,t,i,s,o){var b,v;const r=n.get(Zr),a=n.get(ki),l=n.get(Kg);let c,d;sh(t)?(c=t.getModel(),d=new Mg(t,5,void 0,s)):(c=t,d=new mX(t,s));const h=[];let u=0;for(const w of yG(i).sort(D.compareRangesUsingStarts))u>0&&D.areIntersectingOrTouching(h[u-1],w)?h[u-1]=D.fromPositions(h[u-1].getStartPosition(),w.getEndPosition()):u=h.push(w);const f=async w=>{var S,L;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,w);const C=await e.provideDocumentRangeFormattingEdits(c,w,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)==null?void 0:L.value,C),C},g=(w,C)=>{if(!w.length||!C.length)return!1;const S=w.reduce((L,x)=>D.plusRange(L,x.range),w[0].range);if(!C.some(L=>D.intersectRanges(S,L.range)))return!1;for(const L of w)for(const x of C)if(D.intersectRanges(L.range,x.range))return!0;return!1},p=[],m=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,h);const w=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(v=e.extensionId)==null?void 0:v.value,w),m.push(w)}else{for(const w of h){if(d.token.isCancellationRequested)return!0;m.push(await f(w))}for(let w=0;w({text:S.text,range:D.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:L}of S)if(D.areIntersectingOrTouching(L,C))return[new Ie(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(dr.format,{userGesture:o}),!0}async function TJe(n,e,t,i,s,o){const r=n.get(Ae),a=n.get(De),l=sh(e)?e.getModel():e,c=L1e(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await hN.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(RJe,d,e,t,s,o))}async function RJe(n,e,t,i,s,o){const r=n.get(Zr),a=n.get(Kg);let l,c;sh(t)?(l=t.getModel(),c=new Mg(t,5,void 0,s)):(l=t,c=new mX(t,s));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(sh(t))NS.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new Ie(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(f=>({text:f.text,range:D.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(D.areIntersectingOrTouching(g,u))return[new Ie(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(dr.format,{userGesture:o}),!0}async function MJe(n,e,t,i,s,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(Bn);if(Go(l))return await n.computeMoreMinimalEdits(t.uri,l)}}async function AJe(n,e,t,i,s){const o=L1e(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(Bn);if(Go(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function E1e(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(Bn).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Rt.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;Ot(He.isUri(t)),Ot(D.isIRange(i));const o=n.get(Xo),r=n.get(Zr),a=n.get(De),l=await o.createModelReference(t);try{return MJe(r,a,l.object.textEditorModel,D.lift(i),s,vt.None)}finally{l.dispose()}});Rt.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;Ot(He.isUri(t));const s=n.get(Xo),o=n.get(Zr),r=n.get(De),a=await s.createModelReference(t);try{return AJe(o,r,a.object.textEditorModel,i,vt.None)}finally{a.dispose()}});Rt.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,o]=e;Ot(He.isUri(t)),Ot(U.isIPosition(i)),Ot(typeof s=="string");const r=n.get(Xo),a=n.get(Zr),l=n.get(De),c=await r.createModelReference(t);try{return E1e(a,l,c.object.textEditorModel,U.lift(i),s,o,vt.None)}finally{c.dispose()}});zo.wrappingIndent.defaultValue=0;zo.glyphMargin.defaultValue=!1;zo.autoIndent.defaultValue=3;zo.overviewRulerLanes.defaultValue=2;hN.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const yr=Nge();yr.editor=FQe();yr.languages=EJe();const I1e=yr.CancellationTokenSource,N1e=yr.Emitter,D1e=yr.KeyCode,T1e=yr.KeyMod,R1e=yr.Position,M1e=yr.Range,A1e=yr.Selection,P1e=yr.SelectionDirection,Vk=yr.MarkerSeverity,O1e=yr.MarkerTag,F1e=yr.Uri,B1e=yr.Token,zk=yr.editor,y0=yr.languages,z9=VG(),Sy=globalThis;(z9!=null&&z9.globalAPI||typeof Sy.define=="function"&&Sy.define.amd)&&(Sy.monaco=yr);typeof Sy.require<"u"&&typeof Sy.require.config=="function"&&Sy.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const PJe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:I1e,Emitter:N1e,KeyCode:D1e,KeyMod:T1e,MarkerSeverity:Vk,MarkerTag:O1e,Position:R1e,Range:M1e,Selection:A1e,SelectionDirection:P1e,Token:B1e,Uri:F1e,editor:zk,languages:y0},Symbol.toStringTag,{value:"Module"}));function OJe(){return PJe}const j9=globalThis.MonacoEnvironment;j9!=null&&j9.globalAPI&&(globalThis.monaco=OJe());const FJe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:I1e,Emitter:N1e,KeyCode:D1e,KeyMod:T1e,MarkerSeverity:Vk,MarkerTag:O1e,Position:R1e,Range:M1e,Selection:A1e,SelectionDirection:P1e,Token:B1e,Uri:F1e,editor:zk,languages:y0},Symbol.toStringTag,{value:"Module"}));function BJe(n){return new Worker("/editor.worker-CKy7Pnvo.js",{name:n==null?void 0:n.name})}const WJe="modulepreload",HJe=function(n){return"/"+n},nae={},VJe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=HJe(l),l in nae)return;nae[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":WJe,c||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((u,f)=>{h.addEventListener("load",u),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return s.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};class zJe extends Ps{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:ie(85,"Toggle Collapse Unchanged Regions"),icon:de.map,toggled:le.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:le.has("isInDiffEditor"),menu:{when:le.has("isInDiffEditor"),id:Te.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class W1e extends Ps{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:ie(86,"Toggle Show Moved Code Blocks"),precondition:le.has("isInDiffEditor")})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class H1e extends Ps{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:ie(87,"Toggle Use Inline View When Space Is Limited"),precondition:le.has("isInDiffEditor")})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const PD=ie(88,"Diff Editor");class jJe extends Qc{constructor(){super({id:"diffEditor.switchSide",title:ie(89,"Switch Side"),icon:de.arrowSwap,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,i){const s=qw(e);if(s instanceof Eu){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class $Je extends Qc{constructor(){super({id:"diffEditor.exitCompareMove",title:ie(90,"Exit Compare Move"),icon:de.close,precondition:H.comparingMovedCode,f1:!1,category:PD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=qw(e);s instanceof Eu&&s.exitCompareMove()}}class UJe extends Qc{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:ie(91,"Collapse All Unchanged Regions"),icon:de.fold,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,...i){const s=qw(e);s instanceof Eu&&s.collapseAllUnchangedRegions()}}class qJe extends Qc{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:ie(92,"Show All Unchanged Regions"),icon:de.unfold,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,...i){const s=qw(e);s instanceof Eu&&s.showAllUnchangedRegions()}}class l$ extends Ps{constructor(){super({id:"diffEditor.revert",title:ie(93,"Revert"),f1:!0,category:PD,precondition:le.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=qw(e);t instanceof Eu&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=KJe(e,t.originalUri,t.modifiedUri);i instanceof Eu&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const V1e=ie(94,"Accessible Diff Viewer"),lF=class lF extends Ps{constructor(){super({id:lF.id,title:ie(95,"Go to Next Difference"),category:V1e,precondition:le.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qw(e);t==null||t.accessibleDiffViewerNext()}};lF.id="editor.action.accessibleDiffViewer.next";let uN=lF;const cF=class cF extends Ps{constructor(){super({id:cF.id,title:ie(96,"Go to Previous Difference"),category:V1e,precondition:le.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qw(e);t==null||t.accessibleDiffViewerPrev()}};cF.id="editor.action.accessibleDiffViewer.prev";let JP=cF;function KJe(n,e,t){return n.get(Ft).listDiffEditors().find(o=>{var l,c;const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&((l=r.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function qw(n){const t=n.get(Ft).listDiffEditors(),i=os();if(i){for(const s of t)if(s.getContainerDomNode().contains(i))return s}return null}ni(zJe);ni(W1e);ni(H1e);Rs.appendMenuItem(Te.EditorTitle,{command:{id:new H1e().desc.id,title:_(119,"Use Inline View When Space Is Limited"),toggled:le.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:le.has("isInDiffEditor")},order:11,group:"1_diff",when:le.and(H.diffEditorRenderSideBySideInlineBreakpointReached,le.has("isInDiffEditor"))});Rs.appendMenuItem(Te.EditorTitle,{command:{id:new W1e().desc.id,title:_(120,"Show Moved Code Blocks"),icon:de.move,toggled:QS.create("config.diffEditor.experimental.showMoves",!0),precondition:le.has("isInDiffEditor")},order:10,group:"1_diff",when:le.has("isInDiffEditor")});ni(l$);for(const n of[{icon:de.arrowRight,key:H.diffEditorInlineMode.toNegated()},{icon:de.discard,key:H.diffEditorInlineMode}])Rs.appendMenuItem(Te.DiffEditorHunkToolbar,{command:{id:new l$().desc.id,title:_(121,"Revert Block"),icon:n.icon},when:le.and(H.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Rs.appendMenuItem(Te.DiffEditorSelectionToolbar,{command:{id:new l$().desc.id,title:_(122,"Revert Selection"),icon:n.icon},when:le.and(H.diffEditorModifiedWritable,n.key),order:5,group:"primary"});ni(jJe);ni($Je);ni(UJe);ni(qJe);Rs.appendMenuItem(Te.EditorTitle,{command:{id:uN.id,title:_(123,"Open Accessible Diff Viewer"),precondition:le.has("isInDiffEditor")},order:10,group:"2_diff",when:le.and(H.accessibleDiffViewerVisible.negate(),le.has("isInDiffEditor"))});Rt.registerCommandAlias("editor.action.diffReview.next",uN.id);ni(uN);Rt.registerCommandAlias("editor.action.diffReview.prev",JP.id);ni(JP);var GJe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},YJe=function(n,e){return function(t,i){e(t,i,n)}},c$;const $3=new Se("selectionAnchorSet",!1);var Qv;let h_=(Qv=class{static get(e){return e.getContribution(c$.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=$3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Ie.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new yo().appendText(_(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),_r(_(799,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ie.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},c$=Qv,Qv.ID="editor.contrib.selectionAnchorController",Qv);h_=c$=GJe([YJe(1,Xe)],h_);class ZJe extends Ne{constructor(){super({id:"editor.action.setSelectionAnchor",label:ie(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2080),weight:100}})}async run(e,t){var i;(i=h_.get(t))==null||i.setSelectionAnchor()}}class XJe extends Ne{constructor(){super({id:"editor.action.goToSelectionAnchor",label:ie(801,"Go to Selection Anchor"),precondition:$3})}async run(e,t){var i;(i=h_.get(t))==null||i.goToSelectionAnchor()}}class QJe extends Ne{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:ie(802,"Select from Anchor to Cursor"),precondition:$3,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2089),weight:100}})}async run(e,t){var i;(i=h_.get(t))==null||i.selectFromAnchorToCursor()}}class JJe extends Ne{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:ie(803,"Cancel Selection Anchor"),precondition:$3,kbOpts:{kbExpr:H.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=h_.get(t))==null||i.cancelSelectionAnchor()}}At(h_.ID,h_,4);we(ZJe);we(XJe);we(QJe);we(JJe);const eet=F("editorOverviewRuler.bracketMatchForeground","#A0A0A0",_(804,"Overview ruler marker color for matching brackets."));class tet extends Ne{constructor(){super({id:"editor.action.jumpToBracket",label:ie(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=_w.get(t))==null||i.jumpToBracket()}}class iet extends Ne{constructor(){super({id:"editor.action.selectToBracket",label:ie(807,"Select to Bracket"),precondition:void 0,metadata:{description:ie(808,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var o;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(o=_w.get(t))==null||o.selectToBracket(s)}}class net extends Ne{constructor(){super({id:"editor.action.removeBrackets",label:ie(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){var i;(i=_w.get(t))==null||i.removeBrackets(this.id)}}class set{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Np=class Np extends G{static get(e){return e.getContribution(Np.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ai(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new Ie(r.lineNumber,r.column,r.lineNumber,r.column):new Ie(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(D.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=l,l=h}}a&&l&&i.push(new Ie(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(U.compare);const a=[];let l=0,c=0;const d=s.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}we(cet);const det=mt("productService");function _X(n,e){return{id:e,asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function het(n,e,t,i){const s={id:Ww(),name:n,uri:e,data:t};return{id:i,asString:async()=>"",asFile:()=>s,value:void 0}}class j1e{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Nt.some(this,([i,s])=>s.asFile())&&t.push("files"),$1e(eO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return eO(e)}}function eO(n){return n.toLowerCase()}function sae(n,e){return $1e(eO(n),e.map(eO))}function $1e(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const U3=Object.freeze({create:n=>bg(n.map(e=>e.toString())).join(`\r +`),await this._clipboardService.writeText(S)})),s.getOption(104)||v.push(new ol("diff.inline.revertChange",_(118,"Revert this change"),void 0,!0,async()=>{this._editor.revert(this._diff)})),v},autoSelectFirstItem:!0})};this._register(kn(this._diffActions,"mousedown",p=>{if(!p.leftButton)return;const{top:m,height:b}=dn(this._diffActions),v=Math.floor(h/3);p.preventDefault(),g({x:p.posx,y:m+b+v})})),this._register(s.onMouseMove(p=>{(p.target.type===8||p.target.type===5)&&p.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,p.event.browserEvent.y,h),this.visibility=!0):this.visibility=!1})),this._register(wXe({domNode:this._deletedCodeDomNode,diffEntry:o,originalModel:this._originalTextModel,renderLinesResult:this._renderLinesResult,clipboardService:d}))}_updateLightBulbPosition(e,t,i){const{top:s}=dn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._renderLinesResult.viewLineCounts){let l=0;for(let c=0;cn});function MD(n,e,t,i,s=!1){Ms(i,e.fontInfo);const o=t.length>0,r=new v_(1e4);let a=0,l=0;const c=[],d=[];for(let g=0;gnull),i=!0,s=!0){this.lineTokens=e,this.lineBreakData=t,this.mightContainNonBasicASCII=i,this.mightContainRTL=s}}class hg{static fromEditor(e){var o;const t=e.getOptions(),i=t.get(59),s=t.get(165);return new hg(((o=e.getModel())==null?void 0:o.getOptions().tabSize)||0,i,t.get(40),i.typicalHalfwidthCharacterWidth,t.get(118),t.get(75),s.decorationsWidth,t.get(133),t.get(113),t.get(108),t.get(60),t.get(117).verticalScrollbarSize)}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f=!0){this.tabSize=e,this.fontInfo=t,this.disableMonospaceOptimizations=i,this.typicalHalfwidthCharacterWidth=s,this.scrollBeyondLastColumn=o,this.lineHeight=r,this.lineDecorationsWidth=a,this.stopRenderingLineAfter=l,this.renderWhitespace=c,this.renderControlCharacters=d,this.fontLigatures=h,this.verticalScrollbarSize=u,this.setWidth=f}withSetWidth(e){return new hg(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,this.scrollBeyondLastColumn,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,e)}withScrollBeyondLastColumn(e){return new hg(this.tabSize,this.fontInfo,this.disableMonospaceOptimizations,this.typicalHalfwidthCharacterWidth,e,this.lineHeight,this.lineDecorationsWidth,this.stopRenderingLineAfter,this.renderWhitespace,this.renderControlCharacters,this.fontLigatures,this.verticalScrollbarSize,this.setWidth)}}class yXe{constructor(e,t,i,s,o){this.heightInLines=e,this.minWidthInPx=t,this.viewLineCounts=i,this._renderOutputs=s,this._source=o}getModelPositionAt(e,t){let i=e;for(;i&&!i.classList.contains("view-line");)i=i.parentElement;if(!i)return;const s=i.parentElement;if(!s)return;const o=s.querySelectorAll(".view-line");let r=-1;for(let h=0;h=this._renderOutputs.length)return;let a=1,l=r;for(let h=0;hthis._source.lineTokens.length)return;const c=this._renderOutputs[r];if(!c)return;const d=_S(c.characterMapping,e,t)+c.offset;return new U(a,d)}}class Ore extends NA{constructor(e,t,i){super(e,t),this.offset=i}}function Fre(n,e,t,i,s,o,r,a,l){a.appendString('
'):a.appendString('px;">');const c=e.getLineContent(),d=hl.isBasicASCII(c,s),h=hl.containsRTL(c,d,o),u=JS(new Vg(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,c,!1,d,h,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Cg.OFF,null,null,r.verticalScrollbarSize),a);a.appendString("
");const f=u.characterMapping.getHorizontalOffset(u.characterMapping.length);return{output:u,maxCharWidth:f}}var SXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Bre=function(n,e){return function(t,i){e(t,i,n)}};let $j=class extends G{constructor(e,t,i,s,o,r,a,l,c,d){super(),this._targetWindow=e,this._editors=t,this._diffModel=i,this._options=s,this._diffEditorWidget=o,this._canIgnoreViewZoneUpdateEvent=r,this._origViewZonesToIgnore=a,this._modViewZonesToIgnore=l,this._clipboardService=c,this._contextMenuService=d,this._originalTopPadding=Ze(this,0),this._originalScrollOffset=Ze(this,0),this._originalScrollOffsetAnimated=Ire(this._targetWindow,this._originalScrollOffset,this._store),this._modifiedTopPadding=Ze(this,0),this._modifiedScrollOffset=Ze(this,0),this._modifiedScrollOffsetAnimated=Ire(this._targetWindow,this._modifiedScrollOffset,this._store);const h=Ze("invalidateAlignmentsState",0),u=this._register(new ai(()=>{h.set(h.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{this._canIgnoreViewZoneUpdateEvent()||u.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(166)||w.hasChanged(75))&&u.schedule()}));const f=this._diffModel.map(w=>w?qt(this,w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,C)=>w==null?void 0:w.read(C)),g=oe(w=>{const C=this._diffModel.read(w),S=C==null?void 0:C.diff.read(w);if(!C||!S)return null;h.read(w);const x=this._options.renderSideBySide.read(w);return Wre(this._editors.original,this._editors.modified,S.mappings,this._origViewZonesToIgnore,this._modViewZonesToIgnore,x)}),p=oe(w=>{var L;const C=(L=this._diffModel.read(w))==null?void 0:L.movedTextToCompare.read(w);if(!C)return null;h.read(w);const S=C.changes.map(x=>new a1e(x));return Wre(this._editors.original,this._editors.modified,S,this._origViewZonesToIgnore,this._modViewZonesToIgnore,!0)});function m(){const w=document.createElement("div");return w.className="diagonal-fill",w}const b=this._register(new ne);this.viewZones=oe(this,w=>{var j,X,Y,te;b.clear();const C=g.read(w)||[],S=[],L=[],x=this._modifiedTopPadding.read(w);x>0&&L.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:x,showInHiddenAreas:!0,suppressMouseDown:!0});const I=this._originalTopPadding.read(w);I>0&&S.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:I,showInHiddenAreas:!0,suppressMouseDown:!0});const E=this._options.renderSideBySide.read(w),R=E||(j=this._editors.modified._getViewModel())==null?void 0:j.createLineBreaksComputer();if(R){const ce=this._editors.original.getModel();for(const Ce of C)if(Ce.diff)for(let xe=Ce.originalRange.startLineNumber;xece.getLineCount())return{orig:S,mod:L};R==null||R.addRequest(ce.getLineContent(xe),null,null)}}const M=(R==null?void 0:R.finalize())??[];let A=0;const W=this._editors.modified.getOption(75),P=(X=this._diffModel.read(w))==null?void 0:X.movedTextToCompare.read(w),B=((Y=this._editors.original.getModel())==null?void 0:Y.mightContainNonBasicASCII())??!1,V=((te=this._editors.original.getModel())==null?void 0:te.mightContainRTL())??!1,K=hg.fromEditor(this._editors.modified);for(const ce of C)if(ce.diff&&!E&&(!this._options.useTrueInlineDiffRendering.read(w)||!cX(ce.diff))){if(!ce.originalRange.isEmpty){f.read(w);const xe=document.createElement("div");xe.classList.add("view-lines","line-delete","line-delete-selectable","monaco-mouse-cursor-text");const Be=this._editors.original.getModel();if(ce.originalRange.endLineNumberExclusive-1>Be.getLineCount())return{orig:S,mod:L};const Ee=new AD(ce.originalRange.mapToLineArray(Ue=>Be.tokenization.getLineTokens(Ue)),ce.originalRange.mapToLineArray(Ue=>M[A++]),B,V),Le=[];for(const Ue of ce.diff.innerChanges||[])Le.push(new Mv(Ue.originalRange.delta(-(ce.diff.original.startLineNumber-1)),Wj.className,0));const ze=MD(Ee,K,Le,xe),Ct=document.createElement("div");if(Ct.className="inline-deleted-margin-view-zone",Ms(Ct,K.fontInfo),this._options.renderIndicators.read(w))for(let Ue=0;Ueqp(ct),Ct,xe,this._editors.modified,ce.diff,this._diffEditorWidget,ze,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Ue=0;Ue1&&S.push({afterLineNumber:ce.originalRange.startLineNumber+Ue,domNode:m(),heightInPx:(tt-1)*W,showInHiddenAreas:!0,suppressMouseDown:!0})}L.push({afterLineNumber:ce.modifiedRange.startLineNumber-1,domNode:xe,heightInPx:ze.heightInLines*W,minWidthInPx:ze.minWidthInPx,marginDomNode:Ct,setZoneId(Ue){ct=Ue},showInHiddenAreas:!0,suppressMouseDown:!1})}const Ce=document.createElement("div");Ce.className="gutter-delete",S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:ce.modifiedHeightInPx,marginDomNode:Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const Ce=ce.modifiedHeightInPx-ce.originalHeightInPx;if(Ce>0){if(P!=null&&P.lineRangeMapping.original.delta(-1).deltaLength(2).contains(ce.originalRange.endLineNumberExclusive-1))continue;S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let xe=function(){const Ee=document.createElement("div");return Ee.className="arrow-revert-change "+$e.asClassName(de.arrowRight),w.store.add(J(Ee,"mousedown",Le=>Le.stopPropagation())),w.store.add(J(Ee,"click",Le=>{Le.stopPropagation(),o.revert(ce.diff)})),me("div",{},Ee)};var z=xe;if(P!=null&&P.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(ce.modifiedRange.endLineNumberExclusive-1))continue;let Be;ce.diff&&ce.diff.modified.isEmpty&&this._options.shouldRenderOldRevertArrows.read(w)&&(Be=xe()),L.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ce,marginDomNode:Be,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const ce of p.read(w)??[]){if(!(P!=null&&P.lineRangeMapping.original.intersect(ce.originalRange))||!(P!=null&&P.lineRangeMapping.modified.intersect(ce.modifiedRange)))continue;const Ce=ce.modifiedHeightInPx-ce.originalHeightInPx;Ce>0?S.push({afterLineNumber:ce.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:Ce,showInHiddenAreas:!0,suppressMouseDown:!0}):L.push({afterLineNumber:ce.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-Ce,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:S,mod:L}});let v=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.modified.setScrollLeft(w.scrollLeft),v=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!v&&(v=!0,this._editors.original.setScrollLeft(w.scrollLeft),v=!1)})),this._originalScrollTop=qt(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qt(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(qe(w=>{const C=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.read(void 0)-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.read(void 0)-this._modifiedTopPadding.read(w));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,1)})),this._register(qe(w=>{const C=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.read(void 0)-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.read(void 0)-this._originalTopPadding.read(w));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,1)})),this._register(qe(w=>{var L;const C=(L=this._diffModel.read(w))==null?void 0:L.movedTextToCompare.read(w);let S=0;if(C){const x=this._editors.original.getTopForLineNumber(C.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.read(void 0);S=this._editors.modified.getTopForLineNumber(C.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.read(void 0)-x}S>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(S,void 0)):S<0?(this._modifiedTopPadding.set(-S,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.read(void 0)-S,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.read(void 0)+S,void 0,!0)}))}};$j=SXe([Bre(8,La),Bre(9,gl)],$j);function Wre(n,e,t,i,s,o){const r=new vg(Hre(n,i)),a=new vg(Hre(e,s)),l=n.getOption(75),c=e.getOption(75),d=[];let h=0,u=0;function f(p,m){for(;;){let b=r.peek(),v=a.peek();if(b&&b.lineNumber>=p&&(b=void 0),v&&v.lineNumber>=m&&(v=void 0),!b&&!v)break;const w=b?b.lineNumber-h:Number.MAX_VALUE,C=v?v.lineNumber-u:Number.MAX_VALUE;wC?(a.dequeue(),b={lineNumber:v.lineNumber-u+h,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Ye.ofLength(b.lineNumber,1),modifiedRange:Ye.ofLength(v.lineNumber,1),originalHeightInPx:l+b.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const p of t){let C=function(S,L,x=!1){var A,W;if(SP.lineNumberP+B.heightInPx,0))??0,M=((W=a.takeWhile(P=>P.lineNumberP+B.heightInPx,0))??0;d.push({originalRange:I,modifiedRange:E,originalHeightInPx:I.length*l+R,modifiedHeightInPx:E.length*c+M,diff:p.lineRangeMapping}),w=S,v=L};var g=C;const m=p.lineRangeMapping;f(m.original.startLineNumber,m.modified.startLineNumber);let b=!0,v=m.modified.startLineNumber,w=m.original.startLineNumber;if(o)for(const S of m.innerChanges||[]){S.originalRange.startColumn>1&&S.modifiedRange.startColumn>1&&C(S.originalRange.startLineNumber,S.modifiedRange.startLineNumber);const L=n.getModel(),x=S.originalRange.endLineNumber<=L.getLineCount()?L.getLineMaxColumn(S.originalRange.endLineNumber):Number.MAX_SAFE_INTEGER;S.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new U(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return KZe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}function cX(n){return n.innerChanges?n.innerChanges.every(e=>GP(e.modifiedRange)&&GP(e.originalRange)||e.originalRange.equalsRange(new D(1,1,1,1))):!1}function GP(n){return n.startLineNumber===n.endLineNumber}const _I=class _I extends G{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=qt(this,this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=qt(this,this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=ha("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Ze(this,0),this._modifiedViewZonesChangedSignal=ha("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=ha("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=oe(this,d=>{var L;this._element.replaceChildren();const h=this._diffModel.read(d),u=(L=h==null?void 0:h.diff.read(d))==null?void 0:L.movedTexts;if(!u||u.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(d);const f=this._originalEditorLayoutInfo.read(d),g=this._modifiedEditorLayoutInfo.read(d);if(!f||!g){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(d),this._originalViewZonesChangedSignal.read(d);const p=u.map(x=>{function I(K,z){const j=z.getTopForLineNumber(K.startLineNumber,!0),X=z.getTopForLineNumber(K.endLineNumberExclusive,!0);return(j+X)/2}const E=I(x.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(d),M=I(x.lineRangeMapping.modified,this._editors.modified),A=this._modifiedScrollTop.read(d),W=E-R,P=M-A,B=Math.min(E,M),V=Math.max(E,M);return{range:new Me(B,V),from:W,to:P,fromWithoutScroll:E,toWithoutScroll:M,move:x}});p.sort(LMe(co(x=>x.fromWithoutScroll>x.toWithoutScroll,Xfe),co(x=>x.fromWithoutScroll>x.toWithoutScroll?x.fromWithoutScroll:-x.toWithoutScroll,ma)));const m=dX.compute(p.map(x=>x.range)),b=10,v=f.verticalScrollbarWidth,w=(m.getTrackCount()-1)*10+b*2,C=v+w+(g.contentLeft-_I.movedCodeBlockPadding);let S=0;for(const x of p){const I=m.getTrack(S),E=v+b+I*10,R=15,M=15,A=C,W=g.glyphMarginWidth+g.lineNumbersWidth,P=18,B=document.createElementNS("http://www.w3.org/2000/svg","rect");B.classList.add("arrow-rectangle"),B.setAttribute("x",`${A-W}`),B.setAttribute("y",`${x.to-P/2}`),B.setAttribute("width",`${W}`),B.setAttribute("height",`${P}`),this._element.appendChild(B);const V=document.createElementNS("http://www.w3.org/2000/svg","g"),K=document.createElementNS("http://www.w3.org/2000/svg","path");K.setAttribute("d",`M 0 ${x.from} L ${E} ${x.from} L ${E} ${x.to} L ${A-M} ${x.to}`),K.setAttribute("fill","none"),V.appendChild(K);const z=document.createElementNS("http://www.w3.org/2000/svg","polygon");z.classList.add("arrow"),d.store.add(qe(j=>{K.classList.toggle("currentMove",x.move===h.activeMovedText.read(j)),z.classList.toggle("currentMove",x.move===h.activeMovedText.read(j))})),z.setAttribute("points",`${A-M},${x.to-R/2} ${A},${x.to} ${A-M},${x.to+R/2}`),V.appendChild(z),this._element.appendChild(V),S++}this.width.set(w,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Re(()=>this._element.remove())),this._register(qe(d=>{const h=this._originalEditorLayoutInfo.read(d),u=this._modifiedEditorLayoutInfo.read(d);!h||!u||(this._element.style.left=`${h.width-h.verticalScrollbarWidth}px`,this._element.style.height=`${h.height}px`,this._element.style.width=`${h.verticalScrollbarWidth+h.contentLeft-_I.movedCodeBlockPadding+this.width.read(d)}px`)})),this._register(lS(this._state));const r=oe(d=>{const h=this._diffModel.read(d),u=h==null?void 0:h.diff.read(d);return u?u.movedTexts.map(f=>({move:f,original:new v0(wi(f.lineRangeMapping.original.startLineNumber-1),18),modified:new v0(wi(f.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(qP(this._editors.original,r.map(d=>d.map(h=>h.original)))),this._register(qP(this._editors.modified,r.map(d=>d.map(h=>h.modified)))),this._register(ko((d,h)=>{const u=r.read(d);for(const f of u)h.add(new Vre(this._editors.original,f.original,f.move,"original",this._diffModel.get())),h.add(new Vre(this._editors.modified,f.modified,f.move,"modified",this._diffModel.get()))}));const a=ha("original.onDidFocusEditorWidget",d=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0))),l=ha("modified.onDidFocusEditorWidget",d=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>d(void 0),0)));let c="modified";this._register(GS({changeTracker:{createChangeSummary:()=>{},handleChange:(d,h)=>(d.didChange(a)&&(c="original"),d.didChange(l)&&(c="modified"),!0)}},d=>{a.read(d),l.read(d);const h=this._diffModel.read(d);if(!h)return;const u=h.diff.read(d);let f;if(u&&c==="original"){const g=this._editors.originalCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.original.contains(g.lineNumber)))}if(u&&c==="modified"){const g=this._editors.modifiedCursor.read(d);g&&(f=u.movedTexts.find(p=>p.lineRangeMapping.modified.contains(g.lineNumber)))}f!==h.movedTextToCompare.read(void 0)&&h.movedTextToCompare.set(void 0,void 0),h.setActiveMovedText(f)}))}};_I.movedCodeBlockPadding=4;let wy=_I;class dX{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=g5e(t,co(a=>a.intersectWithRangeLength(s),ma)):(o=t.length,t.push(new aY))),t[o].addRange(s),i.push(o)}return new dX(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class Vre extends oX{constructor(e,t,i,s,o){const r=Ot("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=Ot("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Ot("div.text-content@textContent"),Ot("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=qt(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(c_(this._nodes.root,{paddingRight:a.map(u=>u.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?_(131,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(132,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?_(133,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):_(134,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new jr(this._nodes.actionBar,{highlightToggledItems:!0})),d=new ol("",l,"",!1);c.push(d,{icon:!1,label:!0});const h=new ol("","Compare",$e.asClassName(de.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(qe(u=>{const f=this._diffModel.movedTextToCompare.read(u)===i;h.checked=f})),c.push(h,{icon:!1,label:!0})}}class xXe extends G{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=oe(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return null;const l=this._diffModel.read(o).movedTextToCompare.read(o),c=this._options.renderIndicators.read(o),d=this._options.showEmptyDecorations.read(o),h=[],u=[];if(!l)for(const g of a.mappings)if(g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:c?Tre:Mre}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:c?Dre:Rre}),g.lineRangeMapping.modified.isEmpty||g.lineRangeMapping.original.isEmpty)g.lineRangeMapping.original.isEmpty||h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:fXe}),g.lineRangeMapping.modified.isEmpty||u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:hXe});else{const p=this._options.useTrueInlineDiffRendering.read(o)&&cX(g.lineRangeMapping);for(const m of g.lineRangeMapping.innerChanges||[])if(g.lineRangeMapping.original.contains(m.originalRange.startLineNumber)&&h.push({range:m.originalRange,options:m.originalRange.isEmpty()&&d?gXe:Wj}),g.lineRangeMapping.modified.contains(m.modifiedRange.startLineNumber)&&u.push({range:m.modifiedRange,options:m.modifiedRange.isEmpty()&&d&&!p?uXe:Are}),p){const b=r.model.original.getValueInRange(m.originalRange);u.push({range:m.modifiedRange,options:{description:"deleted-text",before:{content:b,inlineClassName:"inline-deleted-text"},zIndex:1e5,showIfCollapsed:!0}})}}if(l)for(const g of l.changes){const p=g.original.toInclusiveRange();p&&h.push({range:p,options:c?Tre:Mre});const m=g.modified.toInclusiveRange();m&&u.push({range:m,options:c?Dre:Rre});for(const b of g.innerChanges||[])h.push({range:b.originalRange,options:Wj}),u.push({range:b.modifiedRange,options:Are})}const f=this._diffModel.read(o).activeMovedText.read(o);for(const g of a.movedTexts)h.push({range:g.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(g===f?" currentMove":""),blockPadding:[wy.movedCodeBlockPadding,0,wy.movedCodeBlockPadding,wy.movedCodeBlockPadding]}}),u.push({range:g.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(g===f?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:h,modifiedDecorations:u}}),this._register(UP(this._editors.original,this._decorations.map(o=>(o==null?void 0:o.originalDecorations)||[]))),this._register(UP(this._editors.modified,this._decorations.map(o=>(o==null?void 0:o.modifiedDecorations)||[])))}}class vs{static equals(e,t){return e.x===t.x&&e.y===t.y}constructor(e,t){this.x=e,this.y=t}add(e){return new vs(this.x+e.x,this.y+e.y)}deltaX(e){return new vs(this.x+e,this.y)}deltaY(e){return new vs(this.x,this.y+e)}toString(){return`(${this.x},${this.y})`}subtract(e){return new vs(this.x-e.x,this.y-e.y)}scale(e){return new vs(this.x*e,this.y*e)}mapComponents(e){return new vs(e(this.x),e(this.y))}isZero(){return this.x===0&&this.y===0}withThreshold(e){return this.mapComponents(t=>t>e?t-e:t<-e?t+e:0)}}function $i(n){return Uj.get(n)}const Ip=class Ip extends G{static get(e){let t=Ip._map.get(e);if(!t){t=new Ip(e),Ip._map.set(e,t);const i=e.onDidDispose(()=>{const s=Ip._map.get(e);s&&(Ip._map.delete(e),s.dispose(),i.dispose())})}return t}_beginUpdate(){this._updateCounter++,this._updateCounter===1&&(this._currentTransaction=new YS(()=>{}))}_endUpdate(){if(this._updateCounter--,this._updateCounter===0){const e=this._currentTransaction;this._currentTransaction=void 0,e.finish()}}constructor(e){var t;super(),this.editor=e,this._updateCounter=0,this._currentTransaction=void 0,this._model=Ze(this,this.editor.getModel()),this.model=this._model,this.isReadonly=qt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(104)),this._versionId=Lk({owner:this,lazy:!0},((t=this.editor.getModel())==null?void 0:t.getVersionId())??null),this.versionId=this._versionId,this._selections=Lk({owner:this,equalsFn:nv(lE(Ie.selectionsEqual)),lazy:!0},this.editor.getSelections()??null),this.selections=this._selections,this.positions=so({owner:this,equalsFn:nv(lE(U.equals))},i=>{var s;return((s=this.selections.read(i))==null?void 0:s.map(o=>o.getStartPosition()))??null}),this.isFocused=qt(this,i=>{const s=this.editor.onDidFocusEditorWidget(i),o=this.editor.onDidBlurEditorWidget(i);return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.hasWidgetFocus()),this.isTextFocused=qt(this,i=>{const s=this.editor.onDidFocusEditorText(i),o=this.editor.onDidBlurEditorText(i);return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.hasTextFocus()),this.inComposition=qt(this,i=>{const s=this.editor.onDidCompositionStart(()=>{i(void 0)}),o=this.editor.onDidCompositionEnd(()=>{i(void 0)});return{dispose(){s.dispose(),o.dispose()}}},()=>this.editor.inComposition),this.value=GG(this,i=>{var s;return this.versionId.read(i),((s=this.model.read(i))==null?void 0:s.getValue())??""},(i,s)=>{const o=this.model.get();o!==null&&i!==o.getValue()&&o.setValue(i)}),this.valueIsEmpty=oe(this,i=>{var s;return this.versionId.read(i),((s=this.editor.getModel())==null?void 0:s.getValueLength())===0}),this.cursorSelection=so({owner:this,equalsFn:nv(Ie.selectionsEqual)},i=>{var s;return((s=this.selections.read(i))==null?void 0:s[0])??null}),this.cursorPosition=so({owner:this,equalsFn:U.equals},i=>{var s,o;return((o=(s=this.selections.read(i))==null?void 0:s[0])==null?void 0:o.getPosition())??null}),this.cursorLineNumber=oe(this,i=>{var s;return((s=this.cursorPosition.read(i))==null?void 0:s.lineNumber)??null}),this.onDidType=Vl(this),this.onDidPaste=Vl(this),this.scrollTop=qt(this.editor.onDidScrollChange,()=>this.editor.getScrollTop()),this.scrollLeft=qt(this.editor.onDidScrollChange,()=>this.editor.getScrollLeft()),this.layoutInfo=qt(this.editor.onDidLayoutChange,()=>this.editor.getLayoutInfo()),this.layoutInfoContentLeft=this.layoutInfo.map(i=>i.contentLeft),this.layoutInfoDecorationsLeft=this.layoutInfo.map(i=>i.decorationsLeft),this.layoutInfoWidth=this.layoutInfo.map(i=>i.width),this.layoutInfoHeight=this.layoutInfo.map(i=>i.height),this.layoutInfoMinimap=this.layoutInfo.map(i=>i.minimap),this.layoutInfoVerticalScrollbarWidth=this.layoutInfo.map(i=>i.verticalScrollbarWidth),this.contentWidth=qt(this.editor.onDidContentSizeChange,()=>this.editor.getContentWidth()),this.contentHeight=qt(this.editor.onDidContentSizeChange,()=>this.editor.getContentHeight()),this._widgetCounter=0,this.openedPeekWidgets=Ze(this,0),this._register(this.editor.onBeginUpdate(()=>this._beginUpdate())),this._register(this.editor.onEndUpdate(()=>this._endUpdate())),this._register(this.editor.onDidChangeModel(()=>{this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidType(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidType.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidPaste(i=>{this._beginUpdate();try{this._forceUpdate(),this.onDidPaste.trigger(this._currentTransaction,i)}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeModelContent(i=>{var s;this._beginUpdate();try{this._versionId.set(((s=this.editor.getModel())==null?void 0:s.getVersionId())??null,this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this._register(this.editor.onDidChangeCursorSelection(i=>{this._beginUpdate();try{this._selections.set(this.editor.getSelections(),this._currentTransaction,i),this._forceUpdate()}finally{this._endUpdate()}})),this.domNode=oe(i=>(this.model.read(i),this.editor.getDomNode()))}forceUpdate(e){this._beginUpdate();try{return this._forceUpdate(),e?e(this._currentTransaction):void 0}finally{this._endUpdate()}}_forceUpdate(){var e;this._beginUpdate();try{this._model.set(this.editor.getModel(),this._currentTransaction),this._versionId.set(((e=this.editor.getModel())==null?void 0:e.getVersionId())??null,this._currentTransaction,void 0),this._selections.set(this.editor.getSelections(),this._currentTransaction,void 0)}finally{this._endUpdate()}}getOption(e,t=ds.ofCaller()){return qt(this,i=>this.editor.onDidChangeConfiguration(s=>{s.hasChanged(e)&&i(void 0)}),()=>this.editor.getOption(e),t)}setDecorations(e){const t=new ne,i=this.editor.createDecorationsCollection();return t.add(B5({owner:this,debugName:()=>`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}createOverlayWidget(e){const t="observableOverlayWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow,getMinContentWidthInPx:()=>e.minContentWidthInPx.get()};this.editor.addOverlayWidget(i);const s=qe(o=>{e.position.read(o),e.minContentWidthInPx.read(o),this.editor.layoutOverlayWidget(i)});return Re(()=>{s.dispose(),this.editor.removeOverlayWidget(i)})}createContentWidget(e){const t="observableContentWidget"+this._widgetCounter++,i={getDomNode:()=>e.domNode,getPosition:()=>e.position.get(),getId:()=>t,allowEditorOverflow:e.allowEditorOverflow};this.editor.addContentWidget(i);const s=qe(o=>{e.position.read(o),this.editor.layoutContentWidget(i)});return Re(()=>{s.dispose(),this.editor.removeContentWidget(i)})}observeLineOffsetRange(e,t){const i=this.observePosition(e.map(o=>new U(o.startLineNumber,1)),t),s=this.observePosition(e.map(o=>new U(o.endLineNumberExclusive+1,1)),t);return oe(o=>{var d;i.read(o),s.read(o);const r=e.read(o),a=(d=this.model.read(o))==null?void 0:d.getLineCount(),l=(typeof a<"u"&&r.startLineNumber>a?this.editor.getBottomForLineNumber(a):this.editor.getTopForLineNumber(r.startLineNumber))-this.scrollTop.read(o),c=r.isEmpty?l:this.editor.getBottomForLineNumber(r.endLineNumberExclusive-1)-this.scrollTop.read(o);return new Me(l,c)})}observePosition(e,t){let i=e.get();const s=Lk({owner:this,debugName:()=>`topLeftOfPosition${i==null?void 0:i.toString()}`,equalsFn:nv(vs.equals)},new vs(0,0)),o="observablePositionWidget"+this._widgetCounter++,r=document.createElement("div"),a={getDomNode:()=>r,getPosition:()=>i?{preference:[0],position:e.get()}:null,getId:()=>o,allowEditorOverflow:!1,afterRender:(l,c)=>{const d=this._model.get();d&&i&&i.lineNumber>d.getLineCount()?s.set(new vs(0,this.editor.getBottomForLineNumber(d.getLineCount())-this.scrollTop.get()),void 0):s.set(c?new vs(c.left,c.top):null,void 0)}};return this.editor.addContentWidget(a),t.add(qe(l=>{i=e.read(l),this.editor.layoutContentWidget(a)})),t.add(Re(()=>{this.editor.removeContentWidget(a)})),s}isTargetHovered(e,t){const i=Ze("isInjectedTextHovered",!1);return t.add(this.editor.onMouseMove(s=>{const o=e(s);i.set(o,void 0)})),t.add(this.editor.onMouseLeave(s=>{i.set(!1,void 0)})),i}observeLineHeightForPosition(e){return oe(t=>{const i=e instanceof U?e:e.read(t);return i===null?null:(this.getOption(75).read(t),this.editor.getLineHeightForPosition(i))})}observeLineHeightForLine(e){return typeof e=="number"?this.observeLineHeightForPosition(new U(e,1)):oe(t=>{const i=e.read(t);return i===null?null:this.observeLineHeightForPosition(new U(i,1)).read(t)})}observeLineHeightsForLineRange(e){return oe(t=>{const i=e instanceof Ye?e:e.read(t),s=[];for(let o=i.startLineNumber;o=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kXe=function(n,e){return function(t,i){e(t,i,n)}},gd,Qf;let aN=(Qf=class extends G{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._themeService=a,this.width=gd.ENTIRE_DIFF_OVERVIEW_WIDTH;const l=qt(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),c=oe(u=>{const f=l.read(u),g=f.getColor(C8e)||(f.getColor(av)||GH).transparent(2),p=f.getColor(y8e)||(f.getColor(Qp)||YH).transparent(2);return{insertColor:g,removeColor:p}}),d=Kt(document.createElement("div"));d.setClassName("diffViewport"),d.setPosition("absolute");const h=Ot("div.diffOverview",{style:{position:"absolute",top:"0px",width:gd.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;this._register(b0(h,d.domNode)),this._register(kn(h,_e.POINTER_DOWN,u=>{this._editors.modified.delegateVerticalScrollbarPointerDown(u)})),this._register(J(h,_e.MOUSE_WHEEL,u=>{this._editors.modified.delegateScrollFromMouseWheelEvent(u)},{passive:!1})),this._register(b0(this._rootElement,h)),this._register(ko((u,f)=>{const g=this._diffModel.read(u),p=this._editors.original.createOverviewRuler("original diffOverviewRuler");p&&(f.add(p),f.add(b0(h,p.getDomNode())));const m=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(m&&(f.add(m),f.add(b0(h,m.getDomNode()))),!p||!m)return;const b=ha("viewZoneChanged",this._editors.original.onDidChangeViewZones),v=ha("viewZoneChanged",this._editors.modified.onDidChangeViewZones),w=ha("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),C=ha("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);f.add(qe(S=>{var M;b.read(S),v.read(S),w.read(S),C.read(S);const L=c.read(S),x=(M=g==null?void 0:g.diff.read(S))==null?void 0:M.mappings;function I(A,W,P){const B=P._getViewModel();return B?A.filter(V=>V.length>0).map(V=>{const K=B.coordinatesConverter.convertModelPositionToViewPosition(new U(V.startLineNumber,1)),z=B.coordinatesConverter.convertModelPositionToViewPosition(new U(V.endLineNumberExclusive,1)),j=z.lineNumber-K.lineNumber;return new n_e(K.lineNumber,z.lineNumber,j,W.toString())}):[]}const E=I((x||[]).map(A=>A.lineRangeMapping.original),L.removeColor,this._editors.original),R=I((x||[]).map(A=>A.lineRangeMapping.modified),L.insertColor,this._editors.modified);p==null||p.setZones(E),m==null||m.setZones(R)})),f.add(qe(S=>{const L=this._rootHeight.read(S),x=this._rootWidth.read(S),I=this._modifiedEditorLayoutInfo.read(S);if(I){const E=gd.ENTIRE_DIFF_OVERVIEW_WIDTH-2*gd.ONE_OVERVIEW_WIDTH;p.setLayout({top:0,height:L,right:E+gd.ONE_OVERVIEW_WIDTH,width:gd.ONE_OVERVIEW_WIDTH}),m.setLayout({top:0,height:L,right:0,width:gd.ONE_OVERVIEW_WIDTH});const R=this._editors.modifiedScrollTop.read(S),M=this._editors.modifiedScrollHeight.read(S),A=this._editors.modified.getOption(117),W=new wS(A.verticalHasArrows?A.arrowSize:0,A.verticalScrollbarSize,0,I.height,M,R);d.setTop(W.getSliderPosition()),d.setHeight(W.getSliderSize())}else d.setTop(0),d.setHeight(0);h.style.height=L+"px",h.style.left=x-gd.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",d.setWidth(gd.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}},gd=Qf,Qf.ONE_OVERVIEW_WIDTH=15,Qf.ENTIRE_DIFF_OVERVIEW_WIDTH=Qf.ONE_OVERVIEW_WIDTH*2,Qf);aN=gd=LXe([kXe(6,en)],aN);var IXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W9=function(n,e){return function(t,i){e(t,i,n)}};let qj=class extends G{get onDidContentSizeChange(){return this._onDidContentSizeChange.event}constructor(e,t,i,s,o,r,a,l){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._argCodeEditorWidgetOptions=s,this._createInnerEditor=o,this._contextKeyService=r,this._instantiationService=a,this._keybindingService=l,this.original=this._register(this._createLeftHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(this._options.editorOptions.get(),this._argCodeEditorWidgetOptions.modifiedEditor||{})),this._onDidContentSizeChange=this._register(new q),this.modifiedScrollTop=qt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollTop()),this.modifiedScrollHeight=qt(this,this.modified.onDidScrollChange,()=>this.modified.getScrollHeight()),this.modifiedObs=$i(this.modified),this.originalObs=$i(this.original),this.modifiedModel=this.modifiedObs.model,this.modifiedSelections=qt(this,this.modified.onDidChangeCursorSelection,()=>this.modified.getSelections()??[]),this.modifiedCursor=so({owner:this,equalsFn:U.equals},c=>{var d;return((d=this.modifiedSelections.read(c)[0])==null?void 0:d.getPosition())??new U(1,1)}),this.originalCursor=qt(this,this.original.onDidChangeCursorPosition,()=>this.original.getPosition()??new U(1,1)),this.isOriginalFocused=$i(this.original).isFocused,this.isModifiedFocused=$i(this.modified).isFocused,this.isFocused=oe(this,c=>this.isOriginalFocused.read(c)||this.isModifiedFocused.read(c)),this._argCodeEditorWidgetOptions=null,this._register(GS({changeTracker:{createChangeSummary:()=>({}),handleChange:(c,d)=>(c.didChange(i.editorOptions)&&Object.assign(d,c.change.changedOptions),!0)}},(c,d)=>{i.editorOptions.read(c),this._options.renderSideBySide.read(c),this.modified.updateOptions(this._adjustOptionsForRightHandSide(c,d)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(c,d))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffLeftEditor",s.hasWidgetFocus());return this._register(s.onDidFocusEditorWidget(()=>o.set(!0))),this._register(s.onDidBlurEditorWidget(()=>o.set(!1))),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t),o=this._contextKeyService.createKey("isInDiffRightEditor",s.hasWidgetFocus());return this._register(s.onDidFocusEditorWidget(()=>o.set(!0))),this._register(s.onDidBlurEditorWidget(()=>o.set(!1))),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+aN.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),i.glyphMargin=this._options.renderSideBySide.get(),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=jo.revealHorizontalRightPadding.defaultValue+aN.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t={...e,dimension:{height:0,width:0}};return t.inDiffEditor=!0,t.automaticLayout=!1,t.allowVariableLineHeights=!1,t.allowVariableFonts=!1,t.allowVariableFontsInAccessibilityMode=!1,t.scrollbar={...t.scrollbar||{}},t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap={...t.minimap||{}},t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var i;e||(e="");const t=_(111," use {0} to open the accessibility help.",(i=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))==null?void 0:i.getAriaLabel());return this._options.accessibilityVerbose.get()?e+t:e?e.replaceAll(t,""):""}};qj=IXe([W9(5,Xe),W9(6,Ae),W9(7,Vt)],qj);class EXe{resetSash(){this._sashRatio.set(void 0,void 0)}constructor(e,t){this._options=e,this.dimensions=t,this.sashLeft=GG(this,i=>{const s=this._sashRatio.read(i)??this._options.splitViewDefaultRatio.read(i);return this._computeSashLeft(s,i)},(i,s)=>{const o=this.dimensions.width.get();this._sashRatio.set(i/o,s)}),this._sashRatio=Ze(this,void 0)}_computeSashLeft(e,t){const i=this.dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class l1e extends G{constructor(e,t,i,s,o,r){super(),this._domNode=e,this._dimensions=t,this._enabled=i,this._boundarySashes=s,this.sashLeft=o,this._resetSash=r,this._sash=this._register(new _o(this._domNode,{getVerticalSashTop:a=>0,getVerticalSashLeft:a=>this.sashLeft.get(),getVerticalSashHeight:a=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(a=>{this.sashLeft.set(this._startSashPosition+(a.currentX-a.startX),void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._resetSash())),this._register(qe(a=>{const l=this._boundarySashes.read(a);l&&(this._sash.orthogonalEndSash=l.bottom)})),this._register(qe(a=>{const l=this._enabled.read(a);this._sash.state=l?3:0,this.sashLeft.read(a),this._dimensions.height.read(a),this._sash.layout()}))}}const oF=class oF extends G{constructor(){super(...arguments),this._id=++oF.idCounter,this._onDidDispose=this._register(new q),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}};oF.idCounter=0;let Kj=oF;function NXe(n,e){return Hg(n,(t,i)=>i??e(t))}var DXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},TXe=function(n,e){return function(t,i){e(t,i,n)}};let Gj=class{get editorOptions(){return this._options}constructor(e,t){this._accessibilityService=t,this._diffEditorWidth=Ze(this,0),this._screenReaderMode=qt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this.couldShowInlineViewBecauseOfSize=oe(this,s=>this._options.read(s).renderSideBySide&&this._diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=oe(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=oe(this,s=>this.compactMode.read(s)&&this.shouldRenderInlineViewInSmartMode.read(s)?!1:this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s)&&!this._screenReaderMode.read(s))),this.readOnly=oe(this,s=>this._options.read(s).readOnly),this.shouldRenderOldRevertArrows=oe(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s)||this.shouldRenderGutterMenu.read(s))),this.shouldRenderGutterMenu=oe(this,s=>this._options.read(s).renderGutterMenu),this.renderIndicators=oe(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=oe(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=oe(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=oe(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=oe(this,s=>this._options.read(s).maxComputationTime),this.showMoves=oe(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=oe(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=oe(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=oe(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=oe(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=oe(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=oe(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=oe(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=oe(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.compactMode=oe(this,s=>this._options.read(s).compactMode),this.trueInlineDiffRenderingEnabled=oe(this,s=>this._options.read(s).experimental.useTrueInlineView),this.useTrueInlineDiffRendering=oe(this,s=>!this.renderSideBySide.read(s)&&this.trueInlineDiffRenderingEnabled.read(s)),this.hideUnchangedRegions=oe(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=oe(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount),this._model=Ze(this,void 0),this.shouldRenderInlineViewInSmartMode=this._model.map(this,s=>NXe(this,o=>{const r=s==null?void 0:s.diff.read(o);return r?RXe(r,this.trueInlineDiffRenderingEnabled.read(o)):void 0})).flatten().map(this,s=>!!s),this.inlineViewHideOriginalLineNumbers=this.compactMode;const i={...e,...zre(e,Zs)};this._options=Ze(this,i)}updateOptions(e){const t=zre(e,this._options.get()),i={...this._options.get(),...e,...t};this._options.set(i,void 0,{changedOptions:e})}setWidth(e){this._diffEditorWidth.set(e,void 0)}setModel(e){this._model.set(e,void 0)}};Gj=DXe([TXe(1,Us)],Gj);function RXe(n,e){return n.mappings.every(t=>MXe(t.lineRangeMapping)||AXe(t.lineRangeMapping)||e&&cX(t.lineRangeMapping))}function MXe(n){return n.original.length===0}function AXe(n){return n.modified.length===0}function zre(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:Fe(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:dAe(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:Fe(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:Fe(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:Lf(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:Lf(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:Fe(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:Fe(n.renderIndicators,e.renderIndicators),originalEditable:Fe(n.originalEditable,e.originalEditable),diffCodeLens:Fe(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:Fe(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Ei(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Ei(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:Fe(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:Fe((t=n.experimental)==null?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:Fe((i=n.experimental)==null?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations),useTrueInlineView:Fe((s=n.experimental)==null?void 0:s.useTrueInlineView,e.experimental.useTrueInlineView)},hideUnchangedRegions:{enabled:Fe(((o=n.hideUnchangedRegions)==null?void 0:o.enabled)??((r=n.experimental)==null?void 0:r.collapseUnchangedRegions),e.hideUnchangedRegions.enabled),contextLineCount:Lf((a=n.hideUnchangedRegions)==null?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:Lf((l=n.hideUnchangedRegions)==null?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:Lf((c=n.hideUnchangedRegions)==null?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:Fe(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:Fe(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:Lf(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:Fe(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited),renderGutterMenu:Fe(n.renderGutterMenu,e.renderGutterMenu),compactMode:Fe(n.compactMode,e.compactMode)}}const jre=24;class PXe extends G{get onDidChangeDropdownVisibility(){return this._onDidChangeDropdownVisibility.event}constructor(e,t,i={orientation:0}){if(super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new iAe),this.originalPrimaryActions=[],this.originalSecondaryActions=[],this.hiddenActions=[],this.disposables=this._register(new ne),i.hoverDelegate=i.hoverDelegate??this._register(Kbe()),this.options=i,this.toggleMenuAction=this._register(new lN(()=>{var s;return(s=this.toggleMenuActionViewItem)==null?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new jr(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,hoverDelegate:i.hoverDelegate,actionViewItemProvider:(s,o)=>{if(s.id===lN.ID)return this.toggleMenuActionViewItem=new wP(s,{getActions:()=>this.toggleMenuAction.menuActions},t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:$e.asClassNameArray(i.moreIcon??de.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,isMenu:!0,hoverDelegate:this.options.hoverDelegate}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const r=i.actionViewItemProvider(s,o);if(r)return r}if(s instanceof cS){const r=new wP(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry,hoverDelegate:this.options.hoverDelegate});return r.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(r),this.disposables.add(this._onDidChangeDropdownVisibility.add(r.onDidChangeVisibility)),r}}})),this.options.responsive){this.element.classList.add("responsive");const s=new ResizeObserver(()=>{this.setToolbarMaxWidth(this.element.getBoundingClientRect().width)});s.observe(this.element),this._store.add(Re(()=>s.disconnect()))}}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}set context(e){var t;this.actionBar.context=e,(t=this.toggleMenuActionViewItem)==null||t.setActionContext(e);for(const i of this.submenuActionViewItems)i.setActionContext(e)}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}getItemWidth(e){return this.actionBar.getWidth(e)}setActions(e,t){this.clear(),this.originalPrimaryActions=e?e.slice(0):[],this.originalSecondaryActions=t?t.slice(0):[];const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.length>0&&this.options.trailingSeparator&&i.push(new Zn),i.forEach(s=>{this.actionBar.push(s,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(s)})}),this.options.responsive&&(this.hiddenActions.length=0,this.setToolbarMaxWidth(this.element.getBoundingClientRect().width))}getKeybindingLabel(e){var i,s;const t=(s=(i=this.options).getKeyBinding)==null?void 0:s.call(i,e);return(t==null?void 0:t.getLabel())??void 0}getItemsWidthResponsive(){return this.actionBar.length()*jre}setToolbarMaxWidth(e){if(this.actionBar.isEmpty()||this.getItemsWidthResponsive()<=e&&this.hiddenActions.length===0)return;if(this.getItemsWidthResponsive()>e)for(;this.getItemsWidthResponsive()>e&&this.actionBar.length()>0;){const i=this.originalPrimaryActions.length-this.hiddenActions.length-1;if(i<0)break;const s=Math.min(jre,this.getItemWidth(i)),o=this.originalPrimaryActions[i];this.hiddenActions.unshift({action:o,size:s}),this.actionBar.pull(i),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&this.actionBar.push(this.toggleMenuAction,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(this.toggleMenuAction)})}else for(;this.hiddenActions.length>0;){const i=this.hiddenActions.shift();if(this.getItemsWidthResponsive()+i.size>e){this.hiddenActions.unshift(i);break}this.actionBar.push(i.action,{icon:this.options.icon??!0,label:this.options.label??!1,keybinding:this.getKeybindingLabel(i.action),index:this.originalPrimaryActions.length-this.hiddenActions.length-1}),this.originalSecondaryActions.length===0&&this.hiddenActions.length===1&&(this.toggleMenuAction.menuActions=[],this.actionBar.pull(this.actionBar.length()-1))}const t=this.hiddenActions.map(i=>i.action);if(this.originalSecondaryActions.length>0||t.length>0){const i=this.originalSecondaryActions.slice(0);this.toggleMenuAction.menuActions=Zn.join(t,i)}}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}const rF=class rF extends ol{constructor(e,t){t=t||_(17,"More Actions..."),super(rF.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}async run(){this.toggleDropdownMenu()}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}};rF.ID="toolbar.toggle.more";let lN=rF;const c1e=mt("IActionViewItemService");class OXe{constructor(){this._providers=new Map,this._onDidChange=new q,this.onDidChange=this._onDidChange.event}dispose(){this._onDidChange.dispose()}lookUp(e,t){return this._providers.get(this._makeKey(e,t))}_makeKey(e,t){return`${e.id}/${t instanceof Te?t.id:t}`}}Lt(c1e,OXe,1);var d1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ua=function(n,e){return function(t,i){e(t,i,n)}};let YP=class extends PXe{constructor(e,t,i,s,o,r,a,l){super(e,o,{getKeyBinding:d=>r.lookupKeybinding(d.id)??void 0,...t,allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"}),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._keybindingService=r,this._commandService=a,this._sessionDisposables=this._store.add(new ne);const c=t==null?void 0:t.telemetrySource;c&&this._store.add(this.actionBar.onDidRun(d=>l.publicLog2("workbenchActionExecuted",{id:d.action.id,from:c})))}setActions(e,t=[],i){var d,h,u;this._sessionDisposables.clear();const s=e.slice(),o=t.slice(),r=[];let a=0;const l=[];let c=!1;if(((d=this._options)==null?void 0:d.hiddenItemStrategy)!==-1)for(let f=0;fm==null?void 0:m.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let m=0;m=g&&(s[m]=void 0,l[m]=b))}}Ote(s),Ote(l),super.setActions(s,Zn.join(l,o)),(r.length>0||s.length>0)&&this._sessionDisposables.add(J(this.getElement(),"contextmenu",f=>{var v,w,C,S,L;const g=new lo(Pe(this.getElement()),f),p=this.getItemAction(g.target);if(!p)return;g.preventDefault(),g.stopPropagation();const m=[];if(p instanceof rl&&p.menuKeybinding)m.push(p.menuKeybinding);else if(!(p instanceof kv||p instanceof lN)){const x=!!this._keybindingService.lookupKeybinding(p.id);m.push(Jve(this._commandService,this._keybindingService,p.id,void 0,x))}if(r.length>0){let x=!1;if(a===1&&((v=this._options)==null?void 0:v.hiddenItemStrategy)===0){x=!0;for(let I=0;Ithis._menuService.resetHiddenStates(i)}))),b.length!==0&&this._contextMenuService.showContextMenu({getAnchor:()=>g,getActions:()=>b,menuId:(C=this._options)==null?void 0:C.contextMenu,menuActionOptions:{renderShortTitle:!0,...(S=this._options)==null?void 0:S.menuOptions},skipTelemetry:typeof((L=this._options)==null?void 0:L.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};YP=d1e([Ua(2,lc),Ua(3,Xe),Ua(4,gl),Ua(5,Vt),Ua(6,ki),Ua(7,To)],YP);let cN=class extends YP{get onDidChangeMenuItems(){return this._onDidChangeMenuItems.event}constructor(e,t,i,s,o,r,a,l,c,d,h){super(e,{resetMenu:t,...i,actionViewItemProvider:(g,p)=>{let m=d.lookUp(t,g instanceof kv?g.item.submenu.id:g.id);m||(m=i==null?void 0:i.actionViewItemProvider);const b=m==null?void 0:m(g,p,h,Pe(e).vscodeWindowId);return b||MZ(h,g,p)}},s,o,r,a,l,c),this._onDidChangeMenuItems=this._store.add(new q);const u=this._store.add(s.createMenu(t,o,{emitEventsForSubmenuChanges:!0,eventDebounceDelay:i==null?void 0:i.eventDebounceDelay})),f=()=>{var m,b,v;const{primary:g,secondary:p}=sve(u.getActions(i==null?void 0:i.menuOptions),(m=i==null?void 0:i.toolbarOptions)==null?void 0:m.primaryGroup,(b=i==null?void 0:i.toolbarOptions)==null?void 0:b.shouldInlineSubmenu,(v=i==null?void 0:i.toolbarOptions)==null?void 0:v.useSeparatorsInPrimaryActions);e.classList.toggle("has-no-actions",g.length===0&&p.length===0),super.setActions(g,p)};this._store.add(u.onDidChange(()=>{f(),this._onDidChangeMenuItems.fire(this)})),this._store.add(d.onDidChange(g=>{g===t&&f()})),f()}setActions(){throw new Ve("This toolbar is populated from a menu.")}};cN=d1e([Ua(3,lc),Ua(4,Xe),Ua(5,gl),Ua(6,Vt),Ua(7,ki),Ua(8,To),Ua(9,c1e),Ua(10,Ae)],cN);class fw extends cY{constructor(e){super(),this._textModel=e}getValueOfRange(e){return this._textModel.getValueInRange(e)}getLineLength(e){return this._textModel.getLineLength(e)}get length(){const e=this._textModel.getLineCount(),t=this._textModel.getLineLength(e);return new ls(e-1,t)}}class h1e extends J1{constructor(e){super(),this._getContext=e}runAction(e,t){const i=this._getContext();return super.runAction(e,i)}}class FXe extends G{constructor(e,t,i){super(),this._editor=e,this._domNode=t,this.itemProvider=i,this.scrollTop=qt(this,this._editor.onDidScrollChange,r=>this._editor.getScrollTop()),this.isScrollTopZero=this.scrollTop.map(r=>r===0),this.modelAttached=qt(this,this._editor.onDidChangeModel,r=>this._editor.hasModel()),this.editorOnDidChangeViewZones=ha("onDidChangeViewZones",this._editor.onDidChangeViewZones),this.editorOnDidContentSizeChange=ha("onDidContentSizeChange",this._editor.onDidContentSizeChange),this.domNodeSizeChanged=Vl("domNodeSizeChanged"),this.views=new Map,this._domNode.className="gutter monaco-editor";const s=this._domNode.appendChild(Ot("div.scroll-decoration",{role:"presentation",ariaHidden:"true",style:{width:"100%"}}).root),o=new ResizeObserver(()=>{vi(r=>{this.domNodeSizeChanged.trigger(r)})});o.observe(this._domNode),this._register(Re(()=>o.disconnect())),this._register(qe(r=>{s.className=this.isScrollTopZero.read(r)?"":"scroll-decoration"})),this._register(qe(r=>this.render(r)))}dispose(){super.dispose(),Ss(this._domNode)}render(e){if(!this.modelAttached.read(e))return;this.domNodeSizeChanged.read(e),this.editorOnDidChangeViewZones.read(e),this.editorOnDidContentSizeChange.read(e);const t=this.scrollTop.read(e),i=this._editor.getVisibleRanges(),s=new Set(this.views.keys()),o=Me.ofStartAndLength(0,this._domNode.clientHeight);if(!o.isEmpty)for(const r of i){const a=new Ye(r.startLineNumber,r.endLineNumber+1),l=this.itemProvider.getIntersectingGutterItems(a,e);vi(c=>{for(const d of l){if(!d.range.intersect(a))continue;s.delete(d.id);let h=this.views.get(d.id);if(h)h.item.set(d,c);else{const p=document.createElement("div");this._domNode.appendChild(p);const m=Ze("item",d),b=this.itemProvider.createView(m,p);h=new BXe(m,b,p),this.views.set(d.id,h)}const u=d.range.startLineNumber<=this._editor.getModel().getLineCount()?this._editor.getTopForLineNumber(d.range.startLineNumber,!0)-t:d.range.startLineNumber>1?this._editor.getBottomForLineNumber(d.range.startLineNumber-1,!1)-t:0,g=(d.range.endLineNumberExclusive===1?Math.max(u,this._editor.getTopForLineNumber(d.range.startLineNumber,!1)-t):Math.max(u,this._editor.getBottomForLineNumber(d.range.endLineNumberExclusive-1,!0)-t))-u;h.domNode.style.top=`${u}px`,h.domNode.style.height=`${g}px`,h.gutterItemView.layout(Me.ofStartAndLength(u,g),o)}})}for(const r of s){const a=this.views.get(r);a.gutterItemView.dispose(),a.domNode.remove(),this.views.delete(r)}}}class BXe{constructor(e,t,i){this.item=e,this.gutterItemView=t,this.domNode=i}}var u1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},QR=function(n,e){return function(t,i){e(t,i,n)}};const H9=[],k2=35;let Yj=class extends G{constructor(e,t,i,s,o,r,a,l,c){super(),this._diffModel=t,this._editors=i,this._options=s,this._sashLayout=o,this._boundarySashes=r,this._instantiationService=a,this._contextKeyService=l,this._menuService=c,this._menu=this._register(this._menuService.createMenu(Te.DiffEditorHunkToolbar,this._contextKeyService)),this._actions=qt(this,this._menu.onDidChange,()=>this._menu.getActions()),this._hasActions=this._actions.map(h=>h.length>0),this._showSash=oe(this,h=>this._options.renderSideBySide.read(h)&&this._hasActions.read(h)),this.width=oe(this,h=>this._hasActions.read(h)?k2:0),this.elements=Ot("div.gutter@gutter",{style:{position:"absolute",height:"100%",width:k2+"px"}},[]),this._currentDiff=oe(this,h=>{var p;const u=this._diffModel.read(h);if(!u)return;const f=(p=u.diff.read(h))==null?void 0:p.mappings,g=this._editors.modifiedCursor.read(h);if(g)return f==null?void 0:f.find(m=>m.lineRangeMapping.modified.contains(g.lineNumber))}),this._selectedDiffs=oe(this,h=>{const u=this._diffModel.read(h),f=u==null?void 0:u.diff.read(h);if(!f)return H9;const g=this._editors.modifiedSelections.read(h);if(g.every(v=>v.isEmpty()))return H9;const p=new Hl(g.map(v=>Ye.fromRangeInclusive(v))),b=f.mappings.filter(v=>v.lineRangeMapping.innerChanges&&p.intersects(v.lineRangeMapping.modified)).map(v=>({mapping:v,rangeMappings:v.lineRangeMapping.innerChanges.filter(w=>g.some(C=>D.areIntersecting(w.modifiedRange,C)))}));return b.length===0||b.every(v=>v.rangeMappings.length===0)?H9:b}),this._register(GZe(e,this.elements.root)),this._register(J(this.elements.root,"click",()=>{this._editors.modified.focus()})),this._register(c_(this.elements.root,{display:this._hasActions.map(h=>h?"block":"none")})),Nl(this,h=>this._showSash.read(h)?new l1e(e,this._sashLayout.dimensions,this._options.enableSplitViewResizing,this._boundarySashes,GG(this,f=>this._sashLayout.sashLeft.read(f)-k2,(f,g)=>this._sashLayout.sashLeft.set(f+k2,g)),()=>this._sashLayout.resetSash()):void 0).recomputeInitiallyAndOnChange(this._store);const d=oe(this,h=>{const u=this._diffModel.read(h);if(!u)return[];const f=u.diff.read(h);if(!f)return[];const g=this._selectedDiffs.read(h);if(g.length>0){const m=cl.fromRangeMappings(g.flatMap(b=>b.rangeMappings));return[new $re(m,!0,Te.DiffEditorSelectionToolbar,void 0,u.model.original.uri,u.model.modified.uri)]}const p=this._currentDiff.read(h);return f.mappings.map(m=>new $re(m.lineRangeMapping.withInnerChangesFromLineRanges(),m.lineRangeMapping===(p==null?void 0:p.lineRangeMapping),Te.DiffEditorHunkToolbar,void 0,u.model.original.uri,u.model.modified.uri))});this._register(new FXe(this._editors.modified,this.elements.root,{getIntersectingGutterItems:(h,u)=>d.read(u),createView:(h,u)=>this._instantiationService.createInstance(Zj,h,u,this)})),this._register(J(this.elements.gutter,_e.MOUSE_WHEEL,h=>{this._editors.modified.getOption(117).handleMouseWheel&&this._editors.modified.delegateScrollFromMouseWheelEvent(h)},{passive:!1}))}computeStagedValue(e){const t=e.innerChanges??[],i=new fw(this._editors.modifiedModel.get()),s=new fw(this._editors.original.getModel());return new ga(t.map(a=>a.toTextEdit(i))).apply(s)}layout(e){this.elements.gutter.style.left=e+"px"}};Yj=u1e([QR(6,Ae),QR(7,Xe),QR(8,lc)],Yj);class $re{constructor(e,t,i,s,o,r){this.mapping=e,this.showAlways=t,this.menuId=i,this.rangeOverride=s,this.originalUri=o,this.modifiedUri=r}get id(){return this.mapping.modified.toString()}get range(){return this.rangeOverride??this.mapping.modified}}let Zj=class extends G{constructor(e,t,i,s){super(),this._item=e,this._elements=Ot("div.gutterItem",{style:{height:"20px",width:"34px"}},[Ot("div.background@background",{},[]),Ot("div.buttons@buttons",{},[])]),this._showAlways=this._item.map(this,r=>r.showAlways),this._menuId=this._item.map(this,r=>r.menuId),this._isSmall=Ze(this,!1),this._lastItemRange=void 0,this._lastViewRange=void 0;const o=this._register(s.createInstance(CS,"element",{instantHover:!0},{position:{hoverPosition:1}}));this._register(b0(t,this._elements.root)),this._register(qe(r=>{const a=this._showAlways.read(r);this._elements.root.classList.toggle("noTransition",!0),this._elements.root.classList.toggle("showAlways",a),setTimeout(()=>{this._elements.root.classList.toggle("noTransition",!1)},0)})),this._register(ko((r,a)=>{this._elements.buttons.replaceChildren();const l=a.add(s.createInstance(cN,this._elements.buttons,this._menuId.read(r),{orientation:1,hoverDelegate:o,toolbarOptions:{primaryGroup:c=>c.startsWith("primary")},overflowBehavior:{maxItems:this._isSmall.read(r)?1:3},hiddenItemStrategy:0,actionRunner:a.add(new h1e(()=>{const c=this._item.read(void 0),d=c.mapping;return{mapping:d,originalWithModifiedChanges:i.computeStagedValue(d),originalUri:c.originalUri,modifiedUri:c.modifiedUri}})),menuOptions:{shouldForwardArgs:!0}}));a.add(l.onDidChangeMenuItems(()=>{this._lastItemRange&&this.layout(this._lastItemRange,this._lastViewRange)}))}))}layout(e,t){this._lastItemRange=e,this._lastViewRange=t;let i=this._elements.buttons.clientHeight;this._isSmall.set(this._item.get().mapping.original.startLineNumber===1&&e.length<30,void 0),i=this._elements.buttons.clientHeight;const s=e.length/2-i/2,o=i;let r=e.start+s;const a=Me.tryCreate(o,t.endExclusive-o-i),l=Me.tryCreate(e.start+o,e.endExclusive-i-o);l&&a&&l.start=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},HXe=function(n,e){return function(t,i){e(t,i,n)}},Xj,Rm;let ZP=(Rm=class extends G{static setBreadcrumbsSourceFactory(e){this._breadcrumbsSourceFactory.set(e,void 0)}get isUpdatingHiddenAreas(){return this._isUpdatingHiddenAreas}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._instantiationService=s,this._modifiedOutlineSource=Nl(this,l=>{const c=this._editors.modifiedModel.read(l),d=Xj._breadcrumbsSourceFactory.read(l);return!c||!d?void 0:d(c,this._instantiationService)}),this._isUpdatingHiddenAreas=!1,this._register(this._editors.original.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();vi(d=>{for(const h of this._editors.original.getSelections()||[])c==null||c.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,0,d)})})),this._register(this._editors.modified.onDidChangeCursorPosition(l=>{if(l.reason===1)return;const c=this._diffModel.get();vi(d=>{for(const h of this._editors.modified.getSelections()||[])c==null||c.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,0,d),c==null||c.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,0,d)})}));const o=this._diffModel.map((l,c)=>{var h;const d=(l==null?void 0:l.unchangedRegions.read(c))??[];return d.length===1&&d[0].modifiedLineNumber===1&&d[0].lineCount===((h=this._editors.modifiedModel.read(c))==null?void 0:h.getLineCount())?[]:d});this.viewZones=oe(this,l=>{const c=this._modifiedOutlineSource.read(l);if(!c)return{origViewZones:[],modViewZones:[]};const d=[],h=[],u=this._options.renderSideBySide.read(l),f=this._options.compactMode.read(l),g=o.read(l);for(let p=0;pm.getHiddenOriginalRange(w).startLineNumber-1),v=new v0(b,12);d.push(v),l.store.add(new Ure(this._editors.original,v,m,!u))}{const b=oe(this,w=>m.getHiddenModifiedRange(w).startLineNumber-1),v=new v0(b,12);h.push(v),l.store.add(new Ure(this._editors.modified,v,m))}}else{{const b=oe(this,w=>m.getHiddenOriginalRange(w).startLineNumber-1),v=new v0(b,24);d.push(v),l.store.add(new qre(this._editors.original,v,m,m.originalUnchangedRange,!u,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}{const b=oe(this,w=>m.getHiddenModifiedRange(w).startLineNumber-1),v=new v0(b,24);h.push(v),l.store.add(new qre(this._editors.modified,v,m,m.modifiedUnchangedRange,!1,c,w=>this._diffModel.get().ensureModifiedLineIsVisible(w,2,void 0),this._options))}}}return{origViewZones:d,modViewZones:h}});const r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Co(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(_(124,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+$e.asClassName(de.fold),zIndex:10001};this._register(UP(this._editors.original,oe(this,l=>{const c=o.read(l),d=c.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:D.fromPositions(new U(h.originalLineNumber,1)),options:a});return d}))),this._register(UP(this._editors.modified,oe(this,l=>{const c=o.read(l),d=c.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:r}));for(const h of c)h.shouldHideControls(l)&&d.push({range:Ye.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:a});return d}))),this._register(qe(l=>{const c=o.read(l);this._isUpdatingHiddenAreas=!0;try{this._editors.original.setHiddenAreas(c.map(d=>d.getHiddenOriginalRange(l).toInclusiveRange()).filter(Ts)),this._editors.modified.setHiddenAreas(c.map(d=>d.getHiddenModifiedRange(l).toInclusiveRange()).filter(Ts))}finally{this._isUpdatingHiddenAreas=!1}})),this._register(this._editors.modified.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(f=>f.modifiedUnchangedRange.contains(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(l=>{var c;if(!l.event.rightButton&&l.target.position&&((c=l.target.element)!=null&&c.className.includes("fold-unchanged"))){const d=l.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const u=h.unchangedRegions.get().find(f=>f.originalUnchangedRange.contains(d));if(!u)return;u.collapseAll(void 0),l.event.stopPropagation(),l.event.preventDefault()}}))}},Xj=Rm,Rm._breadcrumbsSourceFactory=Ze(Rm,()=>({dispose(){},getBreadcrumbItems(e,t){return[]}})),Rm);ZP=Xj=WXe([HXe(3,Ae)],ZP);class Ure extends oX{constructor(e,t,i,s=!1){const o=Ot("div.diff-hidden-lines-widget");super(e,t,o.root),this._unchangedRegion=i,this._hide=s,this._nodes=Ot("div.diff-hidden-lines-compact",[Ot("div.line-left",[]),Ot("div.text@text",[]),Ot("div.line-right",[])]),o.root.appendChild(this._nodes.root),this._hide&&this._nodes.root.replaceChildren(),this._register(qe(r=>{if(!this._hide){const a=this._unchangedRegion.getHiddenModifiedRange(r).length,l=_(125,"{0} hidden lines",a);this._nodes.text.innerText=l}}))}}class qre extends oX{constructor(e,t,i,s,o,r,a,l){const c=Ot("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this._hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=Ot("div.diff-hidden-lines",[Ot("div.top@top",{title:_(126,"Click or drag to show more above")}),Ot("div.center@content",{style:{display:"flex"}},[Ot("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[me("a",{title:_(127,"Show Unchanged Region"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...xm("$(unfold)"))]),Ot("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Ot("div.bottom@bottom",{title:_(128,"Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root),this._hide?Ss(this._nodes.first):this._register(c_(this._nodes.first,{width:$i(this._editor).layoutInfoContentLeft})),this._register(qe(h=>{const u=this._unchangedRegion.visibleLineCountTop.read(h)+this._unchangedRegion.visibleLineCountBottom.read(h)===this._unchangedRegion.lineCount;this._nodes.bottom.classList.toggle("canMoveTop",!u),this._nodes.bottom.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0),this._nodes.top.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),this._nodes.top.classList.toggle("canMoveBottom",!u);const f=this._unchangedRegion.isDragged.read(h),g=this._editor.getDomNode();g&&(g.classList.toggle("draggingUnchangedRegion",!!f),f==="top"?(g.classList.toggle("canMoveTop",this._unchangedRegion.visibleLineCountTop.read(h)>0),g.classList.toggle("canMoveBottom",!u)):f==="bottom"?(g.classList.toggle("canMoveTop",!u),g.classList.toggle("canMoveBottom",this._unchangedRegion.visibleLineCountBottom.read(h)>0)):(g.classList.toggle("canMoveTop",!1),g.classList.toggle("canMoveBottom",!1)))}));const d=this._editor;this._register(J(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set("top",void 0);const p=Pe(this._nodes.top),m=J(p,"mousemove",v=>{const C=v.clientY-u;f=f||Math.abs(C)>2;const S=Math.round(C/d.getOption(75)),L=Math.max(0,Math.min(g+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),b=J(p,"mouseup",v=>{f||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(void 0,void 0),m.dispose(),b.dispose()})})),this._register(J(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const u=h.clientY;let f=!1;const g=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set("bottom",void 0);const p=Pe(this._nodes.bottom),m=J(p,"mousemove",v=>{const C=v.clientY-u;f=f||Math.abs(C)>2;const S=Math.round(C/d.getOption(75)),L=Math.max(0,Math.min(g-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const I=this._unchangedRegionRange.endLineNumberExclusive>d.getModel().getLineCount()?d.getContentHeight():d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(I-x))}),b=J(p,"mouseup",v=>{if(this._unchangedRegion.isDragged.set(void 0,void 0),!f){const w=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const C=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(C-w))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),m.dispose(),b.dispose()})})),this._register(qe(h=>{const u=[];if(!this._hide){const f=i.getHiddenModifiedRange(h).length,g=_(129,"{0} hidden lines",f),p=me("span",{title:_(130,"Double click to unfold")},g);p.addEventListener("dblclick",v=>{v.button===0&&(v.preventDefault(),this._unchangedRegion.showAll(void 0))}),u.push(p);const m=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(m,h);if(b.length>0){u.push(me("span",void 0,"  |  "));for(let v=0;v{this._revealModifiedHiddenLine(w.startLineNumber)}}}}Ss(this._nodes.others,...u)}))}}const V9=[];class VXe extends G{constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._widget=s,this._selectedDiffs=oe(this,o=>{const r=this._diffModel.read(o),a=r==null?void 0:r.diff.read(o);if(!a)return V9;const l=this._editors.modifiedSelections.read(o);if(l.every(u=>u.isEmpty()))return V9;const c=new Hl(l.map(u=>Ye.fromRangeInclusive(u))),h=a.mappings.filter(u=>u.lineRangeMapping.innerChanges&&c.intersects(u.lineRangeMapping.modified)).map(u=>({mapping:u,rangeMappings:u.lineRangeMapping.innerChanges.filter(f=>l.some(g=>D.areIntersecting(f.modifiedRange,g)))}));return h.length===0||h.every(u=>u.rangeMappings.length===0)?V9:h}),this._register(ko((o,r)=>{if(!this._options.shouldRenderOldRevertArrows.read(o))return;const a=this._diffModel.read(o),l=a==null?void 0:a.diff.read(o);if(!a||!l||a.movedTextToCompare.read(o))return;const c=[],d=this._selectedDiffs.read(o),h=new Set(d.map(u=>u.mapping));if(d.length>0){const u=this._editors.modifiedSelections.read(o),f=r.add(new XP(u[u.length-1].positionLineNumber,this._widget,d.flatMap(g=>g.rangeMappings),!0));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}for(const u of l.mappings)if(!h.has(u)&&!u.lineRangeMapping.modified.isEmpty&&u.lineRangeMapping.innerChanges){const f=r.add(new XP(u.lineRangeMapping.modified.startLineNumber,this._widget,u.lineRangeMapping,!1));this._editors.modified.addGlyphMarginWidget(f),c.push(f)}r.add(Re(()=>{for(const u of c)this._editors.modified.removeGlyphMarginWidget(u)}))}))}}const aF=class aF extends G{getId(){return this._id}constructor(e,t,i,s){super(),this._lineNumber=e,this._widget=t,this._diffs=i,this._revertSelection=s,this._id=`revertButton${aF.counter++}`,this._domNode=Ot("div.revertButton",{title:this._revertSelection?_(135,"Revert Selected Changes"):_(136,"Revert Change")},[ih(de.arrowRight)]).root,this._register(J(this._domNode,_e.MOUSE_DOWN,o=>{o.button!==2&&(o.stopPropagation(),o.preventDefault())})),this._register(J(this._domNode,_e.MOUSE_UP,o=>{o.stopPropagation(),o.preventDefault()})),this._register(J(this._domNode,_e.CLICK,o=>{this._diffs instanceof Uo?this._widget.revert(this._diffs):this._widget.revertRangeMappings(this._diffs),o.stopPropagation(),o.preventDefault()}))}getDomNode(){return this._domNode}getPosition(){return{lane:Qd.Right,range:{startColumn:1,startLineNumber:this._lineNumber,endColumn:1,endLineNumber:this._lineNumber},zIndex:10001}}};aF.counter=0;let XP=aF;var zXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cL=function(n,e){return function(t,i){e(t,i,n)}};let Eu=class extends Kj{get onDidContentSizeChange(){return this._editors.onDidContentSizeChange}constructor(e,t,i,s,o,r,a,l){super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._codeEditorService=r,this._accessibilitySignalService=a,this._editorProgressService=l,this.elements=Ot("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Ot("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Ot("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Ot("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModelSrc=this._register(XG(this,void 0)),this._diffModel=oe(this,C=>{var S;return(S=this._diffModelSrc.read(C))==null?void 0:S.object}),this.onDidChangeModel=ve.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new ax([Xe,this._contextKeyService]))),this._boundarySashes=Ze(this,void 0),this._accessibleDiffViewerShouldBeVisible=Ze(this,!1),this._accessibleDiffViewerVisible=oe(this,C=>this._options.onlyShowAccessibleDiffViewer.read(C)?!0:this._accessibleDiffViewerShouldBeVisible.read(C)),this._movedBlocksLinesPart=Ze(this,void 0),this._layoutInfo=oe(this,C=>{var K,z;const S=this._rootSizeObserver.width.read(C),L=this._rootSizeObserver.height.read(C);this._rootSizeObserver.automaticLayout?this.elements.root.style.height="100%":this.elements.root.style.height=L+"px";const x=this._sash.read(C),I=this._gutter.read(C),E=(I==null?void 0:I.width.read(C))??0,R=((K=this._overviewRulerPart.read(C))==null?void 0:K.width)??0;let M,A,W,P,B;if(!!x){const j=x.sashLeft.read(C),X=((z=this._movedBlocksLinesPart.read(C))==null?void 0:z.width.read(C))??0;M=0,A=j-E-X,B=j-E,W=j,P=S-W-R}else{B=0;const j=this._options.inlineViewHideOriginalLineNumbers.read(C);M=E,j?A=0:A=Math.max(5,this._editors.originalObs.layoutInfoDecorationsLeft.read(C)),W=E+A,P=S-W-R}return this.elements.original.style.left=M+"px",this.elements.original.style.width=A+"px",this._editors.original.layout({width:A,height:L},!0),I==null||I.layout(B),this.elements.modified.style.left=W+"px",this.elements.modified.style.width=P+"px",this._editors.modified.layout({width:P,height:L},!0),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((C,S)=>C==null?void 0:C.diff.read(S)),this.onDidUpdateDiff=ve.fromObservableLight(this._diffValue),this._codeEditorService.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Re(()=>this.elements.root.remove())),this._rootSizeObserver=this._register(new i1e(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(t.automaticLayout??!1),this._options=this._instantiationService.createInstance(Gj,t),this._register(qe(C=>{this._options.setWidth(this._rootSizeObserver.width.read(C))})),this._contextKeyService.createKey(H.isEmbeddedDiffEditor.key,!1),this._register(Dh(H.isEmbeddedDiffEditor,this._contextKeyService,C=>this._options.isInEmbeddedEditor.read(C))),this._register(Dh(H.comparingMovedCode,this._contextKeyService,C=>{var S;return!!((S=this._diffModel.read(C))!=null&&S.movedTextToCompare.read(C))})),this._register(Dh(H.diffEditorRenderSideBySideInlineBreakpointReached,this._contextKeyService,C=>this._options.couldShowInlineViewBecauseOfSize.read(C))),this._register(Dh(H.diffEditorInlineMode,this._contextKeyService,C=>!this._options.renderSideBySide.read(C))),this._register(Dh(H.hasChanges,this._contextKeyService,C=>{var S,L;return(((L=(S=this._diffModel.read(C))==null?void 0:S.diff.read(C))==null?void 0:L.mappings.length)??0)>0})),this._editors=this._register(this._instantiationService.createInstance(qj,this.elements.original,this.elements.modified,this._options,i,(C,S,L,x)=>this._createInnerEditor(C,S,L,x))),this._register(Dh(H.diffEditorOriginalWritable,this._contextKeyService,C=>this._options.originalEditable.read(C))),this._register(Dh(H.diffEditorModifiedWritable,this._contextKeyService,C=>!this._options.readOnly.read(C))),this._register(Dh(H.diffEditorOriginalUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.original.uri.toString())??""})),this._register(Dh(H.diffEditorModifiedUri,this._contextKeyService,C=>{var S;return((S=this._diffModel.read(C))==null?void 0:S.model.modified.uri.toString())??""})),this._overviewRulerPart=Nl(this,C=>this._options.renderOverviewRuler.read(C)?this._instantiationService.createInstance(lf(aN),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(S=>S.modifiedEditor)):void 0).recomputeInitiallyAndOnChange(this._store);const c={height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((C,S)=>{var L;return C-(((L=this._overviewRulerPart.read(S))==null?void 0:L.width)??0)})};this._sashLayout=new EXe(this._options,c),this._sash=Nl(this,C=>{const S=this._options.renderSideBySide.read(C);return this.elements.root.classList.toggle("side-by-side",S),S?new l1e(this.elements.root,c,this._options.enableSplitViewResizing,this._boundarySashes,this._sashLayout.sashLeft,()=>this._sashLayout.resetSash()):void 0}).recomputeInitiallyAndOnChange(this._store);const d=Nl(this,C=>this._instantiationService.createInstance(lf(ZP),this._editors,this._diffModel,this._options)).recomputeInitiallyAndOnChange(this._store);Nl(this,C=>this._instantiationService.createInstance(lf(xXe),this._editors,this._diffModel,this._options,this)).recomputeInitiallyAndOnChange(this._store);const h=new Set,u=new Set;let f=!1;const g=Nl(this,C=>this._instantiationService.createInstance(lf($j),Pe(this._domElement),this._editors,this._diffModel,this._options,this,()=>f||d.read(void 0).isUpdatingHiddenAreas,h,u)).recomputeInitiallyAndOnChange(this._store),p=oe(this,C=>{const S=g.read(C).viewZones.read(C).orig,L=d.read(C).viewZones.read(C).origViewZones;return S.concat(L)}),m=oe(this,C=>{const S=g.read(C).viewZones.read(C).mod,L=d.read(C).viewZones.read(C).modViewZones;return S.concat(L)});this._register(qP(this._editors.original,p,C=>{f=C},h));let b;this._register(qP(this._editors.modified,m,C=>{f=C,f?b=oh.capture(this._editors.modified):(b==null||b.restore(this._editors.modified),b=void 0)},u)),this._accessibleDiffViewer=Nl(this,C=>this._instantiationService.createInstance(lf(gv),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(S,L)=>this._accessibleDiffViewerShouldBeVisible.set(S,L),this._options.onlyShowAccessibleDiffViewer.map(S=>!S),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((S,L)=>{var x;return(x=S==null?void 0:S.diff.read(L))==null?void 0:x.mappings.map(I=>I.lineRangeMapping)}),new cXe(this._editors))).recomputeInitiallyAndOnChange(this._store);const v=this._accessibleDiffViewerVisible.map(C=>C?"hidden":"visible");this._register(c_(this.elements.modified,{visibility:v})),this._register(c_(this.elements.original,{visibility:v})),this._createDiffEditorContributions(),this._codeEditorService.addDiffEditor(this),this._register(Re(()=>{this._codeEditorService.removeDiffEditor(this)})),this._gutter=Nl(this,C=>this._options.shouldRenderGutterMenu.read(C)?this._instantiationService.createInstance(lf(Yj),this.elements.root,this._diffModel,this._editors,this._options,this._sashLayout,this._boundarySashes):void 0),this._register(lS(this._layoutInfo)),Nl(this,C=>new(lf(wy))(this.elements.root,this._diffModel,this._layoutInfo.map(S=>S.originalEditor),this._layoutInfo.map(S=>S.modifiedEditor),this._editors)).recomputeInitiallyAndOnChange(this._store,C=>{this._movedBlocksLinesPart.set(C,void 0)}),this._register(ve.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!0))),this._register(ve.runAndSubscribe(this._editors.original.onDidChangeCursorPosition,C=>this._handleCursorPositionChange(C,!1)));const w=this._diffModel.map(this,(C,S)=>{if(C)return C.diff.read(S)===void 0&&!C.isDiffUpToDate.read(S)});this._register(ko((C,S)=>{if(w.read(C)===!0){const L=this._editorProgressService.show(!0,1e3);S.add(Re(()=>L.done()))}})),this._register(ko((C,S)=>{S.add(new(lf(VXe))(this._editors,this._diffModel,this._options,this))})),this._register(ko((C,S)=>{const L=this._diffModel.read(C);if(L)for(const x of[L.model.original,L.model.modified])S.add(x.onWillDispose(I=>{Je(new Ve("TextModel got disposed before DiffEditorWidget model got reset")),this.setModel(null)}))})),this._register(qe(C=>{this._options.setModel(this._diffModel.read(C))}))}_createInnerEditor(e,t,i,s){return e.createInstance(ow,t,i,s)}_createDiffEditorContributions(){const e=ty.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){Je(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return pD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var i;const e=this._editors.original.saveViewState(),t=this._editors.modified.saveViewState();return{original:e,modified:t,modelState:(i=this._diffModel.get())==null?void 0:i.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())==null||t.restoreSerializedState(i.modelState))}}handleInitialized(){this._editors.original.handleInitialized(),this._editors.modified.handleInitialized()}createViewModel(e){return this._instantiationService.createInstance(jj,e,this._options)}getModel(){var e;return((e=this._diffModel.get())==null?void 0:e.model)??null}setModel(e){const t=e?"model"in e?KP.create(e).createNewRef(this):KP.create(this.createViewModel(e),this):null;this.setDiffModel(t)}setDiffModel(e,t){const i=this._diffModel.get();!e&&i&&this._accessibleDiffViewer.get().close(),this._diffModel.get()!==(e==null?void 0:e.object)&&aS(t,s=>{var a;const o=e==null?void 0:e.object;qt.batchEventsGlobally(s,()=>{this._editors.original.setModel(o?o.model.original:null),this._editors.modified.setModel(o?o.model.modified:null)});const r=(a=this._diffModelSrc.get())==null?void 0:a.createNewRef(this);this._diffModelSrc.set(e==null?void 0:e.createNewRef(this),s),setTimeout(()=>{r==null||r.dispose()},0)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?jXe(e):null}getDiffComputationResult(){var t;const e=(t=this._diffModel.get())==null?void 0:t.diff.get();return e?{changes:this.getLineChanges(),changes2:e.mappings.map(i=>i.lineRangeMapping),identical:e.identical,quitEarly:e.quitEarly}:null}revert(e){const t=this._diffModel.get();!t||!t.isDiffUpToDate.get()||(this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",[{range:e.modified.toExclusiveRange(),text:t.model.original.getValueInRange(e.original.toExclusiveRange())}]),this._editors.modified.pushUndoStop())}revertRangeMappings(e){const t=this._diffModel.get();if(!t||!t.isDiffUpToDate.get())return;const i=e.map(s=>({range:s.modifiedRange,text:t.model.original.getValueInRange(s.originalRange)}));this._editors.modified.pushUndoStop(),this._editors.modified.executeEdits("diffEditor",i),this._editors.modified.pushUndoStop()}revertFocusedRangeMappings(){var l,c;const e=this._diffModel.get();if(!e||!e.isDiffUpToDate.get())return;const t=(c=(l=this._diffModel.get())==null?void 0:l.diff.get())==null?void 0:c.mappings;if(!t||t.length===0)return;const i=this._editors.modified;if(!i.hasTextFocus())return;const s=i.getPosition().lineNumber,o=i.getSelection(),r=Ye.fromRange(o||new D(s,0,s,0)),a=t.filter(d=>d.lineRangeMapping.modified.intersect(r));i.pushUndoStop(),i.executeEdits("diffEditor",a.map(d=>({range:d.lineRangeMapping.modified.toExclusiveRange(),text:e.model.original.getValueInRange(d.lineRangeMapping.original.toExclusiveRange())}))),i.pushUndoStop()}_goTo(e){this._editors.modified.setPosition(new U(e.lineRangeMapping.modified.startLineNumber,1)),this._editors.modified.revealRangeInCenter(e.lineRangeMapping.modified.toExclusiveRange())}goToDiff(e){var o,r;const t=(r=(o=this._diffModel.get())==null?void 0:o.diff.get())==null?void 0:r.mappings;if(!t||t.length===0)return;const i=this._editors.modified.getPosition().lineNumber;let s;e==="next"?this._editors.modified.getModel().getLineCount()===i?s=t[0]:s=t.find(l=>l.lineRangeMapping.modified.startLineNumber>i)??t[0]:s=_E(t,a=>a.lineRangeMapping.modified.startLineNumber{var i;const t=(i=e.diff.get())==null?void 0:i.mappings;!t||t.length===0||this._goTo(t[0])})}accessibleDiffViewerNext(){this._accessibleDiffViewer.get().next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.get().prev()}async waitForDiff(){const e=this._diffModel.get();e&&await e.waitForDiff()}mapToOtherSide(){var r,a;const e=this._editors.modified.hasWidgetFocus(),t=e?this._editors.modified:this._editors.original,i=e?this._editors.original:this._editors.modified;let s;const o=t.getSelection();if(o){const l=(a=(r=this._diffModel.get())==null?void 0:r.diff.get())==null?void 0:a.mappings.map(c=>e?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=Ere(o.getStartPosition(),l),d=Ere(o.getEndPosition(),l);s=D.plusRange(c,d)}}return{destination:i,destinationSelection:s}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&vi(i=>{for(const s of e)s.collapseAll(i)})}showAllUnchangedRegions(){var t;const e=(t=this._diffModel.get())==null?void 0:t.unchangedRegions.get();e&&vi(i=>{for(const s of e)s.showAll(i)})}_handleCursorPositionChange(e,t){var i,s;if((e==null?void 0:e.reason)===3){const o=(s=(i=this._diffModel.get())==null?void 0:i.diff.get())==null?void 0:s.mappings.find(r=>t?r.lineRangeMapping.modified.contains(e.position.lineNumber):r.lineRangeMapping.original.contains(e.position.lineNumber));o!=null&&o.lineRangeMapping.modified.isEmpty?this._accessibilitySignalService.playSignal(ur.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):o!=null&&o.lineRangeMapping.original.isEmpty?this._accessibilitySignalService.playSignal(ur.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):o&&this._accessibilitySignalService.playSignal(ur.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}};Eu=zXe([cL(3,Xe),cL(4,Ae),cL(5,Bt),cL(6,Kg),cL(7,Tg)],Eu);function jXe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}function rh(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===pD.ICodeEditor:!1}function hX(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===pD.IDiffEditor:!1}function $Xe(n){return!!n&&typeof n=="object"&&typeof n.onDidChangeActiveEditor=="function"}function f1e(n){return rh(n)?n:hX(n)?n.getModifiedEditor():$Xe(n)&&rh(n.activeCodeEditor)?n.activeCodeEditor:null}var UXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Kre=function(n,e){return function(t,i){e(t,i,n)}},JR,Gv;let Qj=(Gv=class{constructor(e,t){this._configurationService=e,this._languageService=t}async renderCodeBlock(e,t,i){var d;const s=rh(i.context)?i.context:void 0;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):s&&(o=(d=s.getModel())==null?void 0:d.getLanguageId()),o||(o=al);const r=await hze(this._languageService,t,o),a=JR._ttpTokenizer?JR._ttpTokenizer.createHTML(r)??r:r,l=document.createElement("span");l.innerHTML=a;const c=l.querySelector(".monaco-tokenized-source");return hn(c)?(Ms(c,this.getFontInfo(s)),l):document.createElement("span")}getFontInfo(e){return e?e.getOption(59):V3e({fontFamily:this._configurationService.getValue("editor").fontFamily},1)}},JR=Gv,Gv._ttpTokenizer=Ru("tokenizeToString",{createHTML(e){return e}}),Gv);Qj=JR=UXe([Kre(0,lt),Kre(1,un)],Qj);var uX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bi=function(n,e){return function(t,i){e(t,i,n)}};let qXe=0,Gre=!1;function KXe(n){if(!n){if(Gre)return;Gre=!0}A3e(n||ri.document.body)}let QP=class extends ow{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g){const p={...t};p.ariaLabel=p.ariaLabel||Lz.editorViewAccessibleLabel,super(e,p,{},i,s,o,r,c,d,h,u,f),l instanceof kS?this._standaloneKeybindingService=l:this._standaloneKeybindingService=null,KXe(p.ariaContainerElement),Pqe((m,b)=>i.createInstance(CS,m,{instantHover:b},{})),Oqe(a),g.setDefaultCodeBlockRenderer(i.createInstance(Qj))}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++qXe,o=le.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None;const t=e.id,i=e.label,s=le.and(le.equals("editorId",this.getId()),le.deserialize(e.precondition)),o=e.keybindings,r=le.and(s,le.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new ne,h=this.getId()+":"+t;if(d.add(Rt.registerCommand(h,c)),a){const f={command:{id:h,title:i},when:s,group:a,order:l};d.add(Rs.appendMenuItem(Te.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(h,f,c,r));const u=new g_e(h,i,i,void 0,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,u),d.add(Re(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof aP)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};QP=uX([bi(2,Ae),bi(3,Bt),bi(4,ki),bi(5,Xe),bi(6,Sr),bi(7,Vt),bi(8,en),bi(9,fn),bi(10,Us),bi(11,qi),bi(12,De),bi(13,ed)],QP);let Jj=class extends QP{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g,p,m,b){const v={...t};$P(h,v,!1);const w=c.registerEditorContainer(e);typeof v.theme=="string"&&c.setTheme(v.theme),typeof v.autoDetectHighContrast<"u"&&c.setAutoDetectHighContrast(!!v.autoDetectHighContrast);const C=v.model;delete v.model,super(e,v,i,s,o,r,a,l,c,d,u,p,m,b),this._configurationService=h,this._standaloneThemeService=c,this._register(w);let S;if(typeof C>"u"){const L=g.getLanguageIdByMimeType(v.language)||v.language||al;S=g1e(f,g,v.value||"",L,void 0),this._ownsModel=!0}else S=C,this._ownsModel=!1;if(this._attachModel(S),S){const L={oldModelUrl:null,newModelUrl:S.uri};this._onDidChangeModel.fire(L)}}dispose(){super.dispose()}updateOptions(e){$P(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};Jj=uX([bi(2,Ae),bi(3,Bt),bi(4,ki),bi(5,Xe),bi(6,Sr),bi(7,Vt),bi(8,ml),bi(9,fn),bi(10,lt),bi(11,Us),bi(12,Ui),bi(13,un),bi(14,qi),bi(15,De),bi(16,ed)],Jj);let e$=class extends Eu{constructor(e,t,i,s,o,r,a,l,c,d,h,u){const f={...t};$P(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,u,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){$P(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(QP,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};e$=uX([bi(2,Ae),bi(3,Xe),bi(4,Bt),bi(5,ml),bi(6,fn),bi(7,lt),bi(8,gl),bi(9,Tg),bi(10,La),bi(11,Kg)],e$);function g1e(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),Yre(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return Yre(n,t,e.createById(i),s)}function Yre(n,e,t,i){return n.createModel(e,t,i)}F("multiDiffEditor.headerBackground",{dark:"#262626",light:"tab.inactiveBackground",hcDark:"tab.inactiveBackground",hcLight:"tab.inactiveBackground"},_(142,"The background color of the diff editor's header"));F("multiDiffEditor.background",In,_(143,"The background color of the multi file diff editor"));F("multiDiffEditor.border",{dark:"sideBarSectionHeader.border",light:"#cccccc",hcDark:"sideBarSectionHeader.border",hcLight:"#cccccc"},_(144,"The border color of the multi file diff editor"));var GXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Zre=function(n,e){return function(t,i){e(t,i,n)}};class YXe{constructor(e,t){this.viewModel=e,this.deltaScrollVertical=t}getId(){return this.viewModel}}let t$=class extends G{constructor(e,t,i,s,o){super(),this._container=e,this._overflowWidgetsDomNode=t,this._workbenchUIElementFactory=i,this._instantiationService=s,this._viewModel=Ze(this,void 0),this._collapsed=oe(this,l=>{var c;return(c=this._viewModel.read(l))==null?void 0:c.collapsed.read(l)}),this._editorContentHeight=Ze(this,500),this.contentHeight=oe(this,l=>(this._collapsed.read(l)?0:this._editorContentHeight.read(l))+this._outerEditorHeight),this._modifiedContentWidth=Ze(this,0),this._modifiedWidth=Ze(this,0),this._originalContentWidth=Ze(this,0),this._originalWidth=Ze(this,0),this.maxScroll=oe(this,l=>{const c=this._modifiedContentWidth.read(l)-this._modifiedWidth.read(l),d=this._originalContentWidth.read(l)-this._originalWidth.read(l);return c>d?{maxScroll:c,width:this._modifiedWidth.read(l)}:{maxScroll:d,width:this._originalWidth.read(l)}}),this._elements=Ot("div.multiDiffEntry",[Ot("div.header@header",[Ot("div.header-content",[Ot("div.collapse-button@collapseButton"),Ot("div.file-path",[Ot("div.title.modified.show-file-icons@primaryPath",[]),Ot("div.status.deleted@status",["R"]),Ot("div.title.original.show-file-icons@secondaryPath",[])]),Ot("div.actions@actions")])]),Ot("div.editorParent",[Ot("div.editorContainer@editor")])]),this.editor=this._register(this._instantiationService.createInstance(Eu,this._elements.editor,{overflowWidgetsDomNode:this._overflowWidgetsDomNode,fixedOverflowWidgets:!0},{})),this.isModifedFocused=$i(this.editor.getModifiedEditor()).isFocused,this.isOriginalFocused=$i(this.editor.getOriginalEditor()).isFocused,this.isFocused=oe(this,l=>this.isModifedFocused.read(l)||this.isOriginalFocused.read(l)),this._resourceLabel=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.primaryPath)):void 0,this._resourceLabel2=this._workbenchUIElementFactory.createResourceLabel?this._register(this._workbenchUIElementFactory.createResourceLabel(this._elements.secondaryPath)):void 0,this._dataStore=this._register(new ne),this._headerHeight=40,this._lastScrollTop=-1,this._isSettingScrollTop=!1;const r=new IP(this._elements.collapseButton,{});this._register(qe(l=>{r.element.className="",r.icon=this._collapsed.read(l)?de.chevronRight:de.chevronDown})),this._register(r.onDidClick(()=>{var l;(l=this._viewModel.get())==null||l.collapsed.set(!this._collapsed.get(),void 0)})),this._register(qe(l=>{this._elements.editor.style.display=this._collapsed.read(l)?"none":"block"})),this._register(this.editor.getModifiedEditor().onDidLayoutChange(l=>{const c=this.editor.getModifiedEditor().getLayoutInfo().contentWidth;this._modifiedWidth.set(c,void 0)})),this._register(this.editor.getOriginalEditor().onDidLayoutChange(l=>{const c=this.editor.getOriginalEditor().getLayoutInfo().contentWidth;this._originalWidth.set(c,void 0)})),this._register(this.editor.onDidContentSizeChange(l=>{EL(c=>{this._editorContentHeight.set(l.contentHeight,c),this._modifiedContentWidth.set(this.editor.getModifiedEditor().getContentWidth(),c),this._originalContentWidth.set(this.editor.getOriginalEditor().getContentWidth(),c)})})),this._register(this.editor.getOriginalEditor().onDidScrollChange(l=>{if(this._isSettingScrollTop||!l.scrollTopChanged||!this._data)return;const c=l.scrollTop-this._lastScrollTop;this._data.deltaScrollVertical(c)})),this._register(qe(l=>{var d;const c=(d=this._viewModel.read(l))==null?void 0:d.isActive.read(l);this._elements.root.classList.toggle("active",c)})),this._container.appendChild(this._elements.root),this._outerEditorHeight=this._headerHeight,this._contextKeyService=this._register(o.createScoped(this._elements.actions));const a=this._register(this._instantiationService.createChild(new ax([Xe,this._contextKeyService])));this._register(a.createInstance(cN,this._elements.actions,Te.MultiDiffEditorFileToolbar,{actionRunner:this._register(new h1e(()=>{var l,c;return((l=this._viewModel.get())==null?void 0:l.modifiedUri)??((c=this._viewModel.get())==null?void 0:c.originalUri)})),menuOptions:{shouldForwardArgs:!0},toolbarOptions:{primaryGroup:l=>l.startsWith("navigation")},actionViewItemProvider:(l,c)=>MZ(a,l,c)}))}setScrollLeft(e){this._modifiedContentWidth.get()-this._modifiedWidth.get()>this._originalContentWidth.get()-this._originalWidth.get()?this.editor.getModifiedEditor().setScrollLeft(e):this.editor.getOriginalEditor().setScrollLeft(e)}setData(e){this._data=e;function t(s){return{...s,scrollBeyondLastLine:!1,hideUnchangedRegions:{enabled:!0},scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1,useShadows:!1},renderOverviewRuler:!1,fixedOverflowWidgets:!0,overviewRulerBorder:!1}}if(!e){EL(s=>{this._viewModel.set(void 0,s),this.editor.setDiffModel(null,s),this._dataStore.clear()});return}const i=e.viewModel.documentDiffItem;if(EL(s=>{var c,d;(c=this._resourceLabel)==null||c.setUri(e.viewModel.modifiedUri??e.viewModel.originalUri,{strikethrough:e.viewModel.modifiedUri===void 0});let o=!1,r=!1,a=!1,l="";e.viewModel.modifiedUri&&e.viewModel.originalUri&&e.viewModel.modifiedUri.path!==e.viewModel.originalUri.path?(l="R",o=!0):e.viewModel.modifiedUri?e.viewModel.originalUri||(l="A",a=!0):(l="D",r=!0),this._elements.status.classList.toggle("renamed",o),this._elements.status.classList.toggle("deleted",r),this._elements.status.classList.toggle("added",a),this._elements.status.innerText=l,(d=this._resourceLabel2)==null||d.setUri(o?e.viewModel.originalUri:void 0,{strikethrough:!0}),this._dataStore.clear(),this._viewModel.set(e.viewModel,s),this.editor.setDiffModel(e.viewModel.diffEditorViewModelRef,s),this.editor.updateOptions(t(i.options??{}))}),i.onOptionsDidChange&&this._dataStore.add(i.onOptionsDidChange(()=>{this.editor.updateOptions(t(i.options??{}))})),e.viewModel.isAlive.recomputeInitiallyAndOnChange(this._dataStore,s=>{s||this.setData(void 0)}),e.viewModel.documentDiffItem.contextKeys)for(const[s,o]of Object.entries(e.viewModel.documentDiffItem.contextKeys))this._contextKeyService.createKey(s,o)}render(e,t,i,s){this._elements.root.style.visibility="visible",this._elements.root.style.top=`${e.start}px`,this._elements.root.style.height=`${e.length}px`,this._elements.root.style.width=`${t}px`,this._elements.root.style.position="absolute";const o=e.length-this._headerHeight,r=Math.max(0,Math.min(s.start-e.start,o));this._elements.header.style.transform=`translateY(${r}px)`,EL(a=>{this.editor.layout({width:t-2*8-2*1,height:e.length-this._outerEditorHeight})});try{this._isSettingScrollTop=!0,this._lastScrollTop=i,this.editor.getOriginalEditor().setScrollTop(i)}finally{this._isSettingScrollTop=!1}this._elements.header.classList.toggle("shadow",r>0||i>0),this._elements.header.classList.toggle("collapsed",r===o)}hide(){this._elements.root.style.top="-100000px",this._elements.root.style.visibility="hidden"}};t$=GXe([Zre(3,Ae),Zre(4,Xe)],t$);class ZXe{constructor(e){this._create=e,this._unused=new Set,this._used=new Set,this._itemData=new Map}getUnusedObj(e){let t;if(this._unused.size===0)t=this._create(e),this._itemData.set(t,e);else{const i=[...this._unused.values()];t=i.find(s=>this._itemData.get(s).getId()===e.getId())??i[0],this._unused.delete(t),this._itemData.set(t,e),t.setData(e)}return this._used.add(t),{object:t,dispose:()=>{this._used.delete(t),this._unused.size>5?t.dispose():this._unused.add(t)}}}dispose(){for(const e of this._used)e.dispose();for(const e of this._unused)e.dispose();this._used.clear(),this._unused.clear()}}var XXe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xre=function(n,e){return function(t,i){e(t,i,n)}};let i$=class extends G{constructor(e,t,i,s,o,r){super(),this._element=e,this._dimension=t,this._viewModel=i,this._workbenchUIElementFactory=s,this._parentContextKeyService=o,this._parentInstantiationService=r,this._scrollableElements=Ot("div.scrollContent",[Ot("div@content",{style:{overflow:"hidden"}}),Ot("div.monaco-editor@overflowWidgetsDomNode",{})]),this._scrollable=this._register(new sx({forceIntegerValues:!1,scheduleAtNextAnimationFrame:c=>Kr(Pe(this._element),c),smoothScrollDuration:100})),this._scrollableElement=this._register(new m3(this._scrollableElements.root,{vertical:1,horizontal:1,useShadows:!1},this._scrollable)),this._elements=Ot("div.monaco-component.multiDiffEditor",{},[Ot("div",{},[this._scrollableElement.getDomNode()]),Ot("div.placeholder@placeholder",{},[Ot("div")])]),this._sizeObserver=this._register(new i1e(this._element,void 0)),this._objectPool=this._register(new ZXe(c=>{const d=this._instantiationService.createInstance(t$,this._scrollableElements.content,this._scrollableElements.overflowWidgetsDomNode,this._workbenchUIElementFactory);return d.setData(c),d})),this.scrollTop=qt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollTop),this.scrollLeft=qt(this,this._scrollableElement.onScroll,()=>this._scrollableElement.getScrollPosition().scrollLeft),this._viewItemsInfo=oe(this,c=>{const d=this._viewModel.read(c);if(!d)return{items:[],getItem:g=>{throw new Ve}};const h=d.items.read(c),u=new Map;return{items:h.map(g=>{var b;const p=c.store.add(new JXe(g,this._objectPool,this.scrollLeft,v=>{this._scrollableElement.setScrollPosition({scrollTop:this._scrollableElement.getScrollPosition().scrollTop+v})})),m=(b=this._lastDocStates)==null?void 0:b[p.getKey()];return m&&vi(v=>{p.setViewState(m,v)}),u.set(g,p),p}),getItem:g=>u.get(g)}}),this._viewItems=this._viewItemsInfo.map(this,c=>c.items),this._spaceBetweenPx=0,this._totalHeight=this._viewItems.map(this,(c,d)=>c.reduce((h,u)=>h+u.contentHeight.read(d)+this._spaceBetweenPx,0)),this.activeControl=oe(this,c=>{var u,f;const d=(u=this._viewModel.read(c))==null?void 0:u.activeDiffItem.read(c);return d?(f=this._viewItemsInfo.read(c).getItem(d).template.read(c))==null?void 0:f.editor:void 0}),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._element)),this._instantiationService=this._register(this._parentInstantiationService.createChild(new ax([Xe,this._contextKeyService]))),this._contextKeyService.createKey(H.inMultiDiffEditor.key,!0),this._lastDocStates={},this._register(ko((c,d)=>{const h=this._viewModel.read(c);if(h&&h.contextKeys)for(const[u,f]of Object.entries(h.contextKeys)){const g=this._contextKeyService.createKey(u,void 0);g.set(f),d.add(Re(()=>g.reset()))}}));const a=this._parentContextKeyService.createKey(H.multiDiffEditorAllCollapsed.key,!1);this._register(qe(c=>{const d=this._viewModel.read(c);if(d){const h=d.items.read(c).every(u=>u.collapsed.read(c));a.set(h)}})),this._register(qe(c=>{const d=this._dimension.read(c);this._sizeObserver.observe(d)}));const l=oe(c=>{if(this._viewItems.read(c).length>0)return;const h=this._viewModel.read(c);return!h||h.isLoading.read(c)?_(145,"Loading..."):_(146,"No Changed Files")});this._register(qe(c=>{const d=l.read(c);this._elements.placeholder.innerText=d??"",this._elements.placeholder.classList.toggle("visible",!!d)})),this._scrollableElements.content.style.position="relative",this._register(qe(c=>{const d=this._sizeObserver.height.read(c);this._scrollableElements.root.style.height=`${d}px`;const h=this._totalHeight.read(c);this._scrollableElements.content.style.height=`${h}px`;const u=this._sizeObserver.width.read(c);let f=u;const g=this._viewItems.read(c),p=lY(g,co(m=>m.maxScroll.read(c).maxScroll,ma));if(p){const m=p.maxScroll.read(c);f=u+m.maxScroll}this._scrollableElement.setScrollDimensions({width:u,height:d,scrollHeight:h,scrollWidth:f})})),e.replaceChildren(this._elements.root),this._register(Re(()=>{e.replaceChildren()})),this._register(qe(c=>{const d=this._viewModel.read(c);if(d&&!d.isLoading.read(c)){if(d.items.read(c).length===0||d.activeDiffItem.read(c))return;this.goToNextChange()}})),this._register(this._register(qe(c=>{EL(d=>{this.render(c)})})))}reveal(e,t){var c;const i=this._viewItems.get(),s=i.findIndex(d=>{var h,u,f,g;return((h=d.viewModel.originalUri)==null?void 0:h.toString())===((u=e.original)==null?void 0:u.toString())&&((f=d.viewModel.modifiedUri)==null?void 0:f.toString())===((g=e.modified)==null?void 0:g.toString())});if(s===-1)throw new Ve("Resource not found in diff editor");const o=i[s];this._viewModel.get().activeDiffItem.setCache(o.viewModel,void 0);let r=0;for(let d=0;df.viewModel===i):-1;if(s===-1){this._goToFile(0,"first");return}const o=t[s];o.viewModel.collapsed.get()&&o.viewModel.collapsed.set(!1,void 0);const r=(c=o.template.get())==null?void 0:c.editor;if((h=(d=r==null?void 0:r.getDiffComputationResult())==null?void 0:d.changes2)!=null&&h.length){const f=((u=r.getModifiedEditor().getPosition())==null?void 0:u.lineNumber)||1,g=r.getDiffComputationResult().changes2;if(e==="next"?g.some(m=>m.modified.startLineNumber>f):g.some(m=>m.modified.endLineNumberExclusive<=f)){r.goToDiff(e);return}}const a=(s+(e==="next"?1:-1)+t.length)%t.length;this._goToFile(a,e==="next"?"first":"last")}_goToFile(e,t){var o,r,a;const i=this._viewItems.get()[e];i.viewModel.collapsed.get()&&i.viewModel.collapsed.set(!1,void 0),this.reveal({original:i.viewModel.originalUri,modified:i.viewModel.modifiedUri});const s=(o=i.template.get())==null?void 0:o.editor;if((a=(r=s==null?void 0:s.getDiffComputationResult())==null?void 0:r.changes2)!=null&&a.length)if(t==="first")s.revealFirstDiff();else{const l=s.getDiffComputationResult().changes2.at(-1),c=s.getModifiedEditor();c.setPosition({lineNumber:l.modified.startLineNumber,column:1}),c.revealLineInCenter(l.modified.startLineNumber)}s==null||s.focus()}render(e){const t=this.scrollTop.read(e);let i=0,s=0,o=0;const r=this._sizeObserver.height.read(e),a=Me.ofStartAndLength(t,r),l=this._sizeObserver.width.read(e);for(const c of this._viewItems.read(e)){const d=c.contentHeight.read(e),h=Math.min(d,r),u=Me.ofStartAndLength(s,h),f=Me.ofStartAndLength(o,d);if(f.isBefore(a))i-=d-h,c.hide();else if(f.isAfter(a))c.hide();else{const g=Math.max(0,Math.min(a.start-f.start,d-h));i-=g;const p=Me.ofStartAndLength(t+i,r);c.render(u,g,l,p)}s+=h+this._spaceBetweenPx,o+=d+this._spaceBetweenPx}this._scrollableElements.content.style.transform=`translateY(${-(t+i)}px)`}};i$=XXe([Xre(4,Xe),Xre(5,Ae)],i$);function QXe(n,e){const t=n.getModel(),i=n.createDecorationsCollection([{range:e,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{n.getModel()===t&&i.clear()},350)}class JXe extends G{constructor(e,t,i,s){super(),this.viewModel=e,this._objectPool=t,this._scrollLeft=i,this._deltaScrollVertical=s,this._templateRef=this._register(XG(this,void 0)),this.contentHeight=oe(this,o=>{var r,a;return((a=(r=this._templateRef.read(o))==null?void 0:r.object.contentHeight)==null?void 0:a.read(o))??this.viewModel.lastTemplateData.read(o).contentHeight}),this.maxScroll=oe(this,o=>{var r;return((r=this._templateRef.read(o))==null?void 0:r.object.maxScroll.read(o))??{maxScroll:0,scrollWidth:0}}),this.template=oe(this,o=>{var r;return(r=this._templateRef.read(o))==null?void 0:r.object}),this._isHidden=Ze(this,!1),this._isFocused=oe(this,o=>{var r;return((r=this.template.read(o))==null?void 0:r.isFocused.read(o))??!1}),this.viewModel.setIsFocused(this._isFocused,void 0),this._register(qe(o=>{var a;const r=this._scrollLeft.read(o);(a=this._templateRef.read(o))==null||a.object.setScrollLeft(r)})),this._register(qe(o=>{const r=this._templateRef.read(o);!r||!this._isHidden.read(o)||r.object.isFocused.read(o)||this._clear()}))}dispose(){this._clear(),super.dispose()}toString(){var e;return`VirtualViewItem(${(e=this.viewModel.documentDiffItem.modified)==null?void 0:e.uri.toString()})`}getKey(){return this.viewModel.getKey()}setViewState(e,t){var r;this.viewModel.collapsed.set(e.collapsed,t),this._updateTemplateData(t);const i=this.viewModel.lastTemplateData.get(),s=(r=e.selections)==null?void 0:r.map(Ie.liftSelection);this.viewModel.lastTemplateData.set({...i,selections:s},t);const o=this._templateRef.get();o&&s&&o.object.editor.setSelections(s)}_updateTemplateData(e){const t=this._templateRef.get();t&&this.viewModel.lastTemplateData.set({contentHeight:t.object.contentHeight.get(),selections:t.object.editor.getSelections()??void 0},e)}_clear(){const e=this._templateRef.get();e&&vi(t=>{this._updateTemplateData(t),e.object.hide(),this._templateRef.set(void 0,t)})}hide(){this._isHidden.set(!0,void 0)}render(e,t,i,s){this._isHidden.set(!1,void 0);let o=this._templateRef.get();if(!o){o=this._objectPool.getUnusedObj(new YXe(this.viewModel,this._deltaScrollVertical)),this._templateRef.set(o,void 0);const r=this.viewModel.lastTemplateData.get().selections;r&&o.object.editor.setSelections(r)}o.object.render(e,i,t,s)}}var eQe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tQe=function(n,e){return function(t,i){e(t,i,n)}};let n$=class extends G{constructor(e,t,i){super(),this._element=e,this._workbenchUIElementFactory=t,this._instantiationService=i,this._dimension=Ze(this,void 0),this._viewModel=Ze(this,void 0),this._widgetImpl=oe(this,s=>s.store.add(this._instantiationService.createInstance(lf(i$),this._element,this._dimension,this._viewModel,this._workbenchUIElementFactory))),this._register(lS(this._widgetImpl))}};n$=eQe([tQe(2,Ae)],n$);function iQe(n,e,t){return et.initialize(t||{}).createInstance(Jj,n,e)}function nQe(n){return et.get(Bt).onCodeEditorAdd(t=>{n(t)})}function sQe(n){return et.get(Bt).onDiffEditorAdd(t=>{n(t)})}function oQe(){return et.get(Bt).listCodeEditors()}function rQe(){return et.get(Bt).listDiffEditors()}function aQe(n,e,t){return et.initialize(t||{}).createInstance(e$,n,e)}function lQe(n,e){const t=et.initialize(e||{});return new n$(n,{},t)}function cQe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Rt.registerCommand(n.id,n.run)}function dQe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=le.deserialize(n.precondition),t=(s,...o)=>hs.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new ne;if(i.add(Rt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(Rs.appendMenuItem(Te.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=et.get(Vt);if(!(s instanceof kS))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=le.and(e,le.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function hQe(n){return p1e([n])}function p1e(n){const e=et.get(Vt);return e instanceof kS?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:le.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),G.None)}function uQe(n,e,t){const i=et.get(un),s=i.getLanguageIdByMimeType(e)||e;return g1e(et.get(Ui),i,n,s,t)}function fQe(n,e){const t=et.get(un),i=t.getLanguageIdByMimeType(e)||e||al;n.setLanguage(t.createById(i))}function gQe(n,e,t){n&&et.get(Ou).changeOne(e,n.uri,t)}function pQe(n){et.get(Ou).changeAll(n,[])}function mQe(n){return et.get(Ou).read(n)}function _Qe(n){return et.get(Ou).onMarkerChanged(n)}function bQe(n){return et.get(Ui).getModel(n)}function vQe(){return et.get(Ui).getModels()}function wQe(n){return et.get(Ui).onModelAdded(n)}function CQe(n){return et.get(Ui).onModelRemoved(n)}function yQe(n){return et.get(Ui).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function SQe(n){return o3e(et.get(Ui),n)}function xQe(n,e){const t=et.get(un),i=et.get(ml);return pY.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function LQe(n,e,t){const i=et.get(un);return et.get(ml).registerEditorContainer(ri.document.body),pY.colorize(i,n,e,t)}function kQe(n,e,t=4){return et.get(ml).registerEditorContainer(ri.document.body),pY.colorizeModelLine(n,e,t)}function IQe(n){const e=rn.get(n);return e||{getInitialState:()=>fS,tokenize:(t,i,s)=>uY(n,s)}}function EQe(n,e){rn.getOrCreate(e);const t=IQe(e),i=Ca(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;r{var a;if(!i)return null;const o=(a=t.options)==null?void 0:a.selection;let r;return o&&typeof o.endLineNumber=="number"&&typeof o.endColumn=="number"?r=o:o&&(r={lineNumber:o.startLineNumber,column:o.startColumn}),await n.openCodeEditor(i,t.resource,r)?i:null})}function PQe(){return{create:iQe,getEditors:oQe,getDiffEditors:rQe,onDidCreateEditor:nQe,onDidCreateDiffEditor:sQe,createDiffEditor:aQe,addCommand:cQe,addEditorAction:dQe,addKeybindingRule:hQe,addKeybindingRules:p1e,createModel:uQe,setModelLanguage:fQe,setModelMarkers:gQe,getModelMarkers:mQe,removeAllMarkers:pQe,onDidChangeMarkers:_Qe,getModels:vQe,getModel:bQe,onDidCreateModel:wQe,onWillDisposeModel:CQe,onDidChangeModelLanguage:yQe,createWebWorker:SQe,colorizeElement:xQe,colorize:LQe,colorizeModelLine:kQe,tokenize:EQe,defineTheme:NQe,setTheme:DQe,remeasureFonts:TQe,registerCommand:RQe,registerLinkOpener:MQe,registerEditorOpener:AQe,AccessibilitySupport:uW,ContentWidgetPositionPreference:bW,CursorChangeReason:vW,DefaultEndOfLine:wW,EditorAutoIndentStrategy:yW,EditorOption:SW,EndOfLinePreference:xW,EndOfLineSequence:LW,MinimapPosition:FW,MinimapSectionHeaderStyle:BW,MouseTargetType:WW,OverlayWidgetPositionPreference:zW,OverviewRulerLane:jW,GlyphMarginLane:kW,RenderLineNumbersType:qW,RenderMinimap:KW,ScrollbarVisibility:YW,ScrollType:GW,TextEditorCursorBlinkingStyle:iH,TextEditorCursorStyle:nH,TrackedRangeStickiness:sH,WrappingIndent:oH,InjectedTextCursorStops:NW,PositionAffinity:UW,ShowLightbulbIconMode:XW,TextDirection:tH,ConfigurationChangedEvent:fge,BareFontInfo:G1,FontInfo:tA,TextModelResolvedOptions:TR,FindMatch:mE,ApplyUpdateResult:dk,EditorZoom:Fl,createMultiFileDiffEditor:lQe,EditorType:pD,EditorOptions:jo}}function OQe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function I2(n,e){return typeof n=="boolean"?n:e}function Qre(n,e){return typeof n=="string"?n:e}function FQe(n){const e={};for(const t of n)e[t]=!0;return e}function Jre(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=FQe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function s$(n,e,t){e=e.replace(/@@/g,"");let i=0,s;do s=!1,e=e.replace(/@(\w+)/g,function(r,a){s=!0;let l="";if(typeof n[a]=="string")l=n[a];else if(n[a]&&n[a]instanceof RegExp)l=n[a].source;else throw n[a]===void 0?Pi(n,"language definition does not contain attribute '"+a+"', used at: "+e):Pi(n,"attribute reference '"+a+"' must be a string, used at: "+e);return Eb(l)?"":"(?:"+l+")"}),i++;while(s&&i<5);e=e.replace(/\x01/g,"@");const o=(n.ignoreCase?"i":"")+(n.unicode?"u":"");if(t&&e.match(/\$[sS](\d\d?)/g)){let a=null,l=null;return c=>(l&&a===c||(a=c,l=new RegExp(k3e(n,e,c),o)),l)}return new RegExp(e,o)}function BQe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Pi(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Pi(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!I3e(n,Op(n,s,"",[],""))))throw Pi(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=s$(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")",!0)}setAction(e,t){this.action=o$(e,this.name,t)}resolveRegex(e){return this.regex instanceof RegExp?this.regex:this.regex(e)}}function m1e(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={languageId:n,includeLF:I2(e.includeLF,!1),noThrow:!1,maxStack:100,start:typeof e.start=="string"?e.start:null,ignoreCase:I2(e.ignoreCase,!1),unicode:I2(e.unicode,!1),tokenPostfix:Qre(e.tokenPostfix,"."+n),defaultToken:Qre(e.defaultToken,"source"),usesEmbedded:!1,stateNames:{},tokenizer:{},brackets:[]},i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Pi(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Pi(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const h=new HQe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const u=c[1];u.next=c[2],h.setAction(i,u)}else throw Pi(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else h.setAction(i,c[1]);else{if(!c.regex)throw Pi(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=I2(c.matchOnlyAtLineStart,!1)),h.setRegex(i,c.regex),h.setAction(i,c.action)}a.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Pi(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Pi(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Pi(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:ag(t,a.open),close:ag(t,a.close)});else throw Pi(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}function VQe(n){dS.registerLanguage(n)}function zQe(){let n=[];return n=n.concat(dS.getLanguages()),n}function jQe(n){return et.get(un).languageIdCodec.encodeLanguageId(n)}function $Qe(n,e){return et.withServices(()=>{const i=et.get(un).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function UQe(n,e){return et.withServices(()=>{const i=et.get(un).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function qQe(n,e){if(!et.get(un).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return et.get(qi).register(n,e,100)}class KQe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return dN.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new M5(s.tokens,s.endState)}}class dN{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===u)continue;let f=h.startIndex;c===0?f=0:f{const i=await Promise.resolve(e.create());return i?GQe(i)?b1e(n,i):new yE(et.get(un),et.get(ml),n,m1e(n,i),et.get(lt)):null});return rn.registerFactory(n,t)}function XQe(n,e){if(!et.get(un).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return _1e(e)?fX(n,{create:()=>e}):rn.register(n,b1e(n,e))}function QQe(n,e){const t=i=>new yE(et.get(un),et.get(ml),n,m1e(n,i),et.get(lt));return _1e(e)?fX(n,{create:()=>e}):rn.register(n,t(e))}function JQe(n,e){return et.get(De).referenceProvider.register(n,e)}function eJe(n,e){return et.get(De).renameProvider.register(n,e)}function tJe(n,e){return et.get(De).newSymbolNamesProvider.register(n,e)}function iJe(n,e){return et.get(De).signatureHelpProvider.register(n,e)}function nJe(n,e){return et.get(De).hoverProvider.register(n,{provideHover:async(i,s,o,r)=>{const a=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o,r)).then(l=>{if(l)return!l.range&&a&&(l.range=new D(s.lineNumber,a.startColumn,s.lineNumber,a.endColumn)),l.range||(l.range=new D(s.lineNumber,s.column,s.lineNumber,s.column)),l})}})}function sJe(n,e){return et.get(De).documentSymbolProvider.register(n,e)}function oJe(n,e){return et.get(De).documentHighlightProvider.register(n,e)}function rJe(n,e){return et.get(De).linkedEditingRangeProvider.register(n,e)}function aJe(n,e){return et.get(De).definitionProvider.register(n,e)}function lJe(n,e){return et.get(De).implementationProvider.register(n,e)}function cJe(n,e){return et.get(De).typeDefinitionProvider.register(n,e)}function dJe(n,e){return et.get(De).codeLensProvider.register(n,e)}function hJe(n,e,t){return et.get(De).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=et.get(Ou).read({resource:s.uri}).filter(d=>D.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function uJe(n,e){return et.get(De).documentFormattingEditProvider.register(n,e)}function fJe(n,e){return et.get(De).documentRangeFormattingEditProvider.register(n,e)}function gJe(n,e){return et.get(De).onTypeFormattingEditProvider.register(n,e)}function pJe(n,e){return et.get(De).linkProvider.register(n,e)}function mJe(n,e){return et.get(De).completionProvider.register(n,e)}function _Je(n,e){return et.get(De).colorProvider.register(n,e)}function bJe(n,e){return et.get(De).foldingRangeProvider.register(n,e)}function vJe(n,e){return et.get(De).declarationProvider.register(n,e)}function wJe(n,e){return et.get(De).selectionRangeProvider.register(n,e)}function CJe(n,e){return et.get(De).documentSemanticTokensProvider.register(n,e)}function yJe(n,e){return et.get(De).documentRangeSemanticTokensProvider.register(n,e)}function SJe(n,e){return et.get(De).inlineCompletionsProvider.register(n,e)}function xJe(n,e){return et.get(De).inlayHintsProvider.register(n,e)}function LJe(){return{register:VQe,getLanguages:zQe,onLanguage:$Qe,onLanguageEncountered:UQe,getEncodedLanguageId:jQe,setLanguageConfiguration:qQe,setColorMap:ZQe,registerTokensProviderFactory:fX,setTokensProvider:XQe,setMonarchTokensProvider:QQe,registerReferenceProvider:JQe,registerRenameProvider:eJe,registerNewSymbolNameProvider:tJe,registerCompletionItemProvider:mJe,registerSignatureHelpProvider:iJe,registerHoverProvider:nJe,registerDocumentSymbolProvider:sJe,registerDocumentHighlightProvider:oJe,registerLinkedEditingRangeProvider:rJe,registerDefinitionProvider:aJe,registerImplementationProvider:lJe,registerTypeDefinitionProvider:cJe,registerCodeLensProvider:dJe,registerCodeActionProvider:hJe,registerDocumentFormattingEditProvider:uJe,registerDocumentRangeFormattingEditProvider:fJe,registerOnTypeFormattingEditProvider:gJe,registerLinkProvider:pJe,registerColorProvider:_Je,registerFoldingRangeProvider:bJe,registerDeclarationProvider:vJe,registerSelectionRangeProvider:wJe,registerDocumentSemanticTokensProvider:CJe,registerDocumentRangeSemanticTokensProvider:yJe,registerInlineCompletionsProvider:SJe,registerInlayHintsProvider:xJe,DocumentHighlightKind:CW,CompletionItemKind:pW,CompletionItemTag:mW,CompletionItemInsertTextRule:gW,SymbolKind:JW,SymbolTag:eH,IndentAction:EW,CompletionTriggerKind:_W,SignatureHelpTriggerKind:QW,InlayHintKind:DW,InlineCompletionTriggerKind:MW,CodeActionTriggerType:fW,NewSymbolNameTag:HW,NewSymbolNameTriggerKind:VW,PartialAcceptTriggerKind:$W,HoverVerbosityAction:IW,InlineCompletionEndOfLifeReasonKind:TW,InlineCompletionHintStyle:RW,FoldingRangeKind:yg,SelectedSuggestionInfo:xge,EditDeltaInfo:VE}}const gX=mt("IEditorCancelService"),v1e=new Se("cancellableOperation",!1,_(939,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));Lt(gX,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=v1e.bindTo(s.get(Xe)),r=new qo;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class kJe extends Bi{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(gX).add(e,this))}dispose(){this._unregister(),super.dispose()}}ye(new class extends hs{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:v1e})}runEditorCommand(n,e){n.get(gX).cancel(e)}});let w1e=class r${constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Z1("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof r$))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new r$(e,this.flags))}};class Mg extends kJe{constructor(e,t,i,s){super(e,s),this._listener=new ne,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!D.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!D.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class pX extends Bi{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}class IS{static _handleEolEdits(e,t){let i;const s=[];for(const o of t)typeof o.eol=="number"&&(i=o.eol),o.range&&typeof o.text=="string"&&s.push(o);return typeof i=="number"&&e.hasModel()&&e.getModel().pushEOL(i),s}static _isFullModelReplaceEdit(e,t){if(!e.hasModel())return!1;const i=e.getModel(),s=i.validateRange(t.range);return i.getFullModelRange().equalsRange(s)}static execute(e,t,i){i&&e.pushUndoStop();const s=oh.capture(e),o=IS._handleEolEdits(e,t);o.length===1&&IS._isFullModelReplaceEdit(e,o[0])?e.executeEdits("formatEditsCommand",o.map(r=>ln.replace(D.lift(r.range),r.text))):e.executeEdits("formatEditsCommand",o.map(r=>ln.replaceMove(D.lift(r.range),r.text))),i&&e.pushUndoStop(),s.restoreRelativeVerticalPositionOfCursor(e)}}class eae{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class IJe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(eae.toKey(e))}has(e){return this._set.has(eae.toKey(e))}}function C1e(n,e,t){const i=[],s=new IJe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}const bI=class bI{static setFormatterSelector(e){return{dispose:bI._selectors.unshift(e)}}static async select(e,t,i,s){if(e.length===0)return;const o=Dt.first(bI._selectors);if(o)return await o(e,t,i,s)}};bI._selectors=new qo;let hN=bI;async function y1e(n,e,t,i,s,o,r){const a=n.get(Ae),{documentRangeFormattingEditProvider:l}=n.get(De),c=rh(e)?e.getModel():e,d=l.ordered(c),h=await hN.select(d,c,i,2);h&&(s.report(h),await a.invokeFunction(EJe,h,e,t,o,r))}async function EJe(n,e,t,i,s,o){var b,v;const r=n.get(Qr),a=n.get(Li),l=n.get(Kg);let c,d;rh(t)?(c=t.getModel(),d=new Mg(t,5,void 0,s)):(c=t,d=new pX(t,s));const h=[];let u=0;for(const w of CG(i).sort(D.compareRangesUsingStarts))u>0&&D.areIntersectingOrTouching(h[u-1],w)?h[u-1]=D.fromPositions(h[u-1].getStartPosition(),w.getEndPosition()):u=h.push(w);const f=async w=>{var S,L;a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(S=e.extensionId)==null?void 0:S.value,w);const C=await e.provideDocumentRangeFormattingEdits(c,w,c.getFormattingOptions(),d.token)||[];return a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(L=e.extensionId)==null?void 0:L.value,C),C},g=(w,C)=>{if(!w.length||!C.length)return!1;const S=w.reduce((L,x)=>D.plusRange(L,x.range),w[0].range);if(!C.some(L=>D.intersectRanges(S,L.range)))return!1;for(const L of w)for(const x of C)if(D.intersectRanges(L.range,x.range))return!0;return!1},p=[],m=[];try{if(typeof e.provideDocumentRangesFormattingEdits=="function"){a.trace("[format][provideDocumentRangeFormattingEdits] (request)",(b=e.extensionId)==null?void 0:b.value,h);const w=await e.provideDocumentRangesFormattingEdits(c,h,c.getFormattingOptions(),d.token)||[];a.trace("[format][provideDocumentRangeFormattingEdits] (response)",(v=e.extensionId)==null?void 0:v.value,w),m.push(w)}else{for(const w of h){if(d.token.isCancellationRequested)return!0;m.push(await f(w))}for(let w=0;w({text:S.text,range:D.lift(S.range),forceMoveMarkers:!0})),S=>{for(const{range:L}of S)if(D.areIntersectingOrTouching(L,C))return[new Ie(L.startLineNumber,L.startColumn,L.endLineNumber,L.endColumn)];return null})}return l.playSignal(ur.format,{userGesture:o}),!0}async function NJe(n,e,t,i,s,o){const r=n.get(Ae),a=n.get(De),l=rh(e)?e.getModel():e,c=C1e(a.documentFormattingEditProvider,a.documentRangeFormattingEditProvider,l),d=await hN.select(c,l,t,1);d&&(i.report(d),await r.invokeFunction(DJe,d,e,t,s,o))}async function DJe(n,e,t,i,s,o){const r=n.get(Qr),a=n.get(Kg);let l,c;rh(t)?(l=t.getModel(),c=new Mg(t,5,void 0,s)):(l=t,c=new pX(t,s));let d;try{const h=await e.provideDocumentFormattingEdits(l,l.getFormattingOptions(),c.token);if(d=await r.computeMoreMinimalEdits(l.uri,h),c.token.isCancellationRequested)return!0}finally{c.dispose()}if(!d||d.length===0)return!1;if(rh(t))IS.execute(t,d,i!==2),i!==2&&t.revealPositionInCenterIfOutsideViewport(t.getPosition(),1);else{const[{range:h}]=d,u=new Ie(h.startLineNumber,h.startColumn,h.endLineNumber,h.endColumn);l.pushEditOperations([u],d.map(f=>({text:f.text,range:D.lift(f.range),forceMoveMarkers:!0})),f=>{for(const{range:g}of f)if(D.areIntersectingOrTouching(g,u))return[new Ie(g.startLineNumber,g.startColumn,g.endLineNumber,g.endColumn)];return null})}return a.playSignal(ur.format,{userGesture:o}),!0}async function TJe(n,e,t,i,s,o){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=await Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(On);if(Yo(l))return await n.computeMoreMinimalEdits(t.uri,l)}}async function RJe(n,e,t,i,s){const o=C1e(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=await Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(On);if(Yo(a))return await n.computeMoreMinimalEdits(t.uri,a)}}function S1e(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(On).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Rt.registerCommand("_executeFormatRangeProvider",async function(n,...e){const[t,i,s]=e;Ft(He.isUri(t)),Ft(D.isIRange(i));const o=n.get(Qo),r=n.get(Qr),a=n.get(De),l=await o.createModelReference(t);try{return TJe(r,a,l.object.textEditorModel,D.lift(i),s,wt.None)}finally{l.dispose()}});Rt.registerCommand("_executeFormatDocumentProvider",async function(n,...e){const[t,i]=e;Ft(He.isUri(t));const s=n.get(Qo),o=n.get(Qr),r=n.get(De),a=await s.createModelReference(t);try{return RJe(o,r,a.object.textEditorModel,i,wt.None)}finally{a.dispose()}});Rt.registerCommand("_executeFormatOnTypeProvider",async function(n,...e){const[t,i,s,o]=e;Ft(He.isUri(t)),Ft(U.isIPosition(i)),Ft(typeof s=="string");const r=n.get(Qo),a=n.get(Qr),l=n.get(De),c=await r.createModelReference(t);try{return S1e(a,l,c.object.textEditorModel,U.lift(i),s,o,wt.None)}finally{c.dispose()}});jo.wrappingIndent.defaultValue=0;jo.glyphMargin.defaultValue=!1;jo.autoIndent.defaultValue=3;jo.overviewRulerLanes.defaultValue=2;hN.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const xr=Lge();xr.editor=PQe();xr.languages=LJe();const x1e=xr.CancellationTokenSource,L1e=xr.Emitter,k1e=xr.KeyCode,I1e=xr.KeyMod,E1e=xr.Position,N1e=xr.Range,D1e=xr.Selection,T1e=xr.SelectionDirection,Vk=xr.MarkerSeverity,R1e=xr.MarkerTag,M1e=xr.Uri,A1e=xr.Token,zk=xr.editor,w0=xr.languages,z9=HG(),Cy=globalThis;(z9!=null&&z9.globalAPI||typeof Cy.define=="function"&&Cy.define.amd)&&(Cy.monaco=xr);typeof Cy.require<"u"&&typeof Cy.require.config=="function"&&Cy.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const MJe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:x1e,Emitter:L1e,KeyCode:k1e,KeyMod:I1e,MarkerSeverity:Vk,MarkerTag:R1e,Position:E1e,Range:N1e,Selection:D1e,SelectionDirection:T1e,Token:A1e,Uri:M1e,editor:zk,languages:w0},Symbol.toStringTag,{value:"Module"}));function AJe(){return MJe}const j9=globalThis.MonacoEnvironment;j9!=null&&j9.globalAPI&&(globalThis.monaco=AJe());const PJe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:x1e,Emitter:L1e,KeyCode:k1e,KeyMod:I1e,MarkerSeverity:Vk,MarkerTag:R1e,Position:E1e,Range:N1e,Selection:D1e,SelectionDirection:T1e,Token:A1e,Uri:M1e,editor:zk,languages:w0},Symbol.toStringTag,{value:"Module"}));function OJe(n){return new Worker("/editor.worker-CKy7Pnvo.js",{name:n==null?void 0:n.name})}const FJe="modulepreload",BJe=function(n){return"/"+n},tae={},WJe=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.allSettled(t.map(l=>{if(l=BJe(l),l in tae)return;tae[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":FJe,c||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((u,f)=>{h.addEventListener("load",u),h.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return s.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};class HJe extends Ps{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:ie(85,"Toggle Collapse Unchanged Regions"),icon:de.map,toggled:le.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:le.has("isInDiffEditor"),menu:{when:le.has("isInDiffEditor"),id:Te.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",s)}}class P1e extends Ps{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:ie(86,"Toggle Show Moved Code Blocks"),precondition:le.has("isInDiffEditor")})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",s)}}class O1e extends Ps{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:ie(87,"Toggle Use Inline View When Space Is Limited"),precondition:le.has("isInDiffEditor")})}run(e,...t){const i=e.get(lt),s=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",s)}}const PD=ie(88,"Diff Editor");class VJe extends Jc{constructor(){super({id:"diffEditor.switchSide",title:ie(89,"Switch Side"),icon:de.arrowSwap,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,i){const s=jw(e);if(s instanceof Eu){if(i&&i.dryRun)return{destinationSelection:s.mapToOtherSide().destinationSelection};s.switchSide()}}}class zJe extends Jc{constructor(){super({id:"diffEditor.exitCompareMove",title:ie(90,"Exit Compare Move"),icon:de.close,precondition:H.comparingMovedCode,f1:!1,category:PD,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const s=jw(e);s instanceof Eu&&s.exitCompareMove()}}class jJe extends Jc{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:ie(91,"Collapse All Unchanged Regions"),icon:de.fold,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,...i){const s=jw(e);s instanceof Eu&&s.collapseAllUnchangedRegions()}}class $Je extends Jc{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:ie(92,"Show All Unchanged Regions"),icon:de.unfold,precondition:le.has("isInDiffEditor"),f1:!0,category:PD})}runEditorCommand(e,t,...i){const s=jw(e);s instanceof Eu&&s.showAllUnchangedRegions()}}class a$ extends Ps{constructor(){super({id:"diffEditor.revert",title:ie(93,"Revert"),f1:!0,category:PD,precondition:le.has("isInDiffEditor")})}run(e,t){return t?this.runViaToolbarContext(e,t):this.runViaCursorOrSelection(e)}runViaCursorOrSelection(e){const t=jw(e);t instanceof Eu&&t.revertFocusedRangeMappings()}runViaToolbarContext(e,t){const i=UJe(e,t.originalUri,t.modifiedUri);i instanceof Eu&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const F1e=ie(94,"Accessible Diff Viewer"),lF=class lF extends Ps{constructor(){super({id:lF.id,title:ie(95,"Go to Next Difference"),category:F1e,precondition:le.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=jw(e);t==null||t.accessibleDiffViewerNext()}};lF.id="editor.action.accessibleDiffViewer.next";let uN=lF;const cF=class cF extends Ps{constructor(){super({id:cF.id,title:ie(96,"Go to Previous Difference"),category:F1e,precondition:le.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=jw(e);t==null||t.accessibleDiffViewerPrev()}};cF.id="editor.action.accessibleDiffViewer.prev";let JP=cF;function UJe(n,e,t){return n.get(Bt).listDiffEditors().find(o=>{var l,c;const r=o.getModifiedEditor(),a=o.getOriginalEditor();return r&&((l=r.getModel())==null?void 0:l.uri.toString())===t.toString()&&a&&((c=a.getModel())==null?void 0:c.uri.toString())===e.toString()})||null}function jw(n){const t=n.get(Bt).listDiffEditors(),i=as();if(i){for(const s of t)if(s.getContainerDomNode().contains(i))return s}return null}ni(HJe);ni(P1e);ni(O1e);Rs.appendMenuItem(Te.EditorTitle,{command:{id:new O1e().desc.id,title:_(119,"Use Inline View When Space Is Limited"),toggled:le.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:le.has("isInDiffEditor")},order:11,group:"1_diff",when:le.and(H.diffEditorRenderSideBySideInlineBreakpointReached,le.has("isInDiffEditor"))});Rs.appendMenuItem(Te.EditorTitle,{command:{id:new P1e().desc.id,title:_(120,"Show Moved Code Blocks"),icon:de.move,toggled:ZS.create("config.diffEditor.experimental.showMoves",!0),precondition:le.has("isInDiffEditor")},order:10,group:"1_diff",when:le.has("isInDiffEditor")});ni(a$);for(const n of[{icon:de.arrowRight,key:H.diffEditorInlineMode.toNegated()},{icon:de.discard,key:H.diffEditorInlineMode}])Rs.appendMenuItem(Te.DiffEditorHunkToolbar,{command:{id:new a$().desc.id,title:_(121,"Revert Block"),icon:n.icon},when:le.and(H.diffEditorModifiedWritable,n.key),order:5,group:"primary"}),Rs.appendMenuItem(Te.DiffEditorSelectionToolbar,{command:{id:new a$().desc.id,title:_(122,"Revert Selection"),icon:n.icon},when:le.and(H.diffEditorModifiedWritable,n.key),order:5,group:"primary"});ni(VJe);ni(zJe);ni(jJe);ni($Je);Rs.appendMenuItem(Te.EditorTitle,{command:{id:uN.id,title:_(123,"Open Accessible Diff Viewer"),precondition:le.has("isInDiffEditor")},order:10,group:"2_diff",when:le.and(H.accessibleDiffViewerVisible.negate(),le.has("isInDiffEditor"))});Rt.registerCommandAlias("editor.action.diffReview.next",uN.id);ni(uN);Rt.registerCommandAlias("editor.action.diffReview.prev",JP.id);ni(JP);var qJe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},KJe=function(n,e){return function(t,i){e(t,i,n)}},l$;const $3=new Se("selectionAnchorSet",!1);var Yv;let d_=(Yv=class{static get(e){return e.getContribution(l$.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=$3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(Ie.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Co().appendText(_(798,"Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),vr(_(799,"Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(Ie.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},l$=Yv,Yv.ID="editor.contrib.selectionAnchorController",Yv);d_=l$=qJe([KJe(1,Xe)],d_);class GJe extends Ne{constructor(){super({id:"editor.action.setSelectionAnchor",label:ie(800,"Set Selection Anchor"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2080),weight:100}})}async run(e,t){var i;(i=d_.get(t))==null||i.setSelectionAnchor()}}class YJe extends Ne{constructor(){super({id:"editor.action.goToSelectionAnchor",label:ie(801,"Go to Selection Anchor"),precondition:$3})}async run(e,t){var i;(i=d_.get(t))==null||i.goToSelectionAnchor()}}class ZJe extends Ne{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:ie(802,"Select from Anchor to Cursor"),precondition:$3,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2089),weight:100}})}async run(e,t){var i;(i=d_.get(t))==null||i.selectFromAnchorToCursor()}}class XJe extends Ne{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:ie(803,"Cancel Selection Anchor"),precondition:$3,kbOpts:{kbExpr:H.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=d_.get(t))==null||i.cancelSelectionAnchor()}}At(d_.ID,d_,4);we(GJe);we(YJe);we(ZJe);we(XJe);const QJe=F("editorOverviewRuler.bracketMatchForeground","#A0A0A0",_(804,"Overview ruler marker color for matching brackets."));class JJe extends Ne{constructor(){super({id:"editor.action.jumpToBracket",label:ie(806,"Go to Bracket"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=gw.get(t))==null||i.jumpToBracket()}}class eet extends Ne{constructor(){super({id:"editor.action.selectToBracket",label:ie(807,"Select to Bracket"),precondition:void 0,metadata:{description:ie(808,"Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var o;let s=!0;i&&i.selectBrackets===!1&&(s=!1),(o=gw.get(t))==null||o.selectToBracket(s)}}class tet extends Ne{constructor(){super({id:"editor.action.removeBrackets",label:ie(809,"Remove Brackets"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2561,weight:100},canTriggerInlineEdits:!0})}run(e,t){var i;(i=gw.get(t))==null||i.removeBrackets(this.id)}}class iet{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const Ep=class Ep extends G{static get(e){return e.getContribution(Ep.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new ai(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(80),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(80)&&(this._matchBrackets=this._editor.getOption(80),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new Ie(r.lineNumber,r.column,r.lineNumber,r.column):new Ie(s.lineNumber,s.column,s.lineNumber,s.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(D.compareRangesUsingStarts);const[c,d]=r;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?d.getEndPosition():d.getStartPosition(),d.containsPosition(o)){const h=a;a=l,l=h}}a&&l&&i.push(new Ie(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let h=0,u=e.length;h1&&o.sort(U.compare);const a=[];let l=0,c=0;const d=s.length;for(let h=0,u=o.length;h0&&(t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop())}}we(ret);const aet=mt("productService");function mX(n,e){return{id:e,asString:async()=>n,asFile:()=>{},value:typeof n=="string"?n:void 0}}function cet(n,e,t,i){const s={id:Ow(),name:n,uri:e,data:t};return{id:i,asString:async()=>"",asFile:()=>s,value:void 0}}class W1e{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return Dt.some(this,([i,s])=>s.asFile())&&t.push("files"),H1e(eO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return eO(e)}}function eO(n){return n.toLowerCase()}function iae(n,e){return H1e(eO(n),e.map(eO))}function H1e(n,e){if(n==="*/*")return e.length>0;if(e.includes(n))return!0;const t=n.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,s,o]=t;return o==="*"?e.some(r=>r.startsWith(s+"/")):!1}const U3=Object.freeze({create:n=>bg(n.map(e=>e.toString())).join(`\r `),split:n=>n.split(`\r -`),parse:n=>U3.split(n).filter(e=>!e.startsWith("#"))}),Fh=class Fh{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Fh.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Fh((this.value?[this.value,...e]:e).join(Fh.sep))}};Fh.sep=".",Fh.None=new Fh("@@none@@"),Fh.Empty=new Fh("");let Qi=Fh;const oae={EDITORS:"CodeEditors",FILES:"CodeFiles"};class uet{}const fet={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ji.add(fet.DragAndDropContribution,new uet);const vE=class vE{constructor(){}static getInstance(){return vE.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};vE.INSTANCE=new vE;let d$=vE;function U1e(n){var e,t,i,s;if(Yd&&typeof((t=(e=globalThis.vscode)==null?void 0:e.webUtils)==null?void 0:t.getPathForFile)=="function")return(s=(i=globalThis.vscode)==null?void 0:i.webUtils)==null?void 0:s.getPathForFile(n)}function q1e(n){const e=new j1e;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,_X(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,get(s))}}return e}function get(n){const e=U1e(n),t=e?He.parse(e):void 0;return het(n.name,t,async()=>new Uint8Array(await n.arrayBuffer()))}const pet=Object.freeze([oae.EDITORS,oae.FILES,uw.RESOURCES,uw.INTERNAL_URI_LIST]);function K1e(n,e=!1){const t=q1e(n),i=t.get(uw.INTERNAL_URI_LIST);if(i)t.replace(mn.uriList,i);else if(e||!t.has(mn.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=U1e(r);try{a?s.push(He.file(a).toString()):s.push(He.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(mn.uriList,_X(U3.create(s)))}for(const s of pet)t.delete(s);return t}var met=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_et=function(n,e){return function(t,i){e(t,i,n)}};const bet=nt.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Wge,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),dF=class dF extends G{constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=me(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=me("span.icon");this.domNode.append(t),t.classList.add(...Ue.asClassNameArray(de.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(75);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(61)||s.hasChanged(75))&&i()})),this._register(J(this.domNode,_e.CLICK,s=>{this.delegate.cancel()}))}getId(){return dF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};dF.baseId="editor.widget.inlineProgressWidget";let h$=dF,tO=class extends G{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Kt),this._currentWidget=this._register(new Kt),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,s,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=kg(()=>{const a=D.fromPositions(e);this._currentDecorations.set([{range:a,options:bet}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(h$,this.id,this._editor,a,t,s))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};tO=met([_et(2,Ae)],tO);var vet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rae=function(n,e){return function(t,i){e(t,i,n)}},JR,Am;let _a=(Am=class{static get(e){return e.getContribution(JR.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Kt,this._messageListeners=new ne,this._mouseOverMessage=!1,this._editor=e,this._visible=JR.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(_r(cg(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),cg(e)){const s=this._messageListeners.add(ED(e,{actionHandler:(o,r)=>{this.closeMessage(),jbe(this._openerService,o,r.isTrusted)}}));this._messageWidget.value=new $9(this._editor,t,s.element)}else this._messageWidget.value=new $9(this._editor,t,e);this._messageListeners.add(ve.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Cs(os(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),_e.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),_e.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new D(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add($9.fadeOut(this._messageWidget.value))}},JR=Am,Am.ID="editor.contrib.messageController",Am.MESSAGE_VISIBLE=new Se("messageVisible",!1,_(1287,"Whether the editor is currently showing an inline message")),Am);_a=JR=vet([rae(1,Xe),rae(2,jg)],_a);const wet=cs.bindToContribution(_a.get);ye(new wet({id:"leaveEditorMessage",precondition:_a.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let $9=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};At(_a.ID,_a,4);var bX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fN=function(n,e){return function(t,i){e(t,i,n)}};class vX{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,s,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const hF=class hF extends vX{constructor(){super(Qi.Empty.append("text","plain")),this.id=hF.id,this.dropMimeTypes=[mn.text],this.pasteMimeTypes=[mn.text]}async getEdit(e,t){const i=e.get(mn.text);if(!i||e.has(mn.uriList))return;const s=await i.asString();return{handledMimeType:mn.text,title:_(926,"Insert Plain Text"),insertText:s,kind:this.kind}}};hF.id="text";let bw=hF;class G1e extends vX{constructor(){super(Qi.Empty.append("uri","path","absolute")),this.dropMimeTypes=[mn.uriList],this.pasteMimeTypes=[mn.uriList]}async getEdit(e,t){const i=await Y1e(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Ge.file?a.fsPath:(s++,l)).join(" ");let r;return s>0?r=i.length>1?_(927,"Insert Uris"):_(928,"Insert Uri"):r=i.length>1?_(929,"Insert Paths"):_(930,"Insert Path"),{handledMimeType:mn.uriList,insertText:o,title:r,kind:this.kind}}}let iO=class extends vX{constructor(e){super(Qi.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[mn.uriList],this.pasteMimeTypes=[mn.uriList]}async getEdit(e,t){const i=await Y1e(e);if(!i.length||t.isCancellationRequested)return;const s=rh(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?Z4e(r.uri,o):void 0}));if(s.length)return{handledMimeType:mn.uriList,insertText:s.join(" "),title:i.length>1?_(931,"Insert Relative Paths"):_(932,"Insert Relative Path"),kind:this.kind}}};iO=bX([fN(0,Rg)],iO);class Cet{constructor(){this.kind=new Qi("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:mn.text}]}async provideDocumentPasteEdits(e,t,i,s,o){var l;if(s.triggerKind!==nI.PasteAs&&!((l=s.only)!=null&&l.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:_(933,"Insert HTML"),kind:this.kind}]}}}async function Y1e(n){const e=n.get(mn.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of U3.parse(t))try{i.push({uri:He.parse(s),originalText:s})}catch{}return i}const bv={scheme:"*",hasAccessToAllModels:!0};let u$=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(bv,new bw)),this._register(e.documentDropEditProvider.register(bv,new G1e)),this._register(e.documentDropEditProvider.register(bv,new iO(t)))}};u$=bX([fN(0,De),fN(1,Rg)],u$);let f$=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(bv,new bw)),this._register(e.documentPasteEditProvider.register(bv,new G1e)),this._register(e.documentPasteEditProvider.register(bv,new iO(t))),this._register(e.documentPasteEditProvider.register(bv,new Cet))}};f$=bX([fN(0,De),fN(1,Rg)],f$);const Ec=class Ec{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=Ec._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(Ec.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ec.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(Ec.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(Ec.isVariableCharacter(i)||Ec.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ec._table[i]>"u"&&!Ec.isDigitCharacter(i)&&!Ec.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};Ec._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let g$=Ec;class gx{constructor(){this._children=[]}appendChild(e){return e instanceof ur&&this._children[this._children.length-1]instanceof ur?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,function r(a,l){for(const c of a)c.parent=l,r(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof OD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class ur extends gx{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new ur(this.value)}}class Z1e extends gx{}class Bl extends Z1e{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof px?this._children[0]:void 0}clone(){const e=new Bl(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class px extends gx{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof ur&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new px;return this.options.forEach(e.appendChild,e),e}}class wX extends gx{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof xd&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof xd){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new wX;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class xd extends gx{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new xd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class gN extends Z1e{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new ur(t)],!0):!1}clone(){const e=new gN(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function aae(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class OD extends gx{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Bl&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return aae([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Bl&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gN&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new OD;return this._children=this.children.map(t=>t.clone()),e}walk(e){aae(this.children,e)}}class vw{constructor(){this._scanner=new g$,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new OD;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(l=>(l instanceof Bl&&(l.isFinalTabstop?s.set(0,void 0):!s.has(l.index)&&l.children.length>0?s.set(l.index,l.children):o.push(l)),!0));const r=(l,c)=>{const d=s.get(l.index);if(!d)return;const h=new Bl(l.index);h.transform=l.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof Bl&&s.has(f.index)&&!c.has(f.index)&&(c.add(f.index),r(f,c),c.delete(f.index))}t.replace(l,[h])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Bl(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ur(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Bl(Number(t)):new gN(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Bl(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new ur("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new px;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new ur(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new gN(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new ur("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new wX;let i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new ur(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new xd(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new xd(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new xd(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new xd(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new xd(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new xd(Number(s),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new xd(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new ur(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function X1e(n,e,t){var i,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(o=>new Em(n,{range:o,text:typeof t.insertText=="string"?vw.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((s=t.additionalEdit)==null?void 0:s.edits)??[]]}}function Q1e(n){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of n)for(const a of r.yieldTo??[])for(const l of n)if(l!==r&&e(a,l)){let c=t.get(r);c||(c=[],t.set(r,c)),c.push(l)}if(!t.size)return Array.from(n);const i=new Set,s=[];function o(r){if(!r.length)return[];const a=r[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let l=[];const c=t.get(a);return c&&(s.push(a),l=o(c),s.pop()),i.add(a),[...l,a,...o(r.slice(1))]}return o(Array.from(n))}function U9(n,e){return e&&(n.stack||n.stacktrace)?_(29,"{0}: {1}",cae(n),lae(n.stack)||lae(n.stacktrace)):cae(n)}function lae(n){return Array.isArray(n)?n.join(` -`):n}function cae(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?_(30,"A system error occurred ({0})",n.message):n.message||_(31,"An unknown error occurred. Please consult the log for more details.")}function nO(n=null,e=!1){if(!n)return _(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=rh(n),i=nO(t[0],e);return t.length>1?_(33,"{0} ({1} errors in total)",i,t.length):i}if(ws(n))return n;if(n.detail){const t=n.detail;if(t.error)return U9(t.error,e);if(t.exception)return U9(t.exception,e)}return n.stack?U9(n,e):n.message?n.message:_(34,"An unknown error occurred. Please consult the log for more details.")}var J1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eM=function(n,e){return function(t,i){e(t,i,n)}};const ewe="acceptSelectedCodeAction",twe="previewSelectedCodeAction";class yet{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s;i.text.textContent=((s=e.group)==null?void 0:s.title)??e.label??""}disposeTemplate(e){}}class xet{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let p$=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=document.createElement("span");s.className="description",e.append(s);const o=new hx(e,ha);return{container:e,icon:t,text:i,description:s,keybinding:o}}renderElement(e,t,i){var r,a,l;if((r=e.group)!=null&&r.icon?(i.icon.className=Ue.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=pe(e.group.icon.color.id))):(i.icon.className=Ue.asClassName(de.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;r4e(!e.hideIcon,i.icon),i.text.textContent=sO(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=sO(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const s=(a=this._keybindingService.lookupKeybinding(ewe))==null?void 0:a.getLabel(),o=(l=this._keybindingService.lookupKeybinding(twe))==null?void 0:l.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:s&&o?this._supportsPreview&&e.canPreview?i.container.title=_(1653,"{0} to Apply, {1} to Preview",s,o):i.container.title=_(1654,"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};p$=J1e([eM(1,Ht)],p$);class Let extends UIEvent{constructor(){super("acceptSelectedAction")}}class dae extends UIEvent{constructor(){super("previewSelectedAction")}}function ket(n){if(n.kind==="action")return n.label}let m$=class extends G{constructor(e,t,i,s,o,r,a,l){super(),this._delegate=s,this._contextViewService=r,this._keybindingService=a,this._layoutService=l,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new Wi),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const c={getHeight:d=>{switch(d.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:d=>d.kind};this._list=this._register(new pl(e,this.domNode,c,[new p$(t,this._keybindingService),new yet,new xet],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:ket},accessibilityProvider:{getAriaLabel:d=>{if(d.kind==="action"){let h=d.label?sO(d==null?void 0:d.label):"";return d.description&&(h=h+", "+sO(d.description)),d.disabled&&(h=_(1655,"{0}, Disabled Reason: {1}",h,d.disabled)),h}return null},getWidgetAriaLabel:()=>_(1656,"Action Widget"),getRole:d=>{switch(d.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...o}})),this._list.style(dx),this._register(this._list.onMouseClick(d=>this.onListClick(d))),this._register(this._list.onMouseOver(d=>this.onListHover(d))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(d=>this.onListSelection(d))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(d=>d.kind==="header").length,i=this._allMenuItems.filter(d=>d.kind==="separator").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(r);let a=e;if(this._allMenuItems.length>=50)a=380;else{const d=this._allMenuItems.map((h,u)=>{const f=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(f){f.style.width="auto";const g=f.getBoundingClientRect().width;return f.style.width="",g}return 0});a=Math.max(...d,e)}const c=Math.min(r,this._layoutService.getContainer(Oe(this.domNode)).clientHeight*.7);return this._list.layout(c,a),this.domNode.style.height=`${c}px`,this._list.domFocus(),a}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new dae:new Let;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof dae):this._list.setSelection([])}onFocus(){var s,o;const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);(o=(s=this._delegate).onFocus)==null||o.call(s,i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};m$=J1e([eM(5,zg),eM(6,Ht),eM(7,Mu)],m$);function sO(n){return n.replace(/\r\n|\r|\n/g," ")}var Eet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q9=function(n,e){return function(t,i){e(t,i,n)}};F("actionBar.toggledBackground",ox,_(1657,"Background color for toggled action items in action bar."));const ww={Visible:new Se("codeActionMenuVisible",!1,_(1658,"Whether the action widget list is visible"))},x_=mt("actionWidgetService");let Cw=class extends G{get isVisible(){return ww.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Kt)}show(e,t,i,s,o,r,a,l){const c=ww.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(m$,e,t,i,s,l);this._contextViewService.showContextView({getAnchor:()=>o,render:h=>(c.set(!0),this._renderWidget(h,d,a??[])),onHide:h=>{c.reset(),this._onWidgetClosed(h)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)==null||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusNext()}hide(e){var t;(t=this._list.value)==null||t.hide(e),this._list.clear()}_renderWidget(e,t,i){var f;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new ne,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(J(a,_e.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),o.add(J(c,_e.POINTER_MOVE,()=>c.remove())),o.add(J(c,_e.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(s.appendChild(g.getContainer().parentElement),o.add(g),d=g.getContainer().offsetWidth)}const h=(f=this._list.value)==null?void 0:f.layout(d);s.style.width=`${h}px`;const u=o.add(oc(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=me(e),s=new Vr(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)==null||t.hide(e)}};Cw=Eet([q9(0,zg),q9(1,Xe),q9(2,Ae)],Cw);xt(x_,Cw,1);const FD=1100;ni(class extends Ps{constructor(){super({id:"hideCodeActionWidget",title:ie(1659,"Hide action widget"),precondition:ww.Visible,keybinding:{weight:FD,primary:9,secondary:[1033]}})}run(n){n.get(x_).hide(!0)}});ni(class extends Ps{constructor(){super({id:"selectPrevCodeAction",title:ie(1660,"Select previous action"),precondition:ww.Visible,keybinding:{weight:FD,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(x_);e instanceof Cw&&e.focusPrevious()}});ni(class extends Ps{constructor(){super({id:"selectNextCodeAction",title:ie(1661,"Select next action"),precondition:ww.Visible,keybinding:{weight:FD,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(x_);e instanceof Cw&&e.focusNext()}});ni(class extends Ps{constructor(){super({id:ewe,title:ie(1662,"Accept selected action"),precondition:ww.Visible,keybinding:{weight:FD,primary:3,secondary:[2137]}})}run(n){const e=n.get(x_);e instanceof Cw&&e.acceptSelected()}});ni(class extends Ps{constructor(){super({id:twe,title:ie(1663,"Preview selected action"),precondition:ww.Visible,keybinding:{weight:FD,primary:2051}})}run(n){const e=n.get(x_);e instanceof Cw&&e.acceptSelected(!0)}});var iwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xy=function(n,e){return function(t,i){e(t,i,n)}},_$,Jv;let b$=(Jv=class extends G{constructor(e,t,i,s,o,r,a,l,c,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this.additionalActions=l,this._keybindingService=d,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(Re(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Re(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{this.dispose()})),this._register(ve.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=me(".post-edit-widget"),this.button=this._register(new EP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(J(this.domNode,_e.CLICK,()=>this.showSelector()))}getId(){return _$.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=dn(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,s)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:Ue.fromId(s===this.edits.activeEditIndex?de.check.id:de.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);const s=this.edits.allEdits.findIndex(o=>o===i);if(s!==this.edits.activeEditIndex)return this.onSelectNewEdit(s)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}},_$=Jv,Jv.baseId="editor.widget.postEditWidget",Jv);b$=_$=iwe([xy(8,Xe),xy(9,Ht),xy(10,x_)],b$);let oO=class extends G{constructor(e,t,i,s,o,r,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._getAdditionalActions=o,this._instantiationService=r,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new Kt),this._register(ve.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){if(!e.length||!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async b=>{const v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:b,allEdits:t.allEdits},i,s,o))},c=(b,v)=>{fl(b)||(this._notificationService.error(v),i&&this.show(e[0],t,l))},d=new Mg(this._editor,3,void 0,o);let h;try{h=await sOe(s(a,d.token),d.token)}catch(b){return c(b,_(937,`Error resolving edit '{0}': -{1}`,a.title,nO(b)))}finally{d.dispose()}if(o.isCancellationRequested)return;const u=X1e(r.uri,e,h),f=e[0],g=r.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(u,{editor:this._editor,token:o}),m=r.getDecorationRange(g[0])}catch(b){return c(b,_(938,`Error applying edit '{0}': -{1}`,a.title,nO(b)))}finally{r.deltaDecorations(g,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??f,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(b$,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)==null||e.showSelector()}};oO=iwe([xy(5,Ae),xy(6,ID),xy(7,fn)],oO);var Iet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qu=function(n,e){return function(t,i){e(t,i,n)}},xc;const nwe="editor.changePasteType",Net="editor.pasteAs.preferences",CX=new Se("pasteWidgetVisible",!1,_(917,"Whether the paste widget is showing")),K9="application/vnd.code.copymetadata";var e1;let Ag=(e1=class extends G{static get(e){return e.getContribution(xc.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._logService=i,this._bulkEditService=s,this._clipboardService=o,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=c,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(J(h,"copy",u=>this.handleCopy(u))),this._register(J(h,"cut",u=>this.handleCopy(u))),this._register(J(h,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new tO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(oO,"pasteIntoEditor",e,CX,{id:nwe,label:_(918,"Show paste options...")},()=>xc._configureDefaultAction?[xc._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var m,b,v,w;let t=null;if(e.clipboardData){const[C,S]=Tv.getTextData(e.clipboardData),L=S||fu.INSTANCE.get(C);t=(L==null?void 0:L.id)||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",C.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||((b=(m=this._clipboardService).clearInternalState)==null||b.call(m),!e.clipboardData||!this.isPasteAsEnabled()))return;const i=this._editor.getModel(),s=this._editor.getSelections();if(!i||!(s!=null&&s.length))return;const o=this._editor.getOption(45);let r=s;const a=s.length===1&&s[0].isEmpty();if(a){if(!o)return;r=[new D(r[0].startLineNumber,1,r[0].startLineNumber,1+i.getLineLength(r[0].startLineNumber))]}const l=(v=this._editor._getViewModel())==null?void 0:v.getPlainTextToCopy(s,o,$s),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(C=>!!C.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const u=q1e(e.clipboardData),f=h.flatMap(C=>C.copyMimeTypes??[]),g=t??Ww();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:f,defaultPastePayload:d});const p=h.map(C=>({providerMimeTypes:C.copyMimeTypes,operation:ss(S=>C.prepareDocumentPaste(i,r,u,S).catch(L=>{console.error(L)}))}));(w=xc._currentCopyOperation)==null||w.operations.forEach(C=>C.operation.cancel()),xc._currentCopyOperation={handle:g,operations:p}}async handlePaste(e){var c,d,h;if(e.clipboardData){const[u,f]=Tv.getTextData(e.clipboardData),g=f||fu.INSTANCE.get(u);this._logService.trace("CopyPasteController#handlePaste for id : ",g==null?void 0:g.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;(c=_a.get(this._editor))==null||c.closeMessage(),(d=this._currentPasteOperation)==null||d.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!(i!=null&&i.length)||!t||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",s==null?void 0:s.id," and text.length : ",e.clipboardData.getData("text/plain").length);const o=K1e(e.clipboardData);o.delete(K9);const r=Array.from(e.clipboardData.files).map(u=>u.type),a=[...e.clipboardData.types,...r,...(s==null?void 0:s.providerCopyMimeTypes)??[],mn.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(u=>{var g,p;const f=(g=this._pasteAsActionContext)==null?void 0:g.preferred;return f&&!this.providerMatchesPreference(u,f)?!1:(p=u.pasteMimeTypes)==null?void 0:p.some(m=>sae(m,a))});if(!l.length){(h=this._pasteAsActionContext)!=null&&h.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation());return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,l,i,o,s):this.doPasteInline(l,i,o,s,e)}showPasteAsNoEditMessage(e,t){var s;const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(o=>o.value).join(", "):_(919,"empty"):t.providerId;(s=_a.get(this._editor))==null||s.showMessage(_(920,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,s,o){this._logService.trace("CopyPasteController#doPasteInline");const r=this._editor;if(!r.hasModel())return;const a=new Mg(r,3,void 0),l=ss(async c=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new ne,f=u.add(new Wi(c));u.add(a.token.onCancellationRequested(()=>f.cancel()));const g=f.token;try{if(await this.mergeInDataFromCopy(e,i,s,g),g.isCancellationRequested)return;const p=e.filter(v=>this.isSupportedPasteProvider(v,i));if(!p.length||p.length===1&&p[0]instanceof bw)return this.applyDefaultPasteHandler(i,s,g,o);const m={triggerKind:nI.Automatic},b=await this.getPasteEdits(p,i,h,t,m,g);if(u.add(b),g.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof bw)return this.applyDefaultPasteHandler(i,s,g,o);if(b.edits.length){const v=d.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,b.edits),allEdits:b.edits},v,async(w,C)=>{if(!w.provider.resolveDocumentPasteEdit)return w;const S=w.provider.resolveDocumentPasteEdit(w,C),L=new Mw,x=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),_(921,"Resolving paste edit for '{0}'. Click to cancel",w.title),lS(Promise.race([L.p,S]),C),{cancel:()=>L.cancel()},0);return x&&(w.insertText=x.insertText,w.additionalEdit=x.additionalEdit),w},g)}await this.applyDefaultPasteHandler(i,s,g,o)}finally{u.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),_(922,"Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{l.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,s,a.token,o)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,s,o){this._logService.trace("CopyPasteController#showPasteAsPick");const r=ss(async a=>{var u;const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new ne,h=d.add(new Mg(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,s,o,h.token),h.token.isCancellationRequested)return;let f=t.filter(v=>this.isSupportedPasteProvider(v,s,e));e&&(f=f.filter(v=>this.providerMatchesPreference(v,e)));const g={triggerKind:nI.PasteAs,only:e&&"only"in e?e.only:void 0};let p=d.add(await this.getPasteEdits(f,s,c,i,g,h.token));if(h.token.isCancellationRequested)return;if(e&&(p={edits:p.edits.filter(v=>"only"in e?e.only.contains(v.kind):"preferences"in e?e.preferences.some(w=>w.contains(v.kind)):e.providerId===v.provider.id),dispose:p.dispose}),!p.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let m;if(e)m=p.edits.at(0);else{const v={id:"editor.pasteAs.default",label:_(923,"Configure default paste action"),edit:void 0},w=await this._quickInputService.pick([...p.edits.map(C=>{var S;return{label:C.title,description:(S=C.kind)==null?void 0:S.value,edit:C}}),...xc._configureDefaultAction?[{type:"separator"},{label:xc._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:_(924,"Select Paste Action")});if(w===v){(u=xc._configureDefaultAction)==null||u.run();return}m=w==null?void 0:w.edit}if(!m)return;const b=X1e(c.uri,i,m);await this._bulkEditService.apply(b,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:_(925,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(K9,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(K9);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=Tv.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i,s){var o;if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i==null?void 0:i.id),i!=null&&i.id&&((o=xc._currentCopyOperation)==null?void 0:o.handle)===i.id){const r=xc._currentCopyOperation.operations.filter(l=>e.some(c=>c.pasteMimeTypes.some(d=>sae(d,l.providerMimeTypes)))).map(l=>l.operation),a=await Promise.all(r);if(s.isCancellationRequested)return;for(const l of a.reverse())if(l)for(const[c,d]of l)t.replace(c,d)}if(!t.has(mn.uriList)){const r=await this._clipboardService.readResources();if(s.isCancellationRequested)return;r.length&&t.append(mn.uriList,_X(U3.create(r)))}}async getPasteEdits(e,t,i,s,o,r){const a=new ne,l=await lS(Promise.all(e.map(async d=>{var h,u;try{const f=await((h=d.provideDocumentPasteEdits)==null?void 0:h.call(d,i,s,t,o,r));return f&&a.add(f),(u=f==null?void 0:f.edits)==null?void 0:u.map(g=>({...g,provider:d}))}catch(f){fl(f)||console.error(f);return}})),r),c=rh(l??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return{edits:Q1e(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,s){const o=e.get(mn.text)??e.get("text"),r=await(o==null?void 0:o.asString())??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:r,pasteOnNewLine:(t==null?void 0:t.defaultPastePayload.pasteOnNewLine)??!1,multicursorText:(t==null?void 0:t.defaultPastePayload.multicursorText)??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t==null?void 0:t.id),this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){var s;return(s=e.pasteMimeTypes)!=null&&s.some(o=>t.matches(o))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?t.preferences.some(i=>t.preferences.some(s=>s.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Net,{resource:e.uri});for(const s of Array.isArray(i)?i:[]){const o=new Qi(s),r=t.findIndex(a=>o.contains(a.kind));if(r>=0)return r}return 0}},xc=e1,e1.ID="editor.contrib.copyPasteActionController",e1);Ag=xc=Iet([Qu(1,Ae),Qu(2,ki),Qu(3,ID),Qu(4,xa),Qu(5,Ei),Qu(6,lt),Qu(7,De),Qu(8,Do),Qu(9,Kbe)],Ag);const yw="9_cutcopypaste",Det=Yd||document.queryCommandSupported("cut"),swe=Yd||document.queryCommandSupported("copy"),Tet=typeof navigator.clipboard>"u"||$r?document.queryCommandSupported("paste"):!0;function yX(n){return n.register(),n}const Ret=Det?yX(new JS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Yd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(813,"Cu&&t"),order:1},{menuId:Te.EditorContext,group:yw,title:_(814,"Cut"),when:H.writable,order:1},{menuId:Te.CommandPalette,group:"",title:_(815,"Cut"),order:1},{menuId:Te.SimpleEditorContext,group:yw,title:_(816,"Cut"),when:H.writable,order:1}]})):void 0,Met=swe?yX(new JS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Yd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(817,"&&Copy"),order:2},{menuId:Te.EditorContext,group:yw,title:_(818,"Copy"),order:2},{menuId:Te.CommandPalette,group:"",title:_(819,"Copy"),order:1},{menuId:Te.SimpleEditorContext,group:yw,title:_(820,"Copy"),order:2}]})):void 0;Rs.appendMenuItem(Te.MenubarEditMenu,{submenu:Te.MenubarCopy,title:ie(825,"Copy As"),group:"2_ccp",order:3});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextCopy,title:ie(826,"Copy As"),group:yw,order:3});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextShare,title:ie(827,"Share"),group:"11_share",order:-1,when:le.and(le.notEquals("resourceScheme","output"),H.editorTextFocus)});Rs.appendMenuItem(Te.ExplorerContext,{submenu:Te.ExplorerContextShare,title:ie(828,"Share"),group:"11_share",order:-1});const G9=Tet?yX(new JS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Yd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(821,"&&Paste"),order:4},{menuId:Te.EditorContext,group:yw,title:_(822,"Paste"),when:H.writable,order:4},{menuId:Te.CommandPalette,group:"",title:_(823,"Paste"),order:1},{menuId:Te.SimpleEditorContext,group:yw,title:_(824,"Paste"),when:H.writable,order:4}]})):void 0;class Aet extends Ne{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:ie(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(ki);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(oV.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),oV.forceCopyWithSyntaxHighlighting=!1)}}function owe(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(ki);s.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");const o=t.get(Ft).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(45),a=o.getSelection();return a&&a.isEmpty()&&!r||(o.getOption(170)&&e==="cut"?(hae(o),s.trace("registerExecCommandImpl (before execCommand copy)"),o.getContainerDomNode().ownerDocument.execCommand("copy"),o.trigger(void 0,"cut",void 0),s.trace("registerExecCommandImpl (after execCommand copy)")):(hae(o),s.trace("registerExecCommandImpl (before execCommand "+e+")"),o.getContainerDomNode().ownerDocument.execCommand(e),s.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(ki);return s.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),s.trace("registerExecCommandImpl (before execCommand "+e+")"),uD().execCommand(e),s.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function hae(n){if(n.getOption(170)){const t=KY.get(n.getId());t&&t.onWillCopy()}}owe(Ret,"cut");owe(Met,"copy");G9&&(G9.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(ki);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const i=n.get(Ft),s=n.get(xa),o=n.get(Ro),r=n.get(det),a=i.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const h=KY.get(a.getId());h&&h.onWillPaste()}const c=xs.create(!0);t.trace("registerExecCommandImpl (before triggerPaste)");const d=s.triggerPaste(ii().vscodeWindowId);return d?(t.trace("registerExecCommandImpl (triggerPaste defined)"),d.then(async()=>{var h;if(t.trace("registerExecCommandImpl (after triggerPaste)"),r.quality!=="stable"){const u=c.elapsed();o.publicLog2("editorAsyncPaste",{duration:u})}return((h=Ag.get(a))==null?void 0:h.finishedPaste())??Promise.resolve()})):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),Du?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const h=await s.readText();if(h!==""){const u=fu.INSTANCE.get(h);let f=!1,g=null,p=null;u&&(f=a.getOption(45)&&!!u.isFromEmptySelection,g=typeof u.multicursorText<"u"?u.multicursorText:null,p=u.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",h.length," id : ",u==null?void 0:u.id,")"),a.trigger("keyboard","paste",{text:h,pasteOnNewLine:f,multicursorText:g,mode:p})}})()):!0)}return!1}),G9.addImplementation(0,"generic-dom",(n,e)=>(n.get(ki).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),n.get(xa).triggerPaste(ii().vscodeWindowId)??!1)));swe&&we(Aet);const Fi=new class{constructor(){this.QuickFix=new Qi("quickfix"),this.Refactor=new Qi("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Qi("notebook"),this.Source=new Qi("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var La;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(La||(La={}));function Pet(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>rwe(e,t,n.include))||!n.includeSourceActions&&Fi.Source.contains(e))}function Oet(n,e){const t=e.kind?new Qi(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>rwe(t,i,n.include))||!n.includeSourceActions&&t&&Fi.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function rwe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Qh{static fromUser(e,t){return!e||typeof e!="object"?new Qh(t.kind,t.apply,!1):new Qh(Qh.getKindFromUser(e,t.kind),Qh.getApplyFromUser(e,t.apply),Qh.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Qi(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class Fet{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if((t=this.provider)!=null&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(s){Bn(s)}i&&(this.action.edit=i.edit)}return this}}const awe="editor.action.codeAction",SX="editor.action.quickFix",lwe="editor.action.autoFix",cwe="editor.action.refactor",dwe="editor.action.sourceAction",v$="editor.action.organizeImports",w$="editor.action.fixAll",Bet=1e3;class jk extends G{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Go(e.diagnostics)?Go(t.diagnostics)?jk.codeActionsPreferredComparator(e,t):-1:Go(t.diagnostics)?1:jk.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(jk.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Fi.QuickFix.contains(new Qi(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const uae={actions:[],documentation:void 0};async function S0(n,e,t,i,s,o){var p;const r=i.filter||{},a={...r,excludes:[...r.excludes||[],Fi.Notebook]},l={only:(p=r.include)==null?void 0:p.value,trigger:i.type},c=new mX(e,o),d=i.type===2,h=Wet(n,e,d?a:r),u=new ne,f=h.map(async m=>{const b=setTimeout(()=>s.report(m),1250);try{const v=await m.provideCodeActions(e,t,l,c.token);if(c.token.isCancellationRequested)return v==null||v.dispose(),uae;v&&u.add(v);const w=((v==null?void 0:v.actions)||[]).filter(S=>S&&Oet(r,S)),C=Vet(m,w,r.include);return{actions:w.map(S=>new Fet(S,m)),documentation:C}}catch(v){if(fl(v))throw v;return Bn(v),uae}finally{clearTimeout(b)}}),g=n.onDidChange(()=>{const m=n.all(e);Bi(m,h)||c.cancel()});try{const m=await Promise.all(f),b=m.map(C=>C.actions).flat(),v=[...rh(m.map(C=>C.documentation)),...Het(n,e,i,b)],w=new jk(b,v,u);return u.add(w),w}catch(m){throw u.dispose(),m}finally{g.dispose(),c.dispose()}}function Wet(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>Pet(t,new Qi(s))):!0)}function*Het(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)==null?void 0:r.call(a,{trigger:t.type,only:(o=(s=t.filter)==null?void 0:s.include)==null?void 0:o.value},i.map(l=>l.action)))}function Vet(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new Qi(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new Qi(s.kind)))return o.command}}var rm;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb",n.FromProblemsHover="fromProblemsHover"})(rm||(rm={}));async function zet(n,e,t,i,s=vt.None){var d,h;const o=n.get(ID),r=n.get(Ei),a=n.get(Ro),l=n.get(fn),c=n.get(Kg);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),c.playSignal(dr.codeActionTriggered),await e.resolve(s),!s.isCancellationRequested&&!((d=e.action.edit)!=null&&d.edits.length&&!(await o.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==rm.OnSave,showPreview:i==null?void 0:i.preview,reason:wo.codeAction({kind:e.action.kind,providerId:A5.fromExtensionId((h=e.provider)==null?void 0:h.extensionId)})})).isApplied)){if(e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const f=jet(u);l.error(typeof f=="string"?f:_(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>c.playSignal(dr.codeActionApplied),Bet)}}function jet(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Rt.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof He))throw Zl();const{codeActionProvider:o}=n.get(De),r=n.get(qi).getModel(e);if(!r)throw Zl();const a=Ie.isISelection(t)?Ie.liftSelection(t):D.isIRange(t)?r.validateRange(t):void 0;if(!a)throw Zl();const l=typeof i=="string"?new Qi(i):void 0,c=await S0(o,r,a,{type:1,triggerAction:La.Default,filter:{includeSourceActions:!0,include:l}},Wd.None,vt.None),d=[],h=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let u=0;uu.action)}finally{setTimeout(()=>c.dispose(),100)}});var $et=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Uet=function(n,e){return function(t,i){e(t,i,n)}},C$,t1;let y$=(t1=class{constructor(e){this.keybindingService=e}getResolver(){const e=new oo(()=>this.keybindingService.getKeybindings().filter(t=>C$.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===v$?i={kind:Fi.SourceOrganizeImports.value}:t.command===w$&&(i={kind:Fi.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Qh.fromUser(i,{kind:Qi.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Qi(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}},C$=t1,t1.codeActionCommands=[cwe,awe,dwe,v$,w$],t1);y$=C$=$et([Uet(0,Ht)],y$);F("symbolIcon.arrayForeground",St,_(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.booleanForeground",St,_(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.colorForeground",St,_(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constantForeground",St,_(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.fileForeground",St,_(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.folderForeground",St,_(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keyForeground",St,_(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keywordForeground",St,_(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.moduleForeground",St,_(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.namespaceForeground",St,_(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.nullForeground",St,_(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.numberForeground",St,_(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.objectForeground",St,_(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.operatorForeground",St,_(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.packageForeground",St,_(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.propertyForeground",St,_(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.referenceForeground",St,_(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.snippetForeground",St,_(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.stringForeground",St,_(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.structForeground",St,_(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.textForeground",St,_(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.typeParameterForeground",St,_(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.unitForeground",St,_(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const hwe=Object.freeze({kind:Qi.Empty,title:_(866,"More Actions...")}),qet=Object.freeze([{kind:Fi.QuickFix,title:_(867,"Quick Fix")},{kind:Fi.RefactorExtract,title:_(868,"Extract"),icon:de.wrench},{kind:Fi.RefactorInline,title:_(869,"Inline"),icon:de.wrench},{kind:Fi.RefactorRewrite,title:_(870,"Rewrite"),icon:de.wrench},{kind:Fi.RefactorMove,title:_(871,"Move"),icon:de.wrench},{kind:Fi.SurroundWith,title:_(872,"Surround With"),icon:de.surroundWith},{kind:Fi.Source,title:_(873,"Source Action"),icon:de.symbolFile},hwe]);function Ket(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:hwe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!((r=o.action.edit)!=null&&r.edits.length)}});const i=qet.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new Qi(o.action.kind):Qi.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions){const a=o.group;s.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:de.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return s}const uwe=new Se("supportedCodeAction",""),fae="_typescript.applyFixAllCodeAction";class Get extends G{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new Ca),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>i_(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:La.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(73).enabled;if(i!==Dc.Off){{if(i===Dc.On)return t;if(i===Dc.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=o.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var Hb;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(fl(r))return S$;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(Hb||(Hb={}));const S$=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Yet extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Kt),this._state=Hb.Empty,this._onDidChangeState=this._register(new q),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Kt),this._disposed=!1,this._supportedCodeActions=uwe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Hb.Empty,!0))}_settingEnabledNearbyQuickfixes(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e==null?void 0:e.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Hb.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new Get(this._editor,this._markerService,i=>{var l;if(!i){this.setState(Hb.Empty);return}const s=i.selection.getStartPosition(),o=ss(async c=>{var h,u,f,g,p,m,b,v,w,C;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===La.QuickFix||(u=(h=i.trigger.filter)==null?void 0:h.include)!=null&&u.contains(Fi.QuickFix))){const S=await S0(this._registry,e,i.selection,i.trigger,Wd.None,c);this.codeActionsDisposable.value=S;const L=[...S.allActions];if(c.isCancellationRequested)return S.dispose(),S$;const x=(f=S.validActions)==null?void 0:f.some(I=>I.action.kind&&Fi.QuickFix.contains(new Qi(I.action.kind))&&!I.action.isAI),E=this._markerService.read({resource:e.uri});if(x){for(const I of S.validActions)(p=(g=I.action.command)==null?void 0:g.arguments)!=null&&p.some(R=>typeof R=="string"&&R.includes(fae))&&(I.action.diagnostics=[...E.filter(R=>R.relatedInformation)]);return{validActions:S.validActions,allActions:L,documentation:S.documentation,hasAutoFix:S.hasAutoFix,hasAIFix:S.hasAIFix,allAIFixes:S.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=S}}}else if(!x&&E.length>0){const I=i.selection.getPosition();let R=I,M=Number.MAX_VALUE;const A=[...S.validActions];for(const P of E){const B=P.endColumn,V=P.endLineNumber,K=P.startLineNumber;if(V===I.lineNumber||K===I.lineNumber){R=new U(V,B);const z={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:(m=i.trigger.filter)!=null&&m.include?(b=i.trigger.filter)==null?void 0:b.include:Fi.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((v=i.trigger.context)==null?void 0:v.notAvailableMessage)||"",position:R}},j=new Ie(R.lineNumber,R.column,R.lineNumber,R.column),Q=await S0(this._registry,e,j,z,Wd.None,c);if(c.isCancellationRequested)return Q.dispose(),S$;if(Q.validActions.length!==0){for(const Y of Q.validActions)(C=(w=Y.action.command)==null?void 0:w.arguments)!=null&&C.some(te=>typeof te=="string"&&te.includes(fae))&&(Y.action.diagnostics=[...E.filter(te=>te.relatedInformation)]);S.allActions.length===0&&L.push(...Q.allActions),Math.abs(I.column-B)V.findIndex(K=>K.action.title===P.action.title)===B);return W.sort((P,B)=>P.action.isPreferred&&!B.action.isPreferred?-1:!P.action.isPreferred&&B.action.isPreferred||P.action.isAI&&!B.action.isAI?1:!P.action.isAI&&B.action.isAI?-1:0),{validActions:W,allActions:L,documentation:S.documentation,hasAutoFix:S.hasAutoFix,hasAIFix:S.hasAIFix,allAIFixes:S.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=S}}}}if(i.trigger.type===1){const S=await S0(this._registry,e,i.selection,i.trigger,Wd.None,c);return this.codeActionsDisposable.value=S,S}const d=await S0(this._registry,e,i.selection,i.trigger,Wd.None,c);return this.codeActionsDisposable.value=d,d});i.trigger.type===1&&((l=this._progressService)==null||l.showWhile(o,250));const r=new Hb.Triggered(i.trigger,s,o);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&r.type===1&&r.trigger.type===2&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:La.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)==null||t.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Zet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xet=function(n,e){return function(t,i){e(t,i,n)}},WC;const gae=Ai("gutter-lightbulb",de.lightBulb,_(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),pae=Ai("gutter-lightbulb-auto-fix",de.lightbulbAutofix,_(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),mae=Ai("gutter-lightbulb-sparkle",de.lightbulbSparkle,_(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),_ae=Ai("gutter-lightbulb-aifix-auto-fix",de.lightbulbSparkleAutofix,_(877,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),bae=Ai("gutter-lightbulb-sparkle-filled",de.sparkleFilled,_(878,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var pd;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(pd||(pd={}));var Jf;let pN=(Jf=class extends G{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new q),this.onClick=this._onClick.event,this._state=pd.Hidden,this._gutterState=pd.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+gae.id,"codicon-"+_ae.id,"codicon-"+pae.id,"codicon-"+mae.id,"codicon-"+bae.id],this.gutterDecoration=WC.GUTTER_DECORATION,this._domNode=me("div.lightBulbWidget"),this._domNode.role="listbox",this._register(No.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide(),(this.gutterState.type!==1||!s||this.gutterState.editorPosition.lineNumber>=s.getLineCount())&&this.gutterHide()})),this._register(GOe(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=dn(this._domNode),r=this._editor.getOption(75);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(ve.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var i,s;this._preferredKbLabel=((i=this._keybindingService.lookupKeybinding(lwe))==null?void 0:i.getLabel())??void 0,this._quickFixKbLabel=((s=this._keybindingService.lookupKeybinding(SX))==null?void 0:s.getLabel())??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:s,height:o}=dn(i.target.element),r=this._editor.getOption(75);let a=Math.floor(r/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,g=S=>S>2&&this._editor.getTopForLineNumber(S)===this._editor.getTopForLineNumber(S-1),p=this._editor.getLineDecorations(a);let m=!1;if(p)for(const S of p){const L=S.options.glyphMarginClassName;if(L&&!this.lightbulbClasses.some(x=>L.includes(x))){m=!0;break}}let b=a,v=1;if(!f){const S=L=>{const x=r.getLineContent(L);return/^\s*$|^\s+/.test(x)||x.length<=v};if(a>1&&!g(a-1)){const L=r.getLineCount(),x=a===L,E=a>1&&S(a-1),I=!x&&S(a+1),R=S(a),M=!I&&!E;if(!I&&!E&&!m)return this.gutterState=new pd.Showing(e,t,i,{position:{lineNumber:b,column:v},preference:WC._posPref}),this.renderGutterLightbub(),this.hide();E||x||E&&!R?b-=1:(I||M&&R)&&(b+=1)}else if(a===1&&(a===r.getLineCount()||!S(a+1)&&!S(a)))if(this.gutterState=new pd.Showing(e,t,i,{position:{lineNumber:b,column:v},preference:WC._posPref}),m)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a{this._gutterDecorationID=t.addDecoration(new D(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new D(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=_(879,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=_(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=_(881,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=_(882,"Show Code Actions")))}set title(e){this._domNode.title=e}},WC=Jf,Jf.GUTTER_DECORATION=nt.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:Ue.asClassName(de.lightBulb),glyphMargin:{position:Zd.Left},stickiness:1}),Jf.ID="editor.contrib.lightbulbWidget",Jf._posPref=[0],Jf);pN=WC=Zet([Xet(1,Ht)],pN);var Qet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yh=function(n,e){return function(t,i){e(t,i,n)}},HC;const Jet="quickfix-edit-highlight";var Pm;let Sw=(Pm=class extends G{static get(e){return e.getContribution(HC.ID)}constructor(e,t,i,s,o,r,a,l,c,d,h){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._progressService=h,this._activeCodeActions=this._register(new Kt),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Yet(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new oo(()=>{const u=this._editor.getContribution(pN.ID);return u&&this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u}),this._resolver=s.createInstance(y$),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&s.arguments[0]&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,rm.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var r;if(!this._editor.hasModel())return;(r=_a.get(this._editor))==null||r.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,s){const o=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(zet,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:La.QuickFix,filter:{}}),o.done()}}hideLightBulbWidget(){var e,t;(e=this._lightBulbWidget.rawValue)==null||e.hide(),(t=this._lightBulbWidget.rawValue)==null||t.gutterHide()}async update(e){var s,o,r,a,l;if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(c){Je(c);return}if(this._disposed)return;const i=this._editor.getSelection();if((i==null?void 0:i.startLineNumber)===e.position.lineNumber)if((s=this._lightBulbWidget.value)==null||s.update(t,e.trigger,e.position),e.trigger.type===1){if((o=e.trigger.filter)!=null&&o.include){const d=this.tryGetValidActionToApply(e.trigger,t);if(d){try{this.hideLightBulbWidget(),await this.applyCodeAction(d,!1,!1,rm.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(h&&h.action.disabled){(r=_a.get(this._editor))==null||r.showMessage(h.action.disabled,e.trigger.context.position),t.dispose();return}}}const c=!!((a=e.trigger.filter)!=null&&a.include);if(e.trigger.context&&(!t.allActions.length||!c&&!t.validActions.length)){(l=_a.get(this._editor))==null||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=U.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,d)=>{this.applyCodeAction(c,!0,!!d,i.fromLightbulb?rm.FromAILightbulb:rm.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:c=>{var d;(d=this._editor)==null||d.focus(),s.clear()},onHover:async(c,d)=>{var f;if(d.isCancellationRequested)return;let h=!1;const u=c.action.kind;if(u){const g=new Qi(u);h=[Fi.RefactorExtract,Fi.RefactorInline,Fi.RefactorRewrite,Fi.RefactorMove,Fi.Source].some(m=>m.contains(g))}return{canPreview:h||!!((f=c.action.edit)!=null&&f.edits.length)}},onFocus:c=>{var d,h;if(c&&c.action){const u=c.action.ranges,f=c.action.diagnostics;if(s.clear(),u&&u.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:HC.DECORATION})):u.map(p=>({range:p,options:HC.DECORATION}));s.set(g)}else if(f&&f.length>0){const g=f.map(m=>({range:m,options:HC.DECORATION}));s.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const m=(h=(d=this._editor.getModel())==null?void 0:d.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))==null?void 0:h.word;Xd(_(863,"Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Ket(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=dn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:_(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:_(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},HC=Pm,Pm.ID="editor.contrib.codeActionController",Pm.DECORATION=nt.register({description:"quickfix-highlight",className:Jet}),Pm);Sw=HC=Qet([yh(1,Pu),yh(2,Xe),yh(3,Ae),yh(4,De),yh(5,Tg),yh(6,Ei),yh(7,lt),yh(8,x_),yh(9,Ae),yh(10,Tg)],Sw);gc((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Uf));const i=n.getColor(Qp);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${qd(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function BD(n){return le.regex(uwe.keys()[0],new RegExp("(\\s|^)"+va(n.value)+"\\b"))}const xX={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:_(831,"Kind of the code action to run.")},apply:{type:"string",description:_(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[_(833,"Always apply the first returned code action."),_(834,"Apply the first returned code action if it is the only one."),_(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:_(836,"Controls if only preferred code actions should be returned.")}}};function Kw(n,e,t,i,s=La.Default){if(n.hasModel()){const o=Sw.get(n);o==null||o.manualTriggerAtCurrentPosition(e,s,t,i)}}class ett extends Ne{constructor(){super({id:SX,label:ie(853,"Quick Fix..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),kbOpts:{kbExpr:H.textInputFocus,primary:2137,weight:100}})}run(e,t){return Kw(t,_(837,"No code actions available"),void 0,void 0,La.QuickFix)}}class ttt extends cs{constructor(){super({id:awe,precondition:le.and(H.writable,H.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:xX}]}})}runEditorCommand(e,t,i){const s=Qh.fromUser(i,{kind:Qi.Empty,apply:"ifSingle"});return Kw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(838,"No preferred code actions for '{0}' available",i.kind):_(839,"No code actions for '{0}' available",i.kind):s.preferred?_(840,"No preferred code actions available"):_(841,"No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class itt extends Ne{constructor(){super({id:cwe,label:ie(854,"Refactor..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),kbOpts:{kbExpr:H.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:le.and(H.writable,BD(Fi.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:xX}]}})}run(e,t,i){const s=Qh.fromUser(i,{kind:Fi.Refactor,apply:"never"});return Kw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(842,"No preferred refactorings for '{0}' available",i.kind):_(843,"No refactorings for '{0}' available",i.kind):s.preferred?_(844,"No preferred refactorings available"):_(845,"No refactorings available"),{include:Fi.Refactor.contains(s.kind)?s.kind:Qi.None,onlyIncludePreferredActions:s.preferred},s.apply,La.Refactor)}}class ntt extends Ne{constructor(){super({id:dwe,label:ie(855,"Source Action..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:le.and(H.writable,BD(Fi.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:xX}]}})}run(e,t,i){const s=Qh.fromUser(i,{kind:Fi.Source,apply:"never"});return Kw(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(846,"No preferred source actions for '{0}' available",i.kind):_(847,"No source actions for '{0}' available",i.kind):s.preferred?_(848,"No preferred source actions available"):_(849,"No source actions available"),{include:Fi.Source.contains(s.kind)?s.kind:Qi.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,La.SourceAction)}}class stt extends Ne{constructor(){super({id:v$,label:ie(856,"Organize Imports"),precondition:le.and(H.writable,BD(Fi.SourceOrganizeImports)),kbOpts:{kbExpr:H.textInputFocus,primary:1581,weight:100},metadata:{description:ie(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return Kw(t,_(850,"No organize imports action available"),{include:Fi.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",La.OrganizeImports)}}class ott extends Ne{constructor(){super({id:w$,label:ie(858,"Fix All"),precondition:le.and(H.writable,BD(Fi.SourceFixAll))})}run(e,t){return Kw(t,_(851,"No fix all action available"),{include:Fi.SourceFixAll,includeSourceActions:!0},"ifSingle",La.FixAll)}}class rtt extends Ne{constructor(){super({id:lwe,label:ie(859,"Auto Fix..."),precondition:le.and(H.writable,BD(Fi.QuickFix)),kbOpts:{kbExpr:H.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return Kw(t,_(852,"No auto fixes available"),{include:Fi.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",La.AutoFix)}}At(Sw.ID,Sw,3);At(pN.ID,pN,4);we(ett);we(itt);we(ntt);we(stt);we(rtt);we(ott);ye(new ttt);Ji.as(ah.Configuration).registerConfiguration({...N3,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:_(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ji.as(ah.Configuration).registerConfiguration({...N3,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:_(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Ji.as(ah.Configuration).registerConfiguration({...N3,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:_(862,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});const uF=class uF{constructor(){this.lenses=[]}dispose(){var e;(e=this._store)==null||e.dispose()}get isDisposed(){var e;return((e=this._store)==null?void 0:e.isDisposed)??!1}add(e,t){Rw(e)&&(this._store??(this._store=new ne),this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}};uF.Empty=new uF;let DS=uF;async function fwe(n,e,t){const i=n.ordered(e),s=new Map,o=new DS,r=i.map(async(a,l)=>{s.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Bn(c)}});return await Promise.all(r),t.isCancellationRequested?(o.dispose(),DS.Empty):(o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:s.get(a.provider)s.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o)}Rt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Ot(He.isUri(t)),Ot(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(De),o=n.get(qi).getModel(t);if(!o)throw Zl();const r=[],a=new ne;return fwe(s,o,vt.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,vt.None)).then(h=>r.push(h||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var att=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ltt=function(n,e){return function(t,i){e(t,i,n)}};const gwe=mt("ICodeLensCache");class vae{constructor(e,t){this.lineCount=e,this.data=t}}let x$=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Xc(20,.75);const t="codelens/cache";NL(ri,()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s);const o=ve.filter(e.onWillSaveState,r=>r.reason===km.SHUTDOWN);ve.once(o)(r=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)==null?void 0:a.title}}}),s=new DS;s.add({lenses:i},this._fakeProvider);const o=new vae(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new D(a,1,a,11)});const r=new DS;r.add({lenses:o},this._fakeProvider),this._cache.set(i,new vae(s.lineCount,r))}}catch{}}};x$=att([ltt(0,Qo)],x$);xt(gwe,x$,1);class ctt{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const wE=class wE{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${wE._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:wae},h=>this._decorationIds[d]=h),a?a=D.plusRange(a,c.symbol.range):a=D.lift(c.symbol.range)}),this._viewZone=new ctt(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new L$(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&D.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:wae},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dL=function(n,e){return function(t,i){e(t,i,n)}},Dy;let mN=(Dy=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=s,this._notificationService=o,this._codeLensCache=r,this._disposables=new ne,this._localToDispose=new ne,this._lenses=[],this._oldCodeLensModels=new ne,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new ai(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)==null||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),s=this._editor.getOption(59),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Hr.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)==null||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)==null||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)==null||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&kg(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new ai(()=>{var o;const s=Date.now();(o=this._getCodeLensModelPromise)==null||o.cancel(),this._getCodeLensModelPromise=ss(r=>fwe(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Je)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Re(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(r),l=d.getLineNumber())});const c=new Y9;a.forEach(d=>{d.dispose(c,r),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)==null||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Re(()=>{if(this._editor.getModel()){const s=nh.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new Y9;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(s&&s[s.length-1].symbol.range.startLineNumber===l?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=nh.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new Y9;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var r;(r=this._resolveCodeLensesPromise)==null||r.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(e);l&&(t.push(l),i.push(a))}),t.length===0){this._oldCodeLensModels.clear();return}const s=Date.now(),o=ss(a=>{const l=t.map((c,d)=>{const h=new Array(c.length),u=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(e,f.symbol,a)).then(p=>{h[g]=p},Bn):(h[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!i[d].isDisposed()&&i[d].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Je(a),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(e=this._currentCodeLensModel)!=null&&e.isDisposed?void 0:this._currentCodeLensModel}},Dy.ID="css.editor.codeLens",Dy);mN=dtt([dL(1,De),dL(2,pc),dL(3,Ei),dL(4,fn),dL(5,gwe)],mN);At(mN.ID,mN,1);we(class extends Ne{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:H.hasCodeLensProvider,label:ie(884,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(Do),s=e.get(Ei),o=e.get(fn),r=t.getSelection().positionLineNumber,a=t.getContribution(mN.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&c.push({label:u.symbol.command.title,command:u.symbol.command});if(c.length===0)return;const d=await i.pick(c,{canPickMany:!1,placeHolder:_(883,"Select a command")});if(!d)return;let h=d.command;if(l.isDisposed){const u=await a.getModel(),f=u==null?void 0:u.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===r&&((p=g.symbol.command)==null?void 0:p.title)===h.title});if(!f||!f.symbol.command)return;h=f.symbol.command}try{await s.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});class Z9{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class FL{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class xw{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){var e;for(const t of this.renderedHoverParts)t.dispose();(e=this.disposables)==null||e.dispose()}}const Gw=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var pwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k$=function(n,e){return function(t,i){e(t,i,n)}};let _N=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new se(new re(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),l=r?se.Format.CSS.formatRGBA(a):se.Format.CSS.formatRGB(a),c=r?se.Format.CSS.formatHSLA(a):se.Format.CSS.formatHSL(a),d=r?se.Format.CSS.formatHexA(a):se.Format.CSS.formatHex(a),h=[];return h.push({label:l,textEdit:{range:s,text:l}}),h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:d,textEdit:{range:s,text:d}}),h}};_N=pwe([k$(0,Zr)],_N);let E$=class extends G{constructor(e,t){super(),this._register(e.colorProvider.register("*",new _N(t)))}};E$=pwe([k$(0,De),k$(1,Zr)],E$);async function mwe(n,e,t,i="auto"){return LX(new htt,n,e,t,i)}function _we(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class htt{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)}}class utt{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class ftt{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const o=await e.provideColorPresentations(t,this.colorInfo,vt.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)}}async function LX(n,e,t,i,s){let o=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(s!=="always"&&d instanceof _N)r=d;else try{await n.compute(d,t,i,a)&&(o=!0)}catch(h){Bn(h)}}return o?a:r&&s!=="never"?(await n.compute(r,t,i,a),a):[]}function bwe(n,e){const{colorProvider:t}=n.get(De),i=n.get(qi).getModel(e);if(!i)throw Zl();const s=n.get(lt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,defaultColorDecoratorsEnablement:s}}var gtt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X9=function(n,e){return function(t,i){e(t,i,n)}},I$;const vwe=Object.create({});var Om;let TS=(Om=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new ne),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new ptt),this._colorDecorationClassRefs=this._register(new ne),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new BA(this._editor)),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:I$.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(27),l=o.hasChanged(167);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new Ca,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=ss(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new xs(!1),s=await mwe(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Je(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:nt.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},I$=Om,Om.ID="editor.contrib.colorDetector",Om.RECOMPUTE_TIME=1e3,Om);TS=I$=gtt([X9(1,lt),X9(2,De),X9(3,pc)],TS);class ptt extends G{constructor(){super(...arguments),this._onDidChange=this._register(new q),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}const wwe="editor.action.showHover",mtt="editor.action.showDefinitionPreviewHover",_tt="editor.action.hideHover",btt="editor.action.scrollUpHover",vtt="editor.action.scrollDownHover",wtt="editor.action.scrollLeftHover",Ctt="editor.action.scrollRightHover",ytt="editor.action.pageUpHover",Stt="editor.action.pageDownHover",xtt="editor.action.goToTopHover",Ltt="editor.action.goToBottomHover",q3="editor.action.increaseHoverVerbosityLevel",ktt=_(1102,"Increase Hover Verbosity Level"),K3="editor.action.decreaseHoverVerbosityLevel",Ett=_(1103,"Decrease Hover Verbosity Level"),bN="editor.action.inlineSuggest.commit",Cwe="editor.action.inlineSuggest.showPrevious",ywe="editor.action.inlineSuggest.showNext",Itt="editor.action.inlineSuggest.jump",Swe="editor.action.inlineSuggest.hide",N$="editor.action.inlineSuggest.toggleShowCollapsed";var kX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Oc=function(n,e){return function(t,i){e(t,i,n)}},tM;let D$=class extends G{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Ut(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=oe(this,s=>{var l,c;const o=(l=this.model.read(s))==null?void 0:l.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new U(o.lineNumber,Math.min(r,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(Eo((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=oe(c=>{const d=c.store.add(this.instantiationService.createInstance(RS.hot.read(c),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(d),c.store.add(Re(()=>e.removeContentWidget(d))),c.store.add(qe(h=>{this.position.read(h)&&r.lastTriggerKind.read(h)!==Mr.Explicit&&r.triggerExplicitly()})),d}),l=Hg(this,(c,d)=>!!this.position.read(c)||!!d);o.add(qe(c=>{l.read(c)&&a.read(c)}))}))}};D$=kX([Oc(2,Ae)],D$);const Ntt=Ai("inline-suggestion-hints-next",de.chevronRight,_(1207,"Icon for show next parameter hint.")),Dtt=Ai("inline-suggestion-hints-previous",de.chevronLeft,_(1208,"Icon for show previous parameter hint."));var tu;let RS=(tu=class extends G{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new ol(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=_(1209,"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._warning=a,this._relayout=l,this._commandService=c,this.keybindingService=h,this._contextKeyService=u,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${tM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=oe(g=>{const p=this._warning.read(g);return p?typeof p.message=="string"?p.message:g.store.add(ED(p.message)).element:void 0}),this._warningMessageNode=ht.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:oe(g=>this._warning.read(g)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Pt("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,Pt("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(Cwe,_(1210,"Previous"),Ue.asClassName(Dtt))),this.availableSuggestionCountAction=this._register(new ol("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(ywe,_(1211,"Next"),Ue.asClassName(Ntt))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ai(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ai(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(qe(g=>{this._warningMessageContentNode.read(g),this._warningMessageNode.readEffect(g),this._relayout()})),this.toolBar=this._register(d.createInstance(T$,this.nodes.toolBar,Te.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:g=>g.startsWith("primary")},actionViewItemProvider:(g,p)=>{if(g instanceof rl)return d.createInstance(Rtt,g,void 0);if(g===this.availableSuggestionCountAction){const m=new Ttt(void 0,g,{label:!0,icon:!1});return m.setClass("availableSuggestionCount"),m}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(g=>{tM._dropDownVisible=g})),this._register(qe(g=>{this._position.read(g),this.editor.layoutContentWidget(this)})),this._register(qe(g=>{const p=this._suggestionCount.read(g),m=this._currentSuggestionIdx.read(g);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${m+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(qe(g=>{const m=this._extraCommands.read(g).map(b=>({class:void 0,id:b.command.id,enabled:!0,tooltip:b.command.tooltip||"",label:b.command.title,run:v=>this._commandService.executeCommand(b.command.id)}));for(const[b,v]of this.inlineCompletionsActionsMenus.getActions())for(const w of v)w instanceof rl&&m.push(w);m.length>0&&m.unshift(new Xn),this.toolBar.setAdditionalSecondaryActions(m)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},tM=tu,tu.hot=j3(tu),tu._dropDownVisible=!1,tu.id=0,tu);RS=tM=kX([Oc(8,Ei),Oc(9,Ae),Oc(10,Ht),Oc(11,Xe),Oc(12,uc)],RS);class Ttt extends kS{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class Rtt extends c_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=Pt("div.keybinding").root;this._register(new hx(t,ha,{disableTitle:!0,...yGe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let T$=class extends YP{constructor(e,t,i,s,o,r,a,l,c){super(e,{resetMenu:t,...i},s,o,r,a,l,c),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,s,o,r,a,l,c;const{primary:e,secondary:t}=lve(this.menu.getActions((i=this.options2)==null?void 0:i.menuOptions),(o=(s=this.options2)==null?void 0:s.toolbarOptions)==null?void 0:o.primaryGroup,(a=(r=this.options2)==null?void 0:r.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Bi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Bi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};T$=kX([Oc(3,uc),Oc(4,Xe),Oc(5,gl),Oc(6,Ht),Oc(7,Ei),Oc(8,Ro)],T$);function G3(n,e,t){const i=dn(n);return!(ei.left+i.width||ti.top+i.height)}class Mtt{constructor(e,t,i,s){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=s}}class xwe extends G{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new Q9(i=>this._triggerAsyncComputation(i),0)),this._syncComputationScheduler=this._register(new Q9(i=>this._triggerSyncComputation(i),0)),this._loadingMessageScheduler=this._register(new Q9(i=>this._triggerLoadingMessage(i),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=dOe(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(t){Je(t)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;const t=this._state===0,i=this._state===4;this._onResult.fire(new Mtt(this._result.slice(0),t,i,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class Q9 extends G{constructor(e,t){super(),this._scheduler=this._register(new ai(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}class EX{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new q,this._onDidResize=new q,this._sashListener=new ne,this._size=new Qt(0,0),this._minSize=new Qt(0,0),this._maxSize=new Qt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new bo(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new bo(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new bo(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:IP.North}),this._southSash=new bo(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:IP.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(ve.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(ve.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ve.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ve.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Qt(t,e);Qt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const Att=30,Ptt=24;class Ott extends G{constructor(e,t=new Qt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new EX),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Qt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Qt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return(e=this._contentPosition)!=null&&e.position?U.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:dn(t).top+i.top-Att}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=dn(t),o=e_(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-Ptt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(s,i),e),r=Math.min(e,o);let a;return this._editor.getOption(69).above?a=r<=s?1:2:a=r<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var Ftt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},E2=function(n,e){return function(t,i){e(t,i,n)}},Lc;const yae=30;var Fm;let R$=(Fm=class extends Ott{get isVisibleFromKeyboard(){var e;return((e=this._renderedHover)==null?void 0:e.source)===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,o){const r=e.getOption(75)+8,a=150,l=new Qt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new fZ(!0)),this._onDidResize=this._register(new q),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new q),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new q),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=l,this._hoverVisibleKey=H.hoverVisible.bindTo(t),this._hoverFocusedKey=H.hoverFocused.bindTo(t),ue(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(59)&&this._updateFont()}));const c=this._register(oc(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(d=>{this._onDidScroll.fire(d)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._renderedHover)==null||e.dispose(),this._editor.removeContentWidget(this)}getId(){return Lc.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return Lc._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return Lc._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return Lc._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){Lc._applyMaxDimensions(this._hover.contentsDomNode,e,t),Lc._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),Lc._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Qt(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){Lc._lastDimensions=new Qt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){var t;const e=(t=this._renderedHover)==null?void 0:t.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let i=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(s=>{i+=s.clientHeight}),Math.min(e,i)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,s),!0)}_setRenderedHover(e){var t;(t=this._renderedHover)==null||t.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,Lc._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,Lc._lastDimensions.width);this._resizableNode.maxSize=new Qt(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){var r;if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=zf(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const o=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&nbe(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),((r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:r.getAriaLabel())??"");o&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+o)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Qt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new Qt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Qt(e,this._minimumSize.height)}handleContentsChanged(){var s;this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=zf(e),i=ra(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=zf(e),i=ra(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),(s=this._renderedHover)!=null&&s.showAtPosition){const o=zf(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-yae})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+yae})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},Lc=Fm,Fm.ID="editor.contrib.resizableContentHoverWidget",Fm._lastDimensions=new Qt(0,0),Fm);R$=Lc=Ftt([E2(1,Xe),E2(2,lt),E2(3,Us),E2(4,Ht)],R$);function Sae(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}class rO{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return Xl.EMPTY;const s=rO._getLineDecorations(this._editor,i);return Xl.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(i,s,e.source,t):Xl.EMPTY))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=rO._getLineDecorations(this._editor,t);let s=[];for(const o of this._participants)s=s.concat(o.computeSync(t,i,e.source));return rh(s)}}class Lwe{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Btt(this,t,this.isComplete,this.options)}}class Btt extends Lwe{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}var Wtt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xae=function(n,e){return function(t,i){e(t,i,n)}};const Lae=me;let aO=class extends G{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Lae("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=ue(this.hoverElement,Lae("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const s=this._register(L3.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(Au("element"),s.actionContainer,s.actionRenderedLabel)),this.actions.push(s),s}append(e){const t=ue(this.actionsElement,e);return this._hasContent=!0,t}};aO=Wtt([xae(0,Ht),xae(1,Cr)],aO);const Po=class Po{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Po._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Po._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new D(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,Po._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Po._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=Po._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>u&&(u=p.endLineNumber):(o.push({range:new D(h,1,u,1),options:Po._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=p.startLineNumber,u=p.endLineNumber)}o.push({range:new D(h,1,u,1),options:Po._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Po._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rD.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function kae(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function Eae(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=kwe([s[a]],r)+t}),o.slice(0,-1)}class Iae{constructor(e){this.staticValue=e,this.kind=0}}class Vtt{constructor(e){this.pieces=e,this.kind=1}}class MS{static fromStaticValue(e){return new MS([Wv.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Iae(""):e.length===1&&e[0].staticValue!==null?this._state=new Iae(e[0].staticValue):this._state=new Vtt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?kwe(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=c){l.push(a.slice(h));break}switch(r.caseOps[d]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),d++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),d++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` -`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,Jt(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},$tt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new D(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,am);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=bI(s.map(l=>l.range),l=>D.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new U(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new U(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()$k._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=am?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ub(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const s=this._editor.getModel(),o=s.getValue(1),r=s.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const d=new AY(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new Ie(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;o{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%d.length:u.equals(15)&&(f===0?g=d.length-1:g=f-1),u.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),Wt.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)==null||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var Ewe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Iwe=function(n,e){return function(t,i){e(t,i,n)}};const NX=new Se("suggestWidgetVisible",!1,_(1698,"Whether suggestion are visible")),DX="historyNavigationWidgetFocus",Nwe="historyNavigationForwardsEnabled",Dwe="historyNavigationBackwardsEnabled";let ug;const M2=[];function Twe(n,e){if(M2.includes(e))throw new Error("Cannot register the same widget multiple times");M2.push(e);const t=new ne,i=new Se(DX,!1).bindTo(n),s=new Se(Nwe,!0).bindTo(n),o=new Se(Dwe,!0).bindTo(n),r=()=>{i.set(!0),ug=e},a=()=>{i.set(!1),ug===e&&(ug=void 0)};return H5(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Re(()=>{M2.splice(M2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let A$=class extends Sve{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(Twe(o,this.inputBox))}};A$=Ewe([Iwe(3,Xe)],A$);let P$=class extends Gtt{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(Twe(r,this.inputBox))}};P$=Ewe([Iwe(3,Xe)],P$);As.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:le.and(le.has(DX),le.equals(Dwe,!0),le.not("isComposing"),NX.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{ug==null||ug.showPreviousValue()}});As.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:le.and(le.has(DX),le.equals(Nwe,!0),le.not("isComposing"),NX.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{ug==null||ug.showNextValue()}});function Nae(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))==null?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))==null?void 0:t.getElectronAccelerator())==="Down"}const Dae=Ai("find-collapsed",de.chevronRight,_(956,"Icon to indicate that the editor find widget is collapsed.")),Tae=Ai("find-expanded",de.chevronDown,_(957,"Icon to indicate that the editor find widget is expanded.")),Ytt=Ai("find-selection",de.selection,_(958,"Icon for 'Find in Selection' in the editor find widget.")),Ztt=Ai("find-replace",de.replace,_(959,"Icon for 'Replace' in the editor find widget.")),Xtt=Ai("find-replace-all",de.replaceAll,_(960,"Icon for 'Replace All' in the editor find widget.")),Qtt=Ai("find-previous-match",de.arrowUp,_(961,"Icon for 'Find Previous' in the editor find widget.")),Jtt=Ai("find-next-match",de.arrowDown,_(962,"Icon for 'Find Next' in the editor find widget.")),eit=_(963,"Find / Replace"),tit=_(964,"Find"),iit=_(965,"Find"),nit=_(966,"Previous Match"),sit=_(967,"Next Match"),oit=_(968,"Find in Selection"),rit=_(969,"Close"),ait=_(970,"Replace"),lit=_(971,"Replace"),cit=_(972,"Replace"),dit=_(973,"Replace All"),hit=_(974,"Toggle Replace"),uit=_(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",am),fit=_(976,"{0} of {1}"),Rae=_(977,"No results"),Sh=419,git=275,pit=git-54;let hL=69;const mit=33,Mae=wt?256:2048;class J9{constructor(e){this.afterLineNumber=e,this.heightInPx=mit,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Aae(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function Pae(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(165)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(50)){const h=this._codeEditor.getOption(50).loop;this._state.change({loop:h},!1);const u=this._codeEditor.getOption(50).addExtraSpaceOnTop;u&&!this._viewZone&&(this._viewZone=new J9(0),this._showViewZone()),!u&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const d=await this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}})),this._findInputFocused=Y3.bindTo(r),this._findFocusTracker=this._register(oc(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=IX.bindTo(r),this._replaceFocusTracker=this._register(oc(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new J9(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return fF.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(104)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ra(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Je)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var t;this._matchesCount.style.minWidth=hL+"px",this._state.matchesCount>=am?this._matchesCount.title=uit:this._matchesCount.title="",(t=this._matchesCount.firstChild)==null||t.remove();let e;if(this._state.matchesCount>0){let i=String(this._state.matchesCount);this._state.matchesCount>=am&&(i+="+");let s=String(this._state.matchesPosition);s==="0"&&(s="?"),e=J1(fit,s,i)}else e=Rae;this._matchesCount.appendChild(document.createTextNode(e)),_r(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),hL=Math.max(hL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Rae)return i===""?_(978,"{0} found",e):_(979,"{0} found for '{1}'",e,i);if(t){const s=_(980,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return _(981,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=dn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=npe(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new J9(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(96).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&ra(this._domNode)>Sh){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=ra(this._findInput.domNode);return}if(Sh+28+s>=i&&(r=!0),Sh+28+s-hL>=i&&(a=!0),Sh+28+s-hL>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ra(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!D.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(Mae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Aae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return Pae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Mae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._replaceInput.inputBox.insertAtCursor(` -`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Aae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Pae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const i=this._codeEditor.getOption(50).history,s=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new A$(null,this._contextViewProvider,{width:pit,label:tit,placeholder:iit,appendCaseSensitiveLabel:this._keybindingLabelFor(xi.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(xi.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(xi.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>Nae(this._keybindingService),inputBoxStyles:yP,toggleStyles:CP,history:i==="workspace"?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(h=>{h.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(h)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),jr&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const o={groupId:"find-widget"};this._prevBtn=this._register(new bb({label:nit+this._keybindingLabelFor(xi.PreviousMatchFindAction),icon:Qtt,hoverLifecycleOptions:o,onTrigger:()=>{Kp(this._codeEditor.getAction(xi.PreviousMatchFindAction)).run().then(void 0,Je)}},this._hoverService)),this._nextBtn=this._register(new bb({label:sit+this._keybindingLabelFor(xi.NextMatchFindAction),icon:Jtt,hoverLifecycleOptions:o,onTrigger:()=>{Kp(this._codeEditor.getAction(xi.NextMatchFindAction)).run().then(void 0,Je)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const a=document.createElement("div");a.className="find-actions",r.appendChild(a),a.appendChild(this._matchesCount),a.appendChild(this._prevBtn.domNode),a.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Ug({icon:Ytt,title:oit+this._keybindingLabelFor(xi.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:o,inputActiveOptionBackground:pe(ox),inputActiveOptionBorder:pe(mD),inputActiveOptionForeground:pe(_D)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),a.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new bb({label:rit+this._keybindingLabelFor(xi.CloseFindWidgetCommand),icon:Jve,hoverLifecycleOptions:o,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new P$(null,void 0,{label:ait,placeholder:lit,appendPreserveCaseLabel:this._keybindingLabelFor(xi.TogglePreserveCaseCommand),history:s==="workspace"?this._replaceWidgetHistory:new Set([]),flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Nae(this._keybindingService),inputBoxStyles:yP,toggleStyles:CP,hoverLifecycleOptions:o},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),h.preventDefault())})),this._replaceBtn=this._register(new bb({label:cit+this._keybindingLabelFor(xi.ReplaceOneAction),icon:Ztt,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new bb({label:dit+this._keybindingLabelFor(xi.ReplaceAllAction),icon:Xtt,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const l=document.createElement("div");l.className="replace-part",l.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",l.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new bb({label:hit,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ra(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=eit,this._domNode.role="dialog",this._domNode.style.width=`${Sh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(l),this._resizeSash=this._register(new bo(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=Sh;this._register(this._resizeSash.onDidStart(()=>{d=ra(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const u=d+h.startX-h.currentX;if(uf||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=ra(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=ra(this._domNode);if(hthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};fF.ID="editor.contrib.findWidget";let O$=fF;class bb extends Na{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+Ue.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},e.hoverLifecycleOptions)),this.onclick(this._domNode,s=>{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{var o,r;if(s.equals(10)||s.equals(3)){this._opts.onTrigger(),s.preventDefault();return}(r=(o=this._opts).onKeyDown)==null||r.call(o,s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...Ue.asClassNameArray(Dae)),this._domNode.classList.add(...Ue.asClassNameArray(Tae))):(this._domNode.classList.remove(...Ue.asClassNameArray(Tae)),this._domNode.classList.add(...Ue.asClassNameArray(Dae)))}}gc((n,e)=>{const t=n.getColor(Qp);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${qd(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(_8e);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${qd(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(Dt);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const o=n.getColor(p8e);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=n.getColor(m8e);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var _it=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Oae=function(n,e){return function(t,i){e(t,i,n)}};let F$=class extends G{constructor(e,t,i,s){super(),this._container=e,this._getContent=t,this._clipboardService=i,this._hoverService=s,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new bb({label:_(1128,"Copy"),icon:de.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const e=this._getContent();e&&(await this._clipboardService.writeText(e),Xd(_(1129,"Copied to clipboard")))}};F$=_it([Oae(2,xa),Oae(3,Cr)],F$);class bit{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function vit(n,e,t,i,s){const o=await Promise.resolve(n.provideHover(t,i,s)).catch(Bn);if(!(!o||!wit(o)))return new bit(n,o,e)}function TX(n,e,t,i,s=!1){const r=n.ordered(e,s).map((a,l)=>vit(a,l,e,t,i));return Xl.fromPromisesResolveOrder(r).coalesce()}async function Rwe(n,e,t,i,s=!1){const o=[];for await(const r of TX(n,e,t,i,s))o.push(r.hover);return o}Yr("_executeHoverProvider",(n,e,t)=>{const i=n.get(De);return Rwe(i.hoverProvider,e,t,vt.None)});Yr("_executeHoverProvider_recursive",(n,e,t)=>{const i=n.get(De);return Rwe(i.hoverProvider,e,t,vt.None,!0)});function wit(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var Cit=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},LC=function(n,e){return function(t,i){e(t,i,n)}};const vv=me,yit=Ai("hover-increase-verbosity",de.add,_(1130,"Icon for increaseing hover verbosity.")),Sit=Ai("hover-decrease-verbosity",de.remove,_(1131,"Icon for decreasing hover verbosity."));class Fc{constructor(e,t,i,s,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class Mwe{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case aa.Increase:return this.hover.canIncreaseVerbosity??!1;case aa.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let vN=class{constructor(e,t,i,s,o,r,a){this._editor=e,this._markdownRendererService=t,this._configurationService=i,this._languageFeaturesService=s,this._keybindingService=o,this._hoverService=r,this._commandService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new Fc(this,e.range,[new yo().appendText(_(1132,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let u=!1;d>=0&&l>d&&e.range.startColumn>=d&&(u=!0,r.push(new Fc(this,e.range,[{value:_(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Fc(this,e.range,[{value:_(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,m=g.range.endLineNumber===s?g.range.endColumn:o,b=g.options.hoverMessage;if(!b||xS(b))continue;g.options.beforeContentClassName&&(f=!0);const v=new D(e.range.startLineNumber,p,e.range.startLineNumber,m);r.push(new Fc(this,v,yG(b),f,a++))}return r}computeAsync(e,t,i,s){if(!this._editor.hasModel()||e.type!==1)return Xl.EMPTY;const o=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(o)?this._getMarkdownHovers(r,o,e,s):Xl.EMPTY}async*_getMarkdownHovers(e,t,i,s){const o=i.range.getStartPosition(),r=TX(e,t,o,s);for await(const a of r)if(!xS(a.hover.contents)){const l=a.hover.range?D.lift(a.hover.range):i.range,c=new Mwe(a.hover,a.provider,o);yield new Fc(this,l,a.hover.contents,!1,a.ordinal,c)}}renderHoverParts(e,t){return this._renderedHoverParts=new xit(t,e.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){var t;(t=this._renderedHoverParts)==null||t.handleScroll(e)}getAccessibleContent(e){var t;return((t=this._renderedHoverParts)==null?void 0:t.getAccessibleContent(e))??""}updateMarkdownHoverVerbosityLevel(e,t){var i;return Promise.resolve((i=this._renderedHoverParts)==null?void 0:i.updateMarkdownHoverPartVerbosityLevel(e,t))}};vN=Cit([LC(1,Jc),LC(2,lt),LC(3,De),LC(4,Ht),LC(5,Cr),LC(6,Ei)],vN);class A2{constructor(e,t,i,s){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=s}dispose(){this.disposables.dispose()}}class xit{constructor(e,t,i,s,o,r,a,l,c,d){this._hoverParticipant=i,this._editor=s,this._commandService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=l,this._markdownRendererService=c,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new ne,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Re(()=>{this.renderedHoverParts.forEach(h=>{h.dispose()}),this._ongoingHoverOperations.forEach(h=>{h.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(lo(s=>s.ordinal,pa)),e.map(s=>{const o=this._renderHoverPart(s,i);return t.appendChild(o.hoverElement),o})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),s=i.hoverElement,o=e.source,r=new ne;if(r.add(i),!o)return new A2(e,s,r);const a=o.supportsVerbosityAction(aa.Increase),l=o.supportsVerbosityAction(aa.Decrease);if(!a&&!l)return new A2(e,s,r);const c=vv("div.verbosity-actions");s.prepend(c);const d=vv("div.verbosity-actions-inner");return c.append(d),r.add(this._renderHoverExpansionAction(d,aa.Increase,a)),r.add(this._renderHoverExpansionAction(d,aa.Decrease,l)),new A2(e,s,r,d)}_renderMarkdownHover(e,t){return Awe(this._editor,e,this._markdownRendererService,t)}_renderHoverExpansionAction(e,t,i){const s=new ne,o=t===aa.Increase,r=ue(e,vv(Ue.asCSSSelector(o?yit:Sit)));r.tabIndex=0;const a=new SS("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupManagedHover(a,r,kit(this._keybindingService,t))),!i)return r.classList.add("disabled"),s;r.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===aa.Increase?q3:K3,{focus:!0});return s.add(new sbe(r,l)),s.add(new obe(r,l,[3,10])),s}handleScroll(e){this.renderedHoverParts.forEach(t=>{const i=t.actionsContainer;if(!i)return;const s=t.hoverElement,r=e.scrollTop+e.height,a=s.offsetTop,l=s.clientHeight,c=a+l,d=22;let h;c<=r||a>=r?h=l-d:h=r-a-d,i.style.top=`${h}px`})}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const s=this._getRenderedHoverPartAtIndex(t),o=s==null?void 0:s.hoverPart.source;if(!s||!(o!=null&&o.supportsVerbosityAction(e)))return;const r=await this._fetchHover(o,i,e);if(!r)return;const a=new Mwe(r,o.hoverProvider,o.hoverPosition),l=s.hoverPart,c=new Fc(this._hoverParticipant,l.range,r.contents,l.isBeforeContent,l.ordinal,a),d=this._updateRenderedHoverPart(t,c);if(d)return{hoverPart:c,hoverElement:d.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(e,t,i){let s=i===aa.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),s+=r.verbosityDelta);const a=new Wi;this._ongoingHoverOperations.set(o,{verbosityDelta:s,tokenSource:a});const l={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let c;try{c=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,l))}catch(d){Bn(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),c}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),s=this.renderedHoverParts[e],o=s.hoverElement,r=i.hoverElement,a=Array.from(r.children);o.replaceChildren(...a);const l=new A2(t,o,i.disposables,i.actionsContainer);return s.dispose(),this.renderedHoverParts[e]=l,l}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function Lit(n,e,t,i){e.sort(lo(o=>o.ordinal,pa));const s=[];for(const o of e){const r=Awe(t,o,i,n.onContentsChanged);n.fragment.appendChild(r.hoverElement),s.push(r)}return new xw(s)}function Awe(n,e,t,i){const s=new ne,o=vv("div.hover-row"),r=vv("div.hover-row-contents");o.appendChild(r);const a=e.contents;for(const c of a){if(xS(c))continue;const d=vv("div.markdown-hover"),h=ue(d,vv("div.hover-contents")),u=s.add(t.render(c,{context:n,asyncRenderCallback:()=>{h.className="hover-contents code-hover-contents",i()}}));h.appendChild(u.element),r.appendChild(d)}return{hoverPart:e,hoverElement:o,dispose(){s.dispose()}}}function kit(n,e){switch(e){case aa.Increase:{const t=n.lookupKeybinding(q3);return t?_(1135,"Increase Hover Verbosity ({0})",t.getLabel()):_(1136,"Increase Hover Verbosity")}case aa.Decrease:{const t=n.lookupKeybinding(K3);return t?_(1137,"Decrease Hover Verbosity ({0})",t.getLabel()):_(1138,"Decrease Hover Verbosity")}}}const Fae=me;class Eit extends G{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Fae(".saturation-wrap"),ue(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ue(this._domNode,this._canvas),this.selection=Fae(".saturation-selection"),ue(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,_e.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new nx);const t=dn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=J(e.target.ownerDocument,_e.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new se(new ou(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=se.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class Iit extends G{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=ue(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(J(this._button,_e.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const uL=me;class Pwe extends G{constructor(e,t,i){super(),this.model=t,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,i==="standalone"?(this.domNode=ue(e,uL(".standalone-strip")),this.overlay=ue(this.domNode,uL(".standalone-overlay"))):(this.domNode=ue(e,uL(".strip")),this.overlay=ue(this.domNode,uL(".overlay"))),this.slider=ue(this.domNode,uL(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,_e.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new nx),i=dn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=J(e.target.ownerDocument,_e.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class Nit extends Pwe{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new se(new re(t,i,s,1)),r=new se(new re(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Dit extends Pwe{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}const Tit=me;class Rit extends G{constructor(e,t,i,s){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Tit(".colorpicker-body"),ue(e,this._domNode),this._saturationBox=new Eit(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Nit(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Dit(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s==="standalone"&&(this._insertButton=this._register(new Iit(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new se(new ou(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new se(new ou(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new se(new ou(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const Mit=me;class Ait extends G{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ue(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ue(this._button,t),ue(t,Mit(".button"+Ue.asCSSSelector(Ai("color-picker-close",de.close,_(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(J(this._button,_e.CLICK,()=>{this._onClicked.fire()}))}}const P2=me;class Pit extends G{constructor(e,t,i,s){super(),this.model=t,this.type=s,this._closeButton=null,this._domNode=P2(".colorpicker-header"),ue(e,this._domNode),this._pickedColorNode=ue(this._domNode,P2(".picked-color")),ue(this._pickedColorNode,P2("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ue(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=_(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=ue(this._domNode,P2(".original-color")),this._originalColorNode.style.backgroundColor=se.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(OA)||se.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(OA)||se.white})),this._register(J(this._pickedColorNode,_e.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,_e.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=se.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.type==="standalone"&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Ait(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=se.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const Oit=me;class Owe extends Na{constructor(e,t,i,s,o){super(),this.model=t,this.pixelRatio=i,this._register(gI.getInstance(Oe(e)).onDidChange(()=>this.layout())),this._domNode=Oit(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new Pit(this._domNode,this.model,s,o)),this.body=this._register(new Rit(this._domNode,this.model,this.pixelRatio,o))}layout(){this.body.layout()}get domNode(){return this._domNode}}class Fit{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new q,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new q,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Wit=function(n,e){return function(t,i){e(t,i,n)}};class lO{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(e,t){return new lO(e,t.range,t.model,t.provider)}}let cO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,s){return Xl.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const s=TS.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[lO.fromBaseColor(this,await Fwe(this._editor.getModel(),r.colorInfo,r.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return t==="hover"||t==="clickAndHover";case 1:return t==="click"||t==="clickAndHover";case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(t.length===0||!i.hasModel())return new xw([]);const s=i.getOption(75)+8;e.setMinimumDimensions(new Qt(302,s));const o=new ne,r=t[0],a=i.getModel(),l=r.model;this._colorPicker=o.add(new Owe(e.fragment,l,i.getOption(163),this._themeService,"hover"));let c=!1,d=new D(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);o.add(l.onColorFlushed(async u=>{await wN(a,l,u,d,r),c=!0,d=Bwe(i,d,l)})),o.add(l.onDidChangeColor(u=>{wN(a,l,u,d,r)})),o.add(i.onDidChangeModelContent(u=>{c?c=!1:(e.hide(),i.focus())}));const h={hoverPart:lO.fromBaseColor(this,r),hoverElement:this._colorPicker.domNode,dispose(){o.dispose()}};return new xw([h])}getAccessibleContent(e){return _(887,"There is a color picker here.")}handleResize(){var e;(e=this._colorPicker)==null||e.layout()}handleContentsChanged(){var e;(e=this._colorPicker)==null||e.layout()}handleHide(){var e;(e=this._colorPicker)==null||e.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};cO=Bit([Wit(1,en)],cO);function B$(n,e){return!!n[e]}class e6{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=B$(e.event,t.triggerModifier),this.isMiddleClick&&t.mouseMiddleClickAction==="ctrlLeftClick"&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=B$(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Bae{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=B$(e,t.triggerModifier)}}class O2{constructor(e,t,i,s,o){this.mouseMiddleClickAction=o,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}}function Wae(n,e){return n==="altKey"?wt?new O2(57,"metaKey",6,"altKey",e):new O2(5,"ctrlKey",6,"altKey",e):wt?new O2(6,"altKey",57,"metaKey",e):new O2(6,"altKey",5,"ctrlKey",e)}class Z3 extends G{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new q),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new q),this.onExecute=this._onExecute.event,this._onCancel=this._register(new q),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(t==null?void 0:t.extractLineNumberFromMouseEvent)??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=Wae(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(86)||i.hasChanged(87)){const s=Wae(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new e6(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new e6(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new e6(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new Bae(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new Bae(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);!!this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink")&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class Wwe{constructor(e,t){this.range=e,this.direction=t}}class RX{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new RX(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t==null?void 0:t.tooltip)??this.hint.tooltip,this.hint.label=(t==null?void 0:t.label)??this.hint.label,this.hint.textEdits=(t==null?void 0:t.textEdits)??this.hint.textEdits,this._isResolved=!0}catch(t){Bn(t),this._isResolved=!1}}}const z0=class z0{static async create(e,t,i,s){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,s);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??z0._emptyInlayHintList,a])}catch(c){Bn(c)}}));if(await Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new ic;return new z0(i,o,t)}constructor(e,t,i){this._disposables=new ne,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const d=z0._getRangeAtPosition(i,l);let h;d.getStartPosition().isBefore(l)?(h=D.fromPositions(d.getStartPosition(),l),c="after"):(h=D.fromPositions(l,d.getEndPosition()),c="before"),s.push(new RX(a,new Wwe(h,c),r))}}this.items=s.sort((o,r)=>U.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new D(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===r&&a=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ju=function(n,e){return function(t,i){e(t,i,n)}};let Pg=class extends lw{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,o,r,a,l,c,d,h,u,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){D5(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Pg=Vit([Ju(4,Ae),Ju(5,Ft),Ju(6,Ei),Ju(7,Xe),Ju(8,en),Ju(9,fn),Ju(10,Us),Ju(11,Ki),Ju(12,De)],Pg);function Hwe(n){const e=n.get(Ft).getFocusedCodeEditor();return e instanceof Pg?e.getParentEditor():e}const Hae=new se(new re(0,122,204)),zit={showArrow:!0,showFrame:!0,className:"",frameColor:Hae,arrowColor:Hae,keepEditorSelection:!1},jit="vs.editor.contrib.zoneWidget";class $it{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Uit{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const gF=class gF{constructor(e){this._editor=e,this._ruleName=gF._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),GH(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){GH(this._ruleName),AA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:D.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};gF._IdGenerator=new CZ(".arrow-decoration-");let W$=gF;class qit{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new ne,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=jh(t),D5(this.options,zit,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new W$(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)==null||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=D.isIRange(e)?D.lift(e):D.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:nt.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)==null||e.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const e=this.editor.getOption(75);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=this.options.frameWidth??Math.round(e/9);t+=2*i}return t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(75),l=this._getMaximumHeightInLines();l!==void 0&&(t=Math.min(t,l));let c=0,d=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new $it(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new Uit(jit+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}const h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const f=u.validateRange(new D(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(f,f.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){const i=this._getMaximumHeightInLines(),s=t&&i!==void 0?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==s&&(this.editor.changeViewZones(o=>{this._viewZone&&(this._viewZone.heightInLines=s,o.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new bo(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(75),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>e.minLines&&o=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zwe=function(n,e){return function(t,i){e(t,i,n)}};const jwe=mt("IPeekViewService");xt(jwe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var Kr;(function(n){n.inPeekEditor=new Se("inReferenceSearchEditor",!0,_(1316,"Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Kr||(Kr={}));var Ty;let hO=(Ty=class{constructor(e,t){e instanceof Pg&&Kr.inPeekEditor.bindTo(t)}dispose(){}},Ty.ID="editor.contrib.referenceController",Ty);hO=Vwe([zwe(1,Xe)],hO);At(hO.ID,hO,0);const Kit={headerBackgroundColor:se.white,primaryHeadingColor:se.fromHex("#333333"),secondaryHeadingColor:se.fromHex("#6c6c6cb3")};let uO=class extends qit{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,D5(this.options,Kit,!1);const s=Ui(this.editor);s.openedPeekWidgets.set(s.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=Ui(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=me(".head"),this._bodyElement=me(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=me(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),xn(this._titleElement,"click",o=>this._onTitleClick(o))),ue(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=me("span.filename"),this._secondaryHeading=me("span.dirname"),this._metaHeading=me("span.meta"),ue(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=me(".peekview-actions");ue(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new Vr(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new ol("peekview.close",_(1317,"Close"),Ue.asClassName(de.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:AZ.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:js(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,la(this._metaHeading)):ar(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(75)*1.2),s=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};uO=Vwe([zwe(2,Ae)],uO);const Git=F("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:se.black,hcLight:se.white},_(1318,"Background color of the peek view title area.")),$we=F("peekViewTitleLabel.foreground",{dark:se.white,light:se.black,hcDark:se.white,hcLight:Ru},_(1319,"Color of the peek view title.")),Uwe=F("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},_(1320,"Color of the peek view title info.")),Yit=F("peekView.border",{dark:Cu,light:Cu,hcDark:Dt,hcLight:Dt},_(1321,"Color of the peek view borders and arrow.")),Zit=F("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:se.black,hcLight:se.white},_(1322,"Background color of the peek view result list."));F("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:se.white,hcLight:Ru},_(1323,"Foreground color for line nodes in the peek view result list."));F("peekViewResult.fileForeground",{dark:se.white,light:"#1E1E1E",hcDark:se.white,hcLight:Ru},_(1324,"Foreground color for file nodes in the peek view result list."));F("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},_(1325,"Background color of the selected entry in the peek view result list."));F("peekViewResult.selectionForeground",{dark:se.white,light:"#6C6C6C",hcDark:se.white,hcLight:Ru},_(1326,"Foreground color of the selected entry in the peek view result list."));const MX=F("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:se.black,hcLight:se.white},_(1327,"Background color of the peek view editor."));F("peekViewEditorGutter.background",MX,_(1328,"Background color of the gutter in the peek view editor."));F("peekViewEditorStickyScroll.background",MX,_(1329,"Background color of sticky scroll in the peek view editor."));F("peekViewEditorStickyScrollGutter.background",MX,_(1330,"Background color of the gutter part of sticky scroll in the peek view editor."));F("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},_(1331,"Match highlight color in the peek view result list."));F("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},_(1332,"Match highlight color in the peek view editor."));F("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Vi,hcLight:Vi},_(1333,"Match highlight border in the peek view editor."));class Og{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=rz.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var t;const e=(t=this.parent.getPreview(this))==null?void 0:t.preview(this.range);return e?_(1088,"{0} in {1} on line {2} at column {3}",e.value,rc(this.uri),this.range.startLineNumber,this.range.startColumn):_(1087,"in {0} on line {1} at column {2}",rc(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Xit{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new D(s,l.startColumn,s,o),d=new D(r,a,r,1073741824),h=i.getValueInRange(c).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class AS{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new kn}dispose(){Jt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?_(1089,"1 symbol in {0}, full path {1}",rc(this.uri),this.uri.fsPath):_(1090,"{0} symbols in {1}, full path {2}",e,rc(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new Xit(i))}catch(i){Je(i)}return this}}class ba{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new q,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(ba._compareReferences);let s;for(const o of e)if((!s||!Hi.isEqual(s.uri,o.uri,!0))&&(s=new AS(this,o.uri),this.groups.push(s)),s.children.length===0||ba._compareReferences(o,s.children[s.children.length-1])!==0){const r=new Og(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Jt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new ba(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?_(1091,"No results found"):this.references.length===1?_(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?_(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):_(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:Kc(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&D.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Hi.compare(e.uri,t.uri)||D.compareRangesUsingStarts(e.range,t.range)}}var X3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q3=function(n,e){return function(t,i){e(t,i,n)}},H$;let V$=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof ba||e instanceof AS}getChildren(e){if(e instanceof ba)return e.groups;if(e instanceof AS)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};V$=X3([Q3(0,Xo)],V$);class Qit{getHeight(){return 23}getTemplateId(e){return e instanceof AS?fO.id:gO.id}}let z$=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Og){const i=(t=e.parent.getPreview(e))==null?void 0:t.preview(e.range);if(i)return i.value}return rc(e.uri)}};z$=X3([Q3(0,Ht)],z$);class Jit{getId(e){return e instanceof Og?e.id:e.uri}}let j$=class extends G{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new tN(i,{supportHighlights:!0})),this.badge=this._register(new Xz(ue(i,me(".count")),{},rve)),e.appendChild(i)}set(e,t){const i=X5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(_(1081,"{0} references",s)):this.badge.setTitleFormat(_(1082,"{0} reference",s))}};j$=X3([Q3(1,hw)],j$);var i1;let fO=(i1=class{constructor(e){this._instantiationService=e,this.templateId=H$.id}renderTemplate(e){return this._instantiationService.createInstance(j$,e)}renderElement(e,t,i){i.set(e.element,xD(e.filterData))}disposeTemplate(e){e.dispose()}},H$=i1,i1.id="FileReferencesRenderer",i1);fO=H$=X3([Q3(0,Ae)],fO);class ent extends G{constructor(e){super(),this.label=this._register(new Im(e))}set(e,t){var s;const i=(s=e.parent.getPreview(e))==null?void 0:s.preview(e.range);if(!i||!i.value)this.label.set(`${rc(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=i;t&&!jc.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,xD(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}const pF=class pF{constructor(){this.templateId=pF.id}renderTemplate(e){return new ent(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};pF.id="OneReferenceRenderer";let gO=pF;class tnt{getWidgetAriaLabel(){return _(1083,"References")}getAriaLabel(e){return e.ariaMessage}}var qwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vb=function(n,e){return function(t,i){e(t,i,n)}};const mF=class mF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new ne,this._callOnModelChange=new ne,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;rthis.labelService.getUriBasenameLabel(i.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const s=e.elements.map(o=>this.getDragURI(o)).filter(Boolean);s.length&&(t.dataTransfer.setData(uw.RESOURCES,JSON.stringify(s)),t.dataTransfer.setData(uw.TEXT,s.join(` -`)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};U$=qwe([vb(0,hw)],U$);let q$=class extends uO{constructor(e,t,i,s,o,r,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new ne,this._callOnDispose=new ne,this._onDidSelectReference=new q,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Qt(0,0),this._isClosing=!1,this._applyTheme(s.getColorTheme()),this._callOnDispose.add(s.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),Jt(this._preview),Jt(this._previewNotAvailableMessage),Jt(this._tree),Jt(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Yit)||se.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(Git)||se.transparent,primaryHeadingColor:e.getColor($we),secondaryHeadingColor:e.getColor(Uwe)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=ue(e,me("div.messages")),ar(this._messageContainer),this._splitView=new Nve(e,{orientation:1}),this._previewContainer=ue(e,me("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Pg,this._previewContainer,t,{},this.editor),ar(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(aw,_(1084,"no preview available"),al,aw.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=ue(e,me("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new tnt,keyboardNavigationLabelProvider:this._instantiationService.createInstance(z$),identityProvider:new Jit,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Zit},dnd:this._instantiationService.createInstance(U$)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(xn(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(nnt,"ReferencesWidget",this._treeContainer,new Qit,[this._instantiationService.createInstance(fO),this._instantiationService.createInstance(gO)],this._instantiationService.createInstance(V$),i),this._splitView.addView({onDidChange:ve.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},DP.Distribute),this._splitView.addView({onDidChange:ve.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},DP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof Og&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")})),ar(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Qt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=_(1085,"No results"),la(this._messageContainer),Promise.resolve(void 0)):(ar(this._messageContainer),this._decorationsManager=new $$(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),la(this._treeContainer),la(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Og)return e;if(e instanceof AS&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Ge.inMemory?this.setTitle(K4e(e.uri),this._uriLabel.getUriLabel(X5(e.uri))):this.setTitle(_(1086,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}Jt(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=D.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};q$=qwe([vb(3,en),vb(4,Xo),vb(5,Ae),vb(6,jwe),vb(7,hw),vb(8,Ht)],q$);var snt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kC=function(n,e){return function(t,i){e(t,i,n)}},iM;const Yw=new Se("referenceSearchVisible",!1,_(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var n1;let Lw=(n1=class{static get(e){return e.getContribution(iM.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new ne,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=Yw.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)==null||e.dispose(),(t=this._model)==null||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=int.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(q$,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(_(1079,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)==null||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(_(1080,"{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,h=new U(e.startLineNumber,e.startColumn),u=this._model.nearestReference(d,h);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(99)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)==null||t.dispose(),(i=this._model)==null||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var s;(s=this._widget)==null||s.hide(),this._ignoreModelChangeEvent=!0;const i=D.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(i),this._widget.focusOnReferenceTree();else{const r=iM.get(o),a=this._model.clone();this.closeWidget(),o.focus(),r==null||r.toggleWidget(i,ss(l=>Promise.resolve(a)),this._peekMode??!1)}},o=>{this._ignoreModelChangeEvent=!1,Je(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}},iM=n1,n1.ID="editor.contrib.referencesController",n1);Lw=iM=snt([kC(2,Xe),kC(3,Ft),kC(4,fn),kC(5,Ae),kC(6,Qo),kC(7,lt)],Lw);function Zw(n,e){const t=Hwe(n);if(!t)return;const i=Lw.get(t);i&&e(i)}As.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Wn(2089,60),when:le.or(Yw,Kr.inPeekEditor),handler(n){Zw(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});As.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:le.or(Yw,Kr.inPeekEditor),handler(n){Zw(n,e=>{e.goToNextOrPreviousReference(!0)})}});As.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:le.or(Yw,Kr.inPeekEditor),handler(n){Zw(n,e=>{e.goToNextOrPreviousReference(!1)})}});Rt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rt.registerCommand("closeReferenceSearch",n=>Zw(n,e=>e.closeWidget()));As.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:le.and(Kr.inPeekEditor,le.not("config.editor.stablePeek"))});As.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:le.and(Yw,le.not("config.editor.stablePeek"),le.or(H.editorTextFocus,UZ.negate()))});As.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:le.and(Yw,Wve,YZ.negate(),ZZ.negate()),handler(n){var i;const t=(i=n.get(mc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Zw(n,s=>s.revealReference(t[0]))}});As.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:le.and(Yw,Wve,YZ.negate(),ZZ.negate()),handler(n){var i;const t=(i=n.get(mc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Zw(n,s=>s.openReference(t[0],!0,!0))}});Rt.registerCommand("openReference",n=>{var i;const t=(i=n.get(mc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Zw(n,s=>s.openReference(t[0],!1,!0))});var Kwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},BL=function(n,e){return function(t,i){e(t,i,n)}};const AX=new Se("hasSymbols",!1,_(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),J3=mt("ISymbolNavigationService");let K$=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=AX.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)==null||e.dispose(),(t=this._currentMessage)==null||t.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new G$(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const h of t.references)if(i_(h.uri,a.uri))c=!0,d=d||D.containsPosition(h.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=Hc(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:D.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)==null||i.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?_(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):_(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};K$=Kwe([BL(0,Xe),BL(1,Ft),BL(2,fn),BL(3,Ht)],K$);xt(J3,K$,1);ye(new class extends cs{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:AX,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(J3).revealNext(e)}});As.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:AX,primary:9,handler(n){n.get(J3).reset()}});let G$=class{constructor(e){this._listener=new Map,this._disposables=new ne,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),Jt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Hc(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))==null||t.dispose(),this._listener.delete(e)}};G$=Kwe([BL(0,Ft)],G$);function Y$(n,e){return e.uri.scheme===n.uri.scheme?!0:!fH(e.uri,Ge.walkThroughSnippet,Ge.vscodeChatCodeBlock,Ge.vscodeChatCodeCompareBlock)}async function WD(n,e,t,i,s){const r=t.ordered(n,i).map(l=>Promise.resolve(s(l,n,e)).then(void 0,c=>{Bn(c)})),a=await Promise.all(r);return rh(a.flat()).filter(l=>Y$(n,l))}function HD(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideDefinition(r,a,s))}function PX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideDeclaration(r,a,s))}function OX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideImplementation(r,a,s))}function FX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideTypeDefinition(r,a,s))}function VD(n,e,t,i,s,o){return WD(e,t,n,s,async(r,a,l)=>{var h,u;const c=(h=await r.provideReferences(a,l,{includeDeclaration:!0},o))==null?void 0:h.filter(f=>Y$(a,f));if(!i||!c||c.length!==2)return c;const d=(u=await r.provideReferences(a,l,{includeDeclaration:!1},o))==null?void 0:u.filter(f=>Y$(a,f));return d&&d.length===1?d:c})}async function Fu(n){const e=await n(),t=new ba(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}Yr("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(De),s=HD(i.definitionProvider,e,t,!1,vt.None);return Fu(()=>s)});Yr("_executeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(De),s=HD(i.definitionProvider,e,t,!0,vt.None);return Fu(()=>s)});Yr("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(De),s=FX(i.typeDefinitionProvider,e,t,!1,vt.None);return Fu(()=>s)});Yr("_executeTypeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(De),s=FX(i.typeDefinitionProvider,e,t,!0,vt.None);return Fu(()=>s)});Yr("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(De),s=PX(i.declarationProvider,e,t,!1,vt.None);return Fu(()=>s)});Yr("_executeDeclarationProvider_recursive",(n,e,t)=>{const i=n.get(De),s=PX(i.declarationProvider,e,t,!0,vt.None);return Fu(()=>s)});Yr("_executeReferenceProvider",(n,e,t)=>{const i=n.get(De),s=VD(i.referenceProvider,e,t,!1,!1,vt.None);return Fu(()=>s)});Yr("_executeReferenceProvider_recursive",(n,e,t)=>{const i=n.get(De),s=VD(i.referenceProvider,e,t,!1,!0,vt.None);return Fu(()=>s)});Yr("_executeImplementationProvider",(n,e,t)=>{const i=n.get(De),s=OX(i.implementationProvider,e,t,!1,vt.None);return Fu(()=>s)});Yr("_executeImplementationProvider_recursive",(n,e,t)=>{const i=n.get(De),s=OX(i.implementationProvider,e,t,!0,vt.None);return Fu(()=>s)});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextPeek,title:_(1038,"Peek"),group:"navigation",order:100});class PS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof PS||U.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const Ic=class Ic extends Qc{static all(){return Ic._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Nt.wrap(t.menu))(i.id===Te.EditorContext||i.id===Te.EditorContextPeek)&&(i.when=le.and(e.precondition,i.when));return t}constructor(e,t){super(Ic._patchConfig(t)),this.configuration=e,Ic._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(fn),r=e.get(Ft),a=e.get(Tg),l=e.get(J3),c=e.get(De),d=e.get(Ae),h=t.getModel(),u=t.getPosition(),f=PS.is(i)?i:new PS(h,u),g=new Mg(t,5),p=lS(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async m=>{var w;if(!m||g.token.isCancellationRequested)return;_r(m.ariaMessage);let b;if(m.referenceAt(h.uri,u)){const C=this._getAlternativeCommand(t);C!==void 0&&!Ic._activeAlternativeCommands.has(C)&&Ic._allSymbolNavigationCommands.has(C)&&(b=Ic._allSymbolNavigationCommands.get(C))}const v=m.references.length;if(v===0){if(!this.configuration.muteMessage){const C=h.getWordAtPosition(u);(w=_a.get(t))==null||w.showMessage(this._getNoResultFoundMessage(C),u)}}else if(v===1&&b)Ic._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(C=>b.runEditorCommand(C,t,i,s).finally(()=>{Ic._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,m,s)},m=>{o.error(m)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,i,s,o){const r=this._getGoToPreference(i);if(!(i instanceof Pg)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,s,o){let r;if(EPe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:D.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const s=Lw.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),ss(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Ic._allSymbolNavigationCommands=new Map,Ic._activeAlternativeCommands=new Set;let Fg=Ic;class zD extends Fg{async _getLocationModel(e,t,i,s){return new ba(await HD(e.definitionProvider,t,i,!1,s),_(1039,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?_(1040,"No definition found for '{0}'",e.word):_(1041,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}}var Bm;ni((Bm=class extends zD{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Bm.id,title:{...ie(1065,"Go to Definition"),mnemonicTitle:_(1042,"Go to &&Definition")},precondition:H.hasDefinitionProvider,keybinding:[{when:H.editorTextFocus,primary:70,weight:100},{when:le.and(H.editorTextFocus,Pve),primary:2118,weight:100}],menu:[{id:Te.EditorContext,group:"navigation",order:1.1},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rt.registerCommandAlias("editor.action.goToDeclaration",Bm.id)}},Bm.id="editor.action.revealDefinition",Bm));var Wm;ni((Wm=class extends zD{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Wm.id,title:ie(1066,"Open Definition to the Side"),precondition:le.and(H.hasDefinitionProvider,H.isInEmbeddedEditor.toNegated()),keybinding:[{when:H.editorTextFocus,primary:Wn(2089,70),weight:100},{when:le.and(H.editorTextFocus,Pve),primary:Wn(2089,2118),weight:100}]}),Rt.registerCommandAlias("editor.action.openDeclarationToTheSide",Wm.id)}},Wm.id="editor.action.revealDefinitionAside",Wm));var Hm;ni((Hm=class extends zD{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Hm.id,title:ie(1067,"Peek Definition"),precondition:le.and(H.hasDefinitionProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Te.EditorContextPeek,group:"peek",order:2}}),Rt.registerCommandAlias("editor.action.previewDeclaration",Hm.id)}},Hm.id="editor.action.peekDefinition",Hm));class Gwe extends Fg{async _getLocationModel(e,t,i,s){return new ba(await PX(e.declarationProvider,t,i,!1,s),_(1043,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?_(1044,"No declaration found for '{0}'",e.word):_(1045,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}}var s1;ni((s1=class extends Gwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:s1.id,title:{...ie(1068,"Go to Declaration"),mnemonicTitle:_(1046,"Go to &&Declaration")},precondition:le.and(H.hasDeclarationProvider,H.isInEmbeddedEditor.toNegated()),menu:[{id:Te.EditorContext,group:"navigation",order:1.3},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?_(1047,"No declaration found for '{0}'",e.word):_(1048,"No declaration found")}},s1.id="editor.action.revealDeclaration",s1));ni(class extends Gwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:ie(1069,"Peek Declaration"),precondition:le.and(H.hasDeclarationProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:3}})}});class Ywe extends Fg{async _getLocationModel(e,t,i,s){return new ba(await FX(e.typeDefinitionProvider,t,i,!1,s),_(1049,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?_(1050,"No type definition found for '{0}'",e.word):_(1051,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}}var o1;ni((o1=class extends Ywe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:o1.ID,title:{...ie(1070,"Go to Type Definition"),mnemonicTitle:_(1052,"Go to &&Type Definition")},precondition:H.hasTypeDefinitionProvider,keybinding:{when:H.editorTextFocus,primary:0,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.4},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},o1.ID="editor.action.goToTypeDefinition",o1));var r1;ni((r1=class extends Ywe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:r1.ID,title:ie(1071,"Peek Type Definition"),precondition:le.and(H.hasTypeDefinitionProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:4}})}},r1.ID="editor.action.peekTypeDefinition",r1));class Zwe extends Fg{async _getLocationModel(e,t,i,s){return new ba(await OX(e.implementationProvider,t,i,!1,s),_(1053,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?_(1054,"No implementation found for '{0}'",e.word):_(1055,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}}var a1;ni((a1=class extends Zwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:a1.ID,title:{...ie(1072,"Go to Implementations"),mnemonicTitle:_(1056,"Go to &&Implementations")},precondition:H.hasImplementationProvider,keybinding:{when:H.editorTextFocus,primary:2118,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},a1.ID="editor.action.goToImplementation",a1));var l1;ni((l1=class extends Zwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:l1.ID,title:ie(1073,"Peek Implementations"),precondition:le.and(H.hasImplementationProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:3142,weight:100},menu:{id:Te.EditorContextPeek,group:"peek",order:5}})}},l1.ID="editor.action.peekImplementation",l1));class Xwe extends Fg{_getNoResultFoundMessage(e){return e?_(1057,"No references found for '{0}'",e.word):_(1058,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}}ni(class extends Xwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...ie(1074,"Go to References"),mnemonicTitle:_(1059,"Go to &&References")},precondition:le.and(H.hasReferenceProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:1094,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new ba(await VD(e.referenceProvider,t,i,!0,!1,s),_(1060,"References"))}});ni(class extends Xwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:ie(1075,"Peek References"),precondition:le.and(H.hasReferenceProvider,Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new ba(await VD(e.referenceProvider,t,i,!1,!1,s),_(1061,"References"))}});class ont extends Fg{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:ie(1076,"Go to Any Symbol"),precondition:le.and(Kr.notInPeekEditor,H.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new ba(this._references,_(1062,"Locations"))}_getNoResultFoundMessage(e){return e&&_(1063,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}}Rt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:He},{name:"position",description:"The position at which to start",constraint:U.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(n,e,t,i,s,o,r)=>{Ot(He.isUri(e)),Ot(U.isIPosition(t)),Ot(Array.isArray(i)),Ot(typeof s>"u"||typeof s=="string"),Ot(typeof r>"u"||typeof r=="boolean");const a=n.get(Ft),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(sh(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends ont{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(Ae).invokeFunction(d.run.bind(d),l)})}});Rt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:He},{name:"position",description:"The position at which to start",constraint:U.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(n,e,t,i,s)=>{n.get(Ei).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});Rt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Ot(He.isUri(e)),Ot(U.isIPosition(t));const i=n.get(De),s=n.get(Ft);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!sh(o)||!o.hasModel())return;const r=Lw.get(o);if(!r)return;const a=ss(c=>VD(i.referenceProvider,o.getModel(),U.lift(t),!1,!1,c).then(d=>new ba(d,_(1064,"References")))),l=new D(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Rt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function rnt(n,e,t,i){const s=n.get(Xo),o=n.get(gl),r=n.get(Ei),a=n.get(Ae),l=n.get(fn);if(await i.item.resolve(vt.None),!i.part.location)return;const c=i.part.location,d=[],h=new Set(Rs.getMenuItems(Te.EditorContext).map(f=>iy(f)?f.command.id:Ww()));for(const f of Fg.all())h.has(f.desc.id)&&d.push(new ol(f.desc.id,rl.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const g=await s.createModelReference(c.uri);try{const p=new PS(g.object.textEditorModel,D.getStartPosition(c.range)),m=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,p,m)}finally{g.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Xn),d.push(new ol(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(g){l.notify({severity:lx.Error,source:i.item.provider.displayName,message:g})}}))}const u=e.getOption(144);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=dn(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function Qwe(n,e,t,i){const o=await n.get(Xo).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,l=r.get(Xe),c=Kr.inPeekEditor.getValue(l),d=!a&&t.getOption(101)&&!c;return new zD({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new PS(o.object.textEditorModel,D.getStartPosition(i.range)),D.lift(i.range))}),o.dispose()}var ant=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EC=function(n,e){return function(t,i){e(t,i,n)}},VC;class pO{constructor(){this._entries=new Xc(50)}get(e){const t=pO._key(e);return this._entries.get(t)}set(e,t){const i=pO._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Jwe=mt("IInlayHintsCache");xt(Jwe,pO,1);class Z${constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class lnt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}class cnt{constructor(){this._store=new Kt,this._tokenSource=new Wi}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new Wi,this._store.value=new ne,{store:this._store.value,token:this._tokenSource.token}}}var eg;let CN=(eg=class{static get(e){return e.getContribution(VC.ID)??void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new ne,this._sessionDisposables=new ne,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new BA(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let c,d;e.enabled==="onUnlessPressed"?(c=0,d=1):(c=1,d=0),this._activeRenderMode=c,this._sessionDisposables.add(jf.getInstance().event(h=>{if(!this._editor.hasModel())return;const u=h.altKey&&h.ctrlKey&&!(h.shiftKey||h.metaKey)?d:c;if(u!==this._activeRenderMode){this._activeRenderMode=u;const f=this._editor.getModel(),g=this._copyInlayHintsWithCurrentAnchor(f);this._updateHintsDecorators([f.getFullModelRange()],g),a.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Re(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set;this._sessionDisposables.add(t.onWillDispose(()=>s==null?void 0:s.cancel()));const r=this._sessionDisposables.add(new cnt),a=new ai(async()=>{const c=Date.now(),{store:d,token:h}=r.reset();try{const u=await dO.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),h);if(a.delay=this._debounceInfo.update(t,Date.now()-c),h.isCancellationRequested){u.dispose();return}for(const f of u.provider)typeof f.onDidChangeInlayHints=="function"&&!o.has(f)&&(o.add(f),d.add(f.onDidChangeInlayHints(()=>{a.isScheduled()||a.schedule()})));d.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(u){Je(u)}},this._debounceInfo.get(t));this._sessionDisposables.add(a),a.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(c=>{(c.scrollTopChanged||!a.isScheduled())&&a.schedule()}));const l=this._sessionDisposables.add(new Kt);this._sessionDisposables.add(this._editor.onDidChangeModelContent(c=>{const d=Math.max(a.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+d},l.value=kg(()=>a.schedule(0),d),a.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(159)&&a.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>a.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new ne,t=e.add(new Z3(this._editor)),i=new ne;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Wi;i.add(Re(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new lnt(r,o.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new D(c,1,c,a.getLineMaxColumn(c)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Re(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(Qwe,s,this._editor,r.location):uW.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(vt.None),Go(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>ln.replace(D.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!hn(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(rnt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var i;if(e.target.type!==6)return;const t=(i=e.target.detail.injectedText)==null?void 0:i.options;if(t instanceof l_&&(t==null?void 0:t.attachedData)instanceof Z$)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:lx.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new Wwe(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(D.compareRangesUsingStarts)){const r=t.validateRange(new D(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!D.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=D.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){var m,b;const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some(v=>v.containsPosition(this._cursorInfo.position))){const{position:v}=this._cursorInfo;this._cursorInfo=void 0;const w=new Map;for(const x of this._editor.getLineDecorations(v.lineNumber)??[]){const E=this._decorationsMetadata.get(x.id);if(x.range.startColumn>v.column)continue;const I=E==null?void 0:E.decoration.options[E.item.anchor.direction];if(I&&I.attachedData!==VC._whitespaceData){const R=w.get(E.item)??0;w.set(E.item,R+I.content.length)}}const C=t.filter(x=>x.anchor.range.startLineNumber===v.lineNumber&&x.anchor.range.endColumn<=v.column),S=Array.from(w.values());let L;for(;;){const x=C.shift(),E=S.shift();if(!E&&!x)break;if(x)i.set(x,E??0),L=x;else if(L&&E){let I=i.get(L);I+=E,I+=S.reduce((R,M)=>R+M,0),S.length=0;break}}}const s=[],o=(v,w,C,S,L)=>{const x={content:C,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:w.className,cursorStops:S,attachedData:L};s.push({item:v,classNameRef:w,decoration:{range:v.anchor.range,options:{description:"InlayHint",showIfCollapsed:v.anchor.range.isEmpty(),collapseOnReplaceEdit:!v.anchor.range.isEmpty(),stickiness:0,[v.anchor.direction]:this._activeRenderMode===0?x:void 0}}})},r=(v,w)=>{const C=this._ruleFactory.createClassNameRef({width:`${a/3|0}px`,display:"inline-block"});o(v,C," ",w?jl.Right:jl.None,VC._whitespaceData)},{fontSize:a,fontFamily:l,padding:c,isUniform:d}=this._getLayoutInfo(),h=this._editor.getOption(159).maximumLength,u="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(u,l);let f={line:0,totalLen:0};for(let v=0;vh)continue;w.hint.paddingLeft&&r(w,!1);const C=typeof w.hint.label=="string"?[{label:w.hint.label}]:w.hint.label,S=i.get(w);let L=0;for(let x=0;x0&&(A=A.slice(0,-P)+"…",W=!0),L+=A.length,S!==void 0){const B=L-S;B>=0&&(L-=B,A=A.slice(0,-(1+B))+"…",W=!0)}if(c&&(I&&(R||W)?(M.padding=`1px ${Math.max(1,a/4)|0}px`,M.borderRadius=`${a/4|0}px`):I?(M.padding=`1px 0 1px ${Math.max(1,a/4)|0}px`,M.borderRadius=`${a/4|0}px 0 0 ${a/4|0}px`):R||W?(M.padding=`1px ${Math.max(1,a/4)|0}px 1px 0`,M.borderRadius=`0 ${a/4|0}px ${a/4|0}px 0`):M.padding="1px 0 1px 0"),o(w,this._ruleFactory.createClassNameRef(M),dnt(A),R&&!w.hint.paddingRight?jl.Right:jl.None,new Z$(w,x)),W)break}if(S!==void 0&&LVC._MAX_DECORATORS)break}const g=[];for(const[v,w]of this._decorationsMetadata){const C=(b=this._editor.getModel())==null?void 0:b.getDecorationRange(v);C&&e.some(S=>S.containsRange(C))&&(g.push(v),w.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const p=nh.capture(this._editor);this._editor.changeDecorations(v=>{const w=v.deltaDecorations(g,s.map(C=>C.decoration));for(let C=0;Ci)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}},VC=eg,eg.ID="editor.contrib.InlayHints",eg._MAX_DECORATORS=1500,eg._whitespaceData={},eg);CN=VC=ant([EC(1,De),EC(2,pc),EC(3,Jwe),EC(4,Ei),EC(5,fn),EC(6,Ae)],CN);function dnt(n){return n.replace(/[ \t]/g," ")}Rt.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;Ot(He.isUri(t)),Ot(D.isIRange(i));const{inlayHintsProvider:s}=n.get(De),o=await n.get(Xo).createModelReference(t);try{const r=await dO.create(s,o.object.textEditorModel,[D.lift(i)],vt.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});var hnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q_=function(n,e){return function(t,i){e(t,i,n)}};class Vae extends FL{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let mO=class extends vN{constructor(e,t,i,s,o,r,a,l){super(e,t,o,a,i,s,l),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var s;if(!CN.get(this._editor)||e.target.type!==6)return null;const i=(s=e.target.detail.injectedText)==null?void 0:s.options;return i instanceof l_&&i.attachedData instanceof Z$?new Vae(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,s){return e instanceof Vae?new Xl(async o=>{const{part:r}=e;if(await r.item.resolve(s),s.isCancellationRequested)return;let a;typeof r.item.hint.tooltip=="string"?a=new yo().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(a=r.item.hint.tooltip),a&&o.emitOne(new Fc(this,e.range,[a],!1,0)),Go(r.item.hint.textEdits)&&o.emitOne(new Fc(this,e.range,[new yo().appendText(_(1164,"Double-click to insert"))],!1,10001));let l;if(typeof r.part.tooltip=="string"?l=new yo().appendText(r.part.tooltip):r.part.tooltip&&(l=r.part.tooltip),l&&o.emitOne(new Fc(this,e.range,[l],!1,1)),r.part.location||r.part.command){let d;const u=this._editor.getOption(86)==="altKey"?wt?_(1165,"cmd + click"):_(1166,"ctrl + click"):wt?_(1167,"option + click"):_(1168,"alt + click");r.part.location&&r.part.command?d=new yo().appendText(_(1169,"Go to Definition ({0}), right click for more",u)):r.part.location?d=new yo().appendText(_(1170,"Go to Definition ({0})",u)):r.part.command&&(d=new yo(`[${_(1171,"Execute Command")}](${Hit(r.part.command)} "${r.part.command.title}") (${u})`,{isTrusted:!0})),d&&o.emitOne(new Fc(this,e.range,[d],!1,1e4))}const c=this._resolveInlayHintLabelPartHover(r,s);for await(const d of c)o.emitOne(d)}):Xl.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:s}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(r))return;for await(const a of TX(this._languageFeaturesService.hoverProvider,r,new U(s.startLineNumber,s.startColumn),t))xS(a.hover.contents)||(yield new Fc(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal))}finally{o.dispose()}}};mO=hnt([Q_(1,Jc),Q_(2,Ht),Q_(3,Cr),Q_(4,lt),Q_(5,Xo),Q_(6,De),Q_(7,Ei)],mO);var eCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_O=function(n,e){return function(t,i){e(t,i,n)}};class zae{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let X$=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._dispoables=new ne,this._markers=[],this._nextIdx=-1,He.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=oI(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=D.compareRangesUsingStarts(a,l)||Xi.compare(a.severity,l.severity):c=Xi.compare(a.severity,l.severity)||D.compareRangesUsingStarts(a,l)),c},r=()=>{let a=this._markerService.read({resource:He.isUri(e)?e:void 0,severities:Xi.Error|Xi.Warning|Xi.Info});return typeof e=="function"&&(a=a.filter(l=>this._resourceFilter(l.resource))),a.sort(o),Bi(a,this._markers,(l,c)=>l.resource.toString()===c.resource.toString()&&l.startLineNumber===c.startLineNumber&&l.startColumn===c.startColumn&&l.endLineNumber===c.endLineNumber&&l.endColumn===c.endColumn&&l.severity===c.severity&&l.message===c.message)?!1:(this._markers=a,!0)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&r()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new zae(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=this._markers.findIndex(o=>i_(o.resource,e.uri));if(s<0)s=wG(this._markers.length,o=>oI(this._markers[o].resource.toString(),e.uri.toString())),s<0&&(s=~s),i?this._nextIdx=s:this._nextIdx=(this._markers.length+s-1)%this._markers.length;else{let o=!1,r=!1;for(let a=s;as.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},IC=function(n,e){return function(t,i){e(t,i,n)}},eU;class fnt{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new ne,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(xn(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new Nme(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Jt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=wa(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);js(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=me("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ue(this._codeLink,me("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(js(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Go(s)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(75)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const m=document.createElement("span");m.innerText=f.message,g.appendChild(p),g.appendChild(m),this._lines+=1,u.appendChild(g)}}const c=this._editor.getOption(59),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Xi.Error:t=_(1024,"Error");break;case Xi.Warning:t=_(1025,"Warning");break;case Xi.Info:t=_(1026,"Info");break;case Xi.Hint:t=_(1027,"Hint");break}let i=_(1028,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var c1;let yN=(c1=class extends uO{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new ne,this._onDidSelectRelatedInformation=new q,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Xi.Warning,this._backgroundColor=se.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(_nt);let t=tU,i=gnt;this._severity===Xi.Warning?(t=nM,i=pnt):this._severity===Xi.Info&&(t=iU,i=mnt);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor($we),secondaryHeadingColor:e.getColor(Uwe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=this._menuService.getMenuActions(eU.TitleMenu,this._contextKeyService),i=TKe(t);this._actionbarWidget.push(i,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=ue(e,me(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new fnt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=D.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?_(1029,"{0} of {1} problems",t,i):_(1030,"{0} of {1} problem",t,i);this.setTitle(rc(a.uri),l)}this._icon.className=`codicon ${J$.className(Xi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},eU=c1,c1.TitleMenu=new Te("gotoErrorTitleMenu"),c1);yN=eU=unt([IC(1,en),IC(2,jg),IC(3,uc),IC(4,Ae),IC(5,Xe),IC(6,hw)],yN);const jae=xI(d3,d8e),$ae=xI(Eg,LI),Uae=xI(Cu,kI),tU=F("editorMarkerNavigationError.background",{dark:jae,light:jae,hcDark:Dt,hcLight:Dt},_(1031,"Editor marker navigation widget error color.")),gnt=F("editorMarkerNavigationError.headerBackground",{dark:st(tU,.1),light:st(tU,.1),hcDark:null,hcLight:null},_(1032,"Editor marker navigation widget error heading background.")),nM=F("editorMarkerNavigationWarning.background",{dark:$ae,light:$ae,hcDark:Dt,hcLight:Dt},_(1033,"Editor marker navigation widget warning color.")),pnt=F("editorMarkerNavigationWarning.headerBackground",{dark:st(nM,.1),light:st(nM,.1),hcDark:"#0C141F",hcLight:st(nM,.2)},_(1034,"Editor marker navigation widget warning heading background.")),iU=F("editorMarkerNavigationInfo.background",{dark:Uae,light:Uae,hcDark:Dt,hcLight:Dt},_(1035,"Editor marker navigation widget info color.")),mnt=F("editorMarkerNavigationInfo.headerBackground",{dark:st(iU,.1),light:st(iU,.1),hcDark:null,hcLight:null},_(1036,"Editor marker navigation widget info heading background.")),_nt=F("editorMarkerNavigation.background",Ln,_(1037,"Editor marker navigation widget background."));var bnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},F2=function(n,e){return function(t,i){e(t,i,n)}},WL,d1;let kw=(d1=class{static get(e){return e.getContribution(WL.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new ne,this._editor=e,this._widgetVisible=iCe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(yN,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,o,r;(!((s=this._model)!=null&&s.selected)||!D.containsPosition((o=this._model)==null?void 0:o.selected.marker,i.position))&&((r=this._model)==null||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:D.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new U(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){var o,r;if(!this._editor.hasModel())return;const i=this._editor.getModel(),s=this._getOrCreateModel(t?void 0:i.uri);if(s.move(e,i,this._editor.getPosition()),!!s.selected)if(s.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const a=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);a&&((o=WL.get(a))==null||o.close(),(r=WL.get(a))==null||r.navigate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}},WL=d1,d1.ID="editor.contrib.markerController",d1);kw=WL=bnt([F2(1,tCe),F2(2,Xe),F2(3,Ft),F2(4,Ae)],kw);class e8 extends Ne{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&await((i=kw.get(t))==null?void 0:i.navigate(this._next,this._multiFile))}}const Yb=class Yb extends e8{constructor(){super(!0,!1,{id:Yb.ID,label:Yb.LABEL,precondition:void 0,kbOpts:{kbExpr:H.focus,primary:578,weight:100},menuOpts:{menuId:yN.TitleMenu,title:Yb.LABEL.value,icon:Ai("marker-navigation-next",de.arrowDown,_(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}};Yb.ID="editor.action.marker.next",Yb.LABEL=ie(1020,"Go to Next Problem (Error, Warning, Info)");let bO=Yb;const Zb=class Zb extends e8{constructor(){super(!1,!1,{id:Zb.ID,label:Zb.LABEL,precondition:void 0,kbOpts:{kbExpr:H.focus,primary:1602,weight:100},menuOpts:{menuId:yN.TitleMenu,title:Zb.LABEL.value,icon:Ai("marker-navigation-previous",de.arrowUp,_(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}};Zb.ID="editor.action.marker.prev",Zb.LABEL=ie(1021,"Go to Previous Problem (Error, Warning, Info)");let nU=Zb;class vnt extends e8{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:ie(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:66,weight:100},menuOpts:{menuId:Te.MenubarGoMenu,title:_(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class wnt extends e8{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:ie(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:1090,weight:100},menuOpts:{menuId:Te.MenubarGoMenu,title:_(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(kw.ID,kw,4);we(bO);we(nU);we(vnt);we(wnt);const iCe=new Se("markersNavigationVisible",!1),Cnt=cs.bindToContribution(kw.get);ye(new Cnt({id:"closeMarkersNavigation",precondition:iCe,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:H.focus,primary:9,secondary:[1033]}}));var ynt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},t6=function(n,e){return function(t,i){e(t,i,n)}};const wc=me;class nCe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const qae={type:1,filter:{include:Fi.QuickFix},triggerAction:La.QuickFixHover};let sU=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range;if(!i.isValidRange(e.range))return[];const o=s.startLineNumber,r=i.getLineMaxColumn(o),a=[];for(const l of t){const c=l.range.startLineNumber===o?l.range.startColumn:1,d=l.range.endLineNumber===o?l.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,l);if(!h)continue;const u=new D(e.range.startLineNumber,c,e.range.startLineNumber,d);a.push(new nCe(this,u,h))}return a}renderHoverParts(e,t){if(!t.length)return new xw([]);const i=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),i.push(a)});const s=t.length===1?t[0]:t.sort((r,a)=>Xi.compare(r.marker.severity,a.marker.severity))[0],o=this._renderMarkerStatusbar(e,s);return new xw(i,o)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new ne,i=wc("div.hover-row"),s=ue(i,wc("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=ue(s,wc("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const h=wc("span");if(o){const p=ue(h,wc("span"));p.innerText=o}const u=ue(h,wc("a.code-link"));u.setAttribute("href",a.target.toString(!0)),t.add(J(u,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const f=ue(u,wc("span"));f.innerText=a.value;const g=ue(s,h);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const h=ue(s,wc("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Go(l))for(const{message:h,resource:u,startLineNumber:f,startColumn:g}of l){const p=ue(s,wc("div"));p.style.marginTop="8px";const m=ue(p,wc("a"));m.innerText=`${rc(u)}(${f}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",v=>{if(v.stopPropagation(),v.preventDefault(),this._openerService){const w={selection:{startLineNumber:f,startColumn:g}};this._openerService.open(u,{fromUserGesture:!0,editorOptions:w}).catch(Je)}}));const b=ue(p,wc("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new ne;if(t.marker.severity===Xi.Error||t.marker.severity===Xi.Warning||t.marker.severity===Xi.Info){const s=kw.get(this._editor);s&&e.statusBar.addAction({label:_(1139,"View Problem"),commandId:bO.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const s=e.statusBar.append(wc("div"));this.recentMarkerCodeActionsInfo&&(kP.makeKey(this.recentMarkerCodeActionsInfo.marker)===kP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=_(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?G.None:kg(()=>s.textContent=_(1141,"Checking for quick fixes..."),200,i);s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Re(()=>r.cancel())),r.then(a=>{var d;if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=_(1142,"No quick fixes available");return}s.style.display="none";let l=!1;i.add(Re(()=>{l||a.dispose()})),e.statusBar.addAction({label:_(1143,"Quick Fix..."),commandId:SX,run:h=>{l=!0;const u=Sw.get(this._editor),f=dn(h);e.hide(),u==null||u.showCodeActions(qae,a,{x:f.left,y:f.top,width:f.width,height:f.height})}});const c=a.validActions.find(h=>h.action.isAI);c&&e.statusBar.addAction({label:c.action.title,commandId:((d=c.action.command)==null?void 0:d.id)??"",iconClass:Ue.asClassName(de.sparkle),run:()=>{const h=Sw.get(this._editor);h==null||h.applyCodeAction(c,!1,!1,rm.FromProblemsHover)}}),e.onContentsChanged()},Je)}return i}getCodeActions(e){return ss(t=>S0(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),qae,Wd.None,t))}};sU=ynt([t6(1,_Y),t6(2,jg),t6(3,De)],sU);var sCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ly=function(n,e){return function(t,i){e(t,i,n)}},oU,rU;let aU=oU=class extends G{constructor(e,t,i,s,o,r,a){super();const l=t.hoverParts;this._renderedHoverParts=this._register(new lU(e,i,l,s,o,r,a));const c=t.options,d=c.anchor,{showAtPosition:h,showAtSecondaryPosition:u}=oU.computeHoverPositions(e,d.range,l);this.shouldAppearBeforeContent=l.some(f=>f.isBeforeContent),this.showAtPosition=h,this.showAtSecondaryPosition=u,this.initialMousePosX=d.initialMousePosX,this.initialMousePosY=d.initialMousePosY,this.shouldFocus=c.shouldFocus,this.source=c.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let s=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),f=d.getLineMinColumn(u.startLineNumber),g=new U(u.startLineNumber,f);s=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===o,f=h.endLineNumber===o;if(u&&f){const p=h.startColumn,m=Math.min(r,p);r=Math.max(m,s)}d.forceShowAtRange&&(a=h)}let l,c;if(a){const d=a.getStartPosition();l=d,c=d}else l=t.getStartPosition(),c=new U(o,r);return{showAtPosition:l,showAtSecondaryPosition:c}}};aU=oU=sCe([Ly(4,Ht),Ly(5,Cr),Ly(6,xa)],aU);class Snt{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}var h1;let lU=(h1=class extends G{constructor(e,t,i,s,o,r,a){super(),this._hoverService=r,this._clipboardService=a,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=s,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,s,o,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return G.None;let i=t[0].range;for(const o of t){const r=o.range;i=D.plusRange(i,r)}const s=e.createDecorationsCollection();return s.set([{range:i,options:rU._DECORATION_OPTIONS}]),Re(()=>{s.clear()})}_renderParts(e,t,i,s,o){const r=new aO(s,o),a={fragment:this._fragment,statusBar:r,...i},l=new ne;l.add(r);for(const d of e){const h=this._renderHoverPartsForParticipant(t,d,a);l.add(h);for(const u of h.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:d,hoverPart:u.hoverPart,hoverElement:u.hoverElement})}const c=this._renderStatusBar(this._fragment,r);return c&&(l.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),l}_renderHoverPartsForParticipant(e,t,i){const s=e.filter(r=>r.owner===t);return s.length>0?t.renderHoverParts(i,s):new xw([])}_renderStatusBar(e,t){if(t.hasContent)return new Snt(e,t)}_registerListenersOnRenderedParts(){const e=new ne;return this._renderedParts.forEach((t,i)=>{const s=t.hoverElement;s.tabIndex=0,e.add(J(s,_e.FOCUS_IN,o=>{o.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(J(s,_e.FOCUS_OUT,o=>{o.stopPropagation(),this._focusedHoverPartIndex=-1})),t.type==="hoverPart"&&t.hoverPart instanceof nCe&&e.add(new F$(s,()=>t.participant.getAccessibleContent(t.hoverPart),this._clipboardService,this._hoverService))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof vN&&!(i instanceof mO));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof cO)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let s;t>=0?s={start:t,endExclusive:t+1}:s=this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let o=s.start;o=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){var e;return((e=this._colorHoverParticipant)==null?void 0:e.isColorPickerVisible())??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const o=this._renderedParts.findIndex(r=>r.type==="hoverPart"&&r.participant===e);if(o===-1)throw new ze;return t-o}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex(r=>r.type==="hoverPart"&&r.participant===e),s=t.reverse().findIndex(r=>r.type==="hoverPart"&&r.participant===e),o=s>=0?t.length-s:s;return{start:i,endExclusive:o+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}},rU=h1,h1._DECORATION_OPTIONS=nt.register({description:"content-hover-highlight",className:"hoverHighlight"}),h1);lU=rU=sCe([Ly(4,Ht),Ly(5,Cr),Ly(6,xa)],lU);var xnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},B2=function(n,e){return function(t,i){e(t,i,n)}};let cU=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=s,this._clipboardService=o,this._currentResult=null,this._renderedContentHover=this._register(new Kt),this._onContentsChanged=this._register(new q),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(R$,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new xwe(this._editor,new rO(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of Gw.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>{var i;return(i=t.handleResize)==null?void 0:i.call(t)})})),this._register(this._contentHoverWidget.onDidScroll(t=>{this._participants.forEach(i=>{var s;return(s=i.handleScroll)==null?void 0:s.call(i,t)})})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(t=>{var i;return(i=t.handleContentsChanged)==null?void 0:i.call(t)})})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{const i=t.hasLoadingMessage?this._addLoadingMessage(t):t.value;this._withResult(new Lwe(i,t.isComplete,t.options))}));const e=this._contentHoverWidget.getDomNode();this._register(xn(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(xn(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(rn.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(e,t,i,s,o){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1;const a=this._editor.getOption(69).sticky,l=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?this._currentResult&&this._currentResult.options.anchor.equals(e)?!0:this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const a={anchor:e,source:i,shouldFocus:s,insistOnKeepingHoverVisible:o};this._hoverOperation.start(t,a)}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const s=e.hoverParts.length===0,o=e.options.insistOnKeepingHoverVisible;s&&o||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new aU(this._editor,e,this._participants,t,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(e=>{var t;return(t=e.handleHide)==null?void 0:t.call(e)})}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:o=>{this._contentHoverWidget.setMinimumDimensions(o)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const o=i[0];return this._startShowingOrUpdateHover(o,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const s of this._participants){if(!s.suggestHoverAnchor)continue;const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;switch(i.type){case 6:{t.push(new Z9(0,i.range,e.event.posx,e.event.posy));break}case 7:{const s=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!G3(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new Z9(0,e,void 0,void 0),t,i,s,null)}async updateHoverVerbosityLevel(e,t,i){var s;(s=this._renderedContentHover.value)==null||s.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){var e;return((e=this._renderedContentHover.value)==null?void 0:e.focusedHoverPartIndex)??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){var t;if(((t=this._renderedContentHover.value)==null?void 0:t.hoverPartsCount)===1){this.focusHoverPartWithIndex(0);return}this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){var t;(t=this._renderedContentHover.value)==null||t.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){var e;return((e=this._renderedContentHover.value)==null?void 0:e.isColorPickerVisible())??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};cU=xnt([B2(1,Ae),B2(2,Ht),B2(3,Cr),B2(4,xa)],cU);function oCe(n){var t;const e=n.target;return!!e&&e.type===6&&((t=e.detail.injectedText)==null?void 0:t.options.attachedData)===vwe}var Lnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},i6=function(n,e){return function(t,i){e(t,i,n)}},dU,u1;let To=(u1=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._instantiationService=i,this._keybindingService=s,this._onHoverContentsChanged=this._register(new q),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new ne,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new ai(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(t.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(t.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(dU.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||oCe(e)}_isMouseOnContentHoverWidget(e){return this._contentWidget?G3(this._contentWidget.getDomNode(),e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,s=(d,h)=>{const u=this._isMouseOnContentHoverWidget(d);return h&&u},o=d=>{const h=t.isColorPickerVisible,u=this._isMouseOnContentHoverWidget(d),f=h&&u,g=h&&this._isMouseDown;return f||g},r=(d,h)=>{var f;const u=d.event.browserEvent.view;return u?h&&t.containsNode(u.document.activeElement)&&!((f=u.getSelection())!=null&&f.isCollapsed):!1},a=t.isFocused,l=t.isResizing,c=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||a||l||c||s(e,i)||o(e)||r(e,i)}_onEditorMouseMove(e){if(this._ignoreMouseEvents)return;if(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(this._shouldRescheduleHoverComputation()){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);return}this._reactToEditorMouseMove(e)}_shouldRescheduleHoverComputation(){var i;const e=this._hoverSettings.hidingDelay;return(((i=this._contentWidget)==null?void 0:i.isVisible)??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents||!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&e.keyCode===2||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1,s=t.kind===2&&(t.commandId===wwe||t.commandId===q3||t.commandId===K3)&&this._contentWidget.isVisible;return i||s}_isModifierKeyPressed(e){return e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4}hideContentHover(){var e;RS.dropDownVisible||(e=this._contentWidget)==null||e.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(cU,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,s){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){var e;return((e=this._contentWidget)==null?void 0:e.widget.isResizing)||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){var e;(e=this._contentWidget)==null||e.focus()}scrollUp(){var e;(e=this._contentWidget)==null||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)==null||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)==null||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)==null||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)==null||e.pageUp()}pageDown(){var e;(e=this._contentWidget)==null||e.pageDown()}goToTop(){var e;(e=this._contentWidget)==null||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)==null||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isVisible}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._contentWidget)==null||e.dispose()}},dU=u1,u1.ID="editor.contrib.contentHover",u1);To=dU=Lnt([i6(1,gl),i6(2,Ae),i6(3,Ht)],To);const SQ=class SQ extends G{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if(t!=="click"&&t!=="clickAndHover"||!oCe(e))return;const i=this._editor.getContribution(To.ID);if(!i||i.isColorPickerVisible)return;const s=e.target.range;if(!s)return;const o=new D(s.startLineNumber,s.startColumn+1,s.endLineNumber,s.endColumn+1);i.showContentHover(o,1,1,!1)}};SQ.ID="editor.contrib.colorContribution";let vO=SQ;var knt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ent=function(n,e){return function(t,i){e(t,i,n)}};class BX{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}static fromBaseColor(e,t){return new BX(e,t.range,t.model,t.provider)}}class Int extends G{constructor(e,t,i,s){super();const o=e.getModel(),r=i.model;this.color=i.model.color,this.colorPicker=this._register(new Owe(t.fragment,r,e.getOption(163),s,"standalone")),this._register(r.onColorFlushed(a=>{this.color=a})),this._register(r.onDidChangeColor(a=>{wN(o,r,a,i.range,i)})),this._register(e.onDidChangeModelContent(a=>{t.hide(),e.focus()})),wN(o,r,this.color,i.range,i)}}let hU=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel()||!TS.get(this._editor))return null;const o=await mwe(i,this._editor.getModel(),vt.None);let r=null,a=null;for(const u of o){const f=u.colorInfo;D.containsRange(f.range,e.range)&&(r=f,a=u.provider)}const l=r??e,c=a??t,d=!!r;return{colorHover:BX.fromBaseColor(this,await Fwe(this._editor.getModel(),l,c)),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new D(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await wN(this._editor.getModel(),t,this._color,i,e),i=Bwe(this._editor,i,t))}renderHoverParts(e,t){if(!(t.length===0||!this._editor.hasModel()))return this._setMinimumDimensions(e),this._renderedParts=new Int(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new Qt(302,t))}get _color(){var e;return(e=this._renderedParts)==null?void 0:e.color}};hU=knt([Ent(1,en)],hU);var Nnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fL=function(n,e){return function(t,i){e(t,i,n)}},uU;class Dnt{constructor(e,t){this.value=e,this.foundInEditor=t}}const Kae=8,Tnt=22;var f1;let fU=(f1=class extends G{constructor(e,t,i,s,o,r,a,l){var u;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=o,this._languageFeaturesService=r,this._editorWorkerService=a,this._hoverService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new Kt),this._renderedStatusBar=this._register(new Kt),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(hU,this._editor),this._position=(u=this._editor._getViewModel())==null?void 0:u.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(oc(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var p;const g=(p=f.target.element)==null?void 0:p.classList;g&&g.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return uU.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Dnt(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new _N(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new aO(this._keybindingService,this._hoverService));const s={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(s,[e]),!this._renderedHoverParts.value){this._renderedStatusBar.clear(),this._renderedHoverParts.clear();return}const o=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const r=o.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-Tnt-Kae,c=o.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=a+Kae+"px";const u=d.originalColorNode;u.style.width=l+"px";const f=o.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},uU=f1,f1.ID="editor.contrib.standaloneColorPickerWidget",f1);fU=uU=Nnt([fL(3,Ae),fL(4,Ht),fL(5,De),fL(6,Zr),fL(7,Cr)],fU);var Rnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gae=function(n,e){return function(t,i){e(t,i,n)}},gU,g1;let Ew=(g1=class extends G{constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=H.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=H.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)==null||e.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(fU,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)==null||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)==null||e.updateEditor(),this.hide()}static get(e){return e.getContribution(gU.ID)}},gU=g1,g1.ID="editor.contrib.standaloneColorPickerController",g1);Ew=gU=Rnt([Gae(1,Xe),Gae(2,Ae)],Ew);class Mnt extends Qc{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...ie(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:_(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Te.CommandPalette}],metadata:{description:ie(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){var i;(i=Ew.get(t))==null||i.showOrFocus()}}class Ant extends Ne{constructor(){super({id:"editor.action.hideColorPicker",label:ie(891,"Hide the Color Picker"),precondition:H.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:ie(892,"Hide the standalone color picker.")}})}run(e,t){var i;(i=Ew.get(t))==null||i.hide()}}class Pnt extends Ne{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:ie(893,"Insert Color with Standalone Color Picker"),precondition:H.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:ie(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){var i;(i=Ew.get(t))==null||i.insertColor()}}we(Ant);we(Pnt);ni(Mnt);At(vO.ID,vO,2);At(Ew.ID,Ew,1);At(TS.ID,TS,1);fx(E$);Gw.register(cO);Rt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof He))throw Zl();const{model:i,colorProviderRegistry:s,defaultColorDecoratorsEnablement:o}=bwe(n,t);return LX(new utt,s,i,vt.None,o)});Rt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e;if(!i)return;const{uri:s,range:o}=i;if(!(s instanceof He)||!Array.isArray(t)||t.length!==4||!D.isIRange(o))throw Zl();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=bwe(n,s),[c,d,h,u]=t;return LX(new ftt({range:o,color:{red:c,green:d,blue:h,alpha:u}}),a,r,vt.None,l)});class lm{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(c);let f=h.lastIndexOf(t,l-1+t.length),g=u.indexOf(i,d-1-i.length);if(f!==-1&&g!==-1)if(a===c)h.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const m=h.substring(f+t.length),b=u.substring(0,g);(m.indexOf(i)>=0||b.indexOf(i)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(s&&f+t.length0&&u.charCodeAt(g-1)===32&&(i=" "+i,g-=1),p=lm._createRemoveBlockCommentOperations(new D(a,f+t.length+1,c,g+1),t,i)):(p=lm._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const m of p)r.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return D.isEmpty(e)?s.push(ln.delete(new D(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ln.delete(new D(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ln.delete(new D(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return D.isEmpty(e)?o.push(ln.replace(new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ln.insert(new U(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ln.insert(new U(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new Ie(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ie(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class mf{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;co?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class WX extends Ne{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ki);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(29),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>D.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},J_=function(n,e){return function(t,i){e(t,i,n)}},pU,p1;let SN=(p1=class{static get(e){return e.getContribution(pU.ID)}constructor(e,t,i,s,o,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new ne,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=c.srcElement;h.shadowRoot&&t_(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(30)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of s){const[,r]=o;let a=0;for(const l of r)if(l instanceof Nv){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new hS(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new Xn)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=dn(this._editor.getDomNode()),a=r.left+o.left,l=r.top+o.top+o.height;i={x:a,y:l}}const s=this._editor.getOption(144)&&!nc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:o=>{const r=this._keybindingFor(o);if(r)return new kS(o,o,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new kS(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||kqe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(81);let i=0;const s=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,d)=>new hS(`menu-action-${++i}`,c,d,void 0),r=(c,d,h,u,f)=>{if(!d)return s({label:c,enabled:d,run:()=>{}});const g=m=>()=>{this._configurationService.updateValue(h,m)},p=[];for(const m of f)p.push(s({label:m.label,checked:u===m.value,run:g(m.value)}));return o(c,p)},a=[];a.push(s({label:_(901,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Xn),a.push(s({label:_(902,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(_(903,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:_(904,"Proportional"),value:"proportional"},{label:_(905,"Fill"),value:"fill"},{label:_(906,"Fit"),value:"fit"}])),a.push(r(_(907,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:_(908,"Mouse Over"),value:"mouseover"},{label:_(909,"Always"),value:"always"}]));const l=this._editor.getOption(144)&&!nc;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},pU=p1,p1.ID="editor.contrib.contextmenu",p1);SN=pU=Hnt([J_(1,gl),J_(2,zg),J_(3,Xe),J_(4,Ht),J_(5,uc),J_(6,lt),J_(7,Rg)],SN);class Vnt extends Ne{constructor(){super({id:"editor.action.showContextMenu",label:ie(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=SN.get(t))==null||i.showContextMenu()}}At(SN.ID,SN,2);we(Vnt);class n6{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new n6(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new s6(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new s6(new n6(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new s6(new n6(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};_F.ID="editor.contrib.cursorUndoRedoController";let OS=_F;class znt extends Ne{constructor(){super({id:"cursorUndo",label:ie(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var s;(s=OS.get(t))==null||s.cursorUndo()}}class jnt extends Ne{constructor(){super({id:"cursorRedo",label:ie(912,"Cursor Redo"),precondition:void 0})}run(e,t,i){var s;(s=OS.get(t))==null||s.cursorRedo()}}At(OS.ID,OS,0);we(znt);we(jnt);class $nt{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new D(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Ie(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Ie(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(42)||this._editor.getOption(28)||(NC(e)&&(this._modifierPressed=!0),this._mouseDown&&NC(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(42)||this._editor.getOption(28)||(NC(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Dp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}NC(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new U(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new Ie(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new Ie(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(NC(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Dp.ID,new $nt(this._dragSelection,t,NC(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),options:Dp._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};Dp.ID="editor.contrib.dragAndDrop",Dp.TRIGGER_KEY_VALUE=wt?6:5,Dp._DECORATION_OPTIONS=nt.register({description:"dnd-target",className:"dnd-target"});let wO=Dp;At(wO.ID,wO,2);const Unt="editor.action.pasteAs";At(Ag.ID,Ag,0);fx(f$);ye(new class extends cs{constructor(){super({id:nwe,precondition:CX,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e){var t;return(t=Ag.get(e))==null?void 0:t.changePasteType()}});ye(new class extends cs{constructor(){super({id:"editor.hidePasteWidget",precondition:CX,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e){var t;(t=Ag.get(e))==null||t.clearWidgets()}});var m1;we((m1=class extends Ne{constructor(){super({id:Unt,label:ie(915,"Paste As..."),precondition:H.writable,metadata:{description:"Paste as",args:[{name:"args",schema:m1.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,i){var o;let s;return i&&("kind"in i?s={only:new Qi(i.kind)}:"preferences"in i&&(s={preferences:i.preferences.map(r=>new Qi(r))})),(o=Ag.get(t))==null?void 0:o.pasteAs(s)}},m1.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:_(913,`The kind of the paste edit to try pasting with. +`),parse:n=>U3.split(n).filter(e=>!e.startsWith("#"))}),Bh=class Bh{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Bh.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new Bh((this.value?[this.value,...e]:e).join(Bh.sep))}};Bh.sep=".",Bh.None=new Bh("@@none@@"),Bh.Empty=new Bh("");let Qi=Bh;const nae={EDITORS:"CodeEditors",FILES:"CodeFiles"};class det{}const het={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ji.add(het.DragAndDropContribution,new det);const vI=class vI{constructor(){}static getInstance(){return vI.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};vI.INSTANCE=new vI;let c$=vI;function V1e(n){var e,t,i,s;if(Xd&&typeof((t=(e=globalThis.vscode)==null?void 0:e.webUtils)==null?void 0:t.getPathForFile)=="function")return(s=(i=globalThis.vscode)==null?void 0:i.webUtils)==null?void 0:s.getPathForFile(n)}function z1e(n){const e=new W1e;for(const t of n.items){const i=t.type;if(t.kind==="string"){const s=new Promise(o=>t.getAsString(o));e.append(i,mX(s))}else if(t.kind==="file"){const s=t.getAsFile();s&&e.append(i,uet(s))}}return e}function uet(n){const e=V1e(n),t=e?He.parse(e):void 0;return cet(n.name,t,async()=>new Uint8Array(await n.arrayBuffer()))}const fet=Object.freeze([nae.EDITORS,nae.FILES,cw.RESOURCES,cw.INTERNAL_URI_LIST]);function j1e(n,e=!1){const t=z1e(n),i=t.get(cw.INTERNAL_URI_LIST);if(i)t.replace(mn.uriList,i);else if(e||!t.has(mn.uriList)){const s=[];for(const o of n.items){const r=o.getAsFile();if(r){const a=V1e(r);try{a?s.push(He.file(a).toString()):s.push(He.parse(r.name,!0).toString())}catch{}}}s.length&&t.replace(mn.uriList,mX(U3.create(s)))}for(const s of fet)t.delete(s);return t}var get=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pet=function(n,e){return function(t,i){e(t,i,n)}};const met=st.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Pge,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),dF=class dF extends G{constructor(e,t,i,s,o){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(s),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=me(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=me("span.icon");this.domNode.append(t),t.classList.add(...$e.asClassNameArray(de.loading),"codicon-modifier-spin");const i=()=>{const s=this.editor.getOption(75);this.domNode.style.height=`${s}px`,this.domNode.style.width=`${Math.ceil(.8*s)}px`};i(),this._register(this.editor.onDidChangeConfiguration(s=>{(s.hasChanged(61)||s.hasChanged(75))&&i()})),this._register(J(this.domNode,_e.CLICK,s=>{this.delegate.cancel()}))}getId(){return dF.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};dF.baseId="editor.widget.inlineProgressWidget";let d$=dF,tO=class extends G{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Gt),this._currentWidget=this._register(new Gt),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,s,o){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=kg(()=>{const a=D.fromPositions(e);this._currentDecorations.set([{range:a,options:met}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(d$,this.id,this._editor,a,t,s))},o??this._showDelay);try{return await i}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};tO=get([pet(2,Ae)],tO);var _et=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sae=function(n,e){return function(t,i){e(t,i,n)}},eM,Mm;let ba=(Mm=class{static get(e){return e.getContribution(eM.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Gt,this._messageListeners=new ne,this._mouseOverMessage=!1,this._editor=e,this._visible=eM.MESSAGE_VISIBLE.bindTo(t)}dispose(){this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){if(vr(cg(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),cg(e)){const s=this._messageListeners.add(ID(e,{actionHandler:(o,r)=>{this.closeMessage(),Wbe(this._openerService,o,r.isTrusted)}}));this._messageWidget.value=new $9(this._editor,t,s.element)}else this._messageWidget.value=new $9(this._editor,t,e);this._messageListeners.add(ve.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&ys(as(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),_e.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(J(this._messageWidget.value.getDomNode(),_e.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new D(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add($9.fadeOut(this._messageWidget.value))}},eM=Mm,Mm.ID="editor.contrib.messageController",Mm.MESSAGE_VISIBLE=new Se("messageVisible",!1,_(1287,"Whether the editor is currently showing an inline message")),Mm);ba=eM=_et([sae(1,Xe),sae(2,jg)],ba);const bet=hs.bindToContribution(ba.get);ye(new bet({id:"leaveEditorMessage",precondition:ba.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let $9=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};At(ba.ID,ba,4);var _X=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fN=function(n,e){return function(t,i){e(t,i,n)}};class bX{constructor(e){this.copyMimeTypes=[],this.kind=e,this.providedDropEditKinds=[this.kind],this.providedPasteEditKinds=[this.kind]}async provideDocumentPasteEdits(e,t,i,s,o){const r=await this.getEdit(i,o);if(r)return{edits:[{insertText:r.insertText,title:r.title,kind:r.kind,handledMimeType:r.handledMimeType,yieldTo:r.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,s){const o=await this.getEdit(i,s);if(o)return{edits:[{insertText:o.insertText,title:o.title,kind:o.kind,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}],dispose(){}}}}const hF=class hF extends bX{constructor(){super(Qi.Empty.append("text","plain")),this.id=hF.id,this.dropMimeTypes=[mn.text],this.pasteMimeTypes=[mn.text]}async getEdit(e,t){const i=e.get(mn.text);if(!i||e.has(mn.uriList))return;const s=await i.asString();return{handledMimeType:mn.text,title:_(926,"Insert Plain Text"),insertText:s,kind:this.kind}}};hF.id="text";let pw=hF;class $1e extends bX{constructor(){super(Qi.Empty.append("uri","path","absolute")),this.dropMimeTypes=[mn.uriList],this.pasteMimeTypes=[mn.uriList]}async getEdit(e,t){const i=await U1e(e);if(!i.length||t.isCancellationRequested)return;let s=0;const o=i.map(({uri:a,originalText:l})=>a.scheme===Ge.file?a.fsPath:(s++,l)).join(" ");let r;return s>0?r=i.length>1?_(927,"Insert Uris"):_(928,"Insert Uri"):r=i.length>1?_(929,"Insert Paths"):_(930,"Insert Path"),{handledMimeType:mn.uriList,insertText:o,title:r,kind:this.kind}}}let iO=class extends bX{constructor(e){super(Qi.Empty.append("uri","path","relative")),this._workspaceContextService=e,this.dropMimeTypes=[mn.uriList],this.pasteMimeTypes=[mn.uriList]}async getEdit(e,t){const i=await U1e(e);if(!i.length||t.isCancellationRequested)return;const s=lh(i.map(({uri:o})=>{const r=this._workspaceContextService.getWorkspaceFolder(o);return r?G4e(r.uri,o):void 0}));if(s.length)return{handledMimeType:mn.uriList,insertText:s.join(" "),title:i.length>1?_(931,"Insert Relative Paths"):_(932,"Insert Relative Path"),kind:this.kind}}};iO=_X([fN(0,Rg)],iO);class vet{constructor(){this.kind=new Qi("html"),this.providedPasteEditKinds=[this.kind],this.copyMimeTypes=[],this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:mn.text}]}async provideDocumentPasteEdits(e,t,i,s,o){var l;if(s.triggerKind!==nE.PasteAs&&!((l=s.only)!=null&&l.contains(this.kind)))return;const r=i.get("text/html"),a=await(r==null?void 0:r.asString());if(!(!a||o.isCancellationRequested))return{dispose(){},edits:[{insertText:a,yieldTo:this._yieldTo,title:_(933,"Insert HTML"),kind:this.kind}]}}}async function U1e(n){const e=n.get(mn.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const s of U3.parse(t))try{i.push({uri:He.parse(s),originalText:s})}catch{}return i}const pv={scheme:"*",hasAccessToAllModels:!0};let h$=class extends G{constructor(e,t){super(),this._register(e.documentDropEditProvider.register(pv,new pw)),this._register(e.documentDropEditProvider.register(pv,new $1e)),this._register(e.documentDropEditProvider.register(pv,new iO(t)))}};h$=_X([fN(0,De),fN(1,Rg)],h$);let u$=class extends G{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register(pv,new pw)),this._register(e.documentPasteEditProvider.register(pv,new $1e)),this._register(e.documentPasteEditProvider.register(pv,new iO(t))),this._register(e.documentPasteEditProvider.register(pv,new vet))}};u$=_X([fN(0,De),fN(1,Rg)],u$);const Ec=class Ec{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),s;if(s=Ec._table[i],typeof s=="number")return this.pos+=1,{type:s,pos:e,len:1};if(Ec.isDigitCharacter(i)){s=8;do t+=1,i=this.value.charCodeAt(e+t);while(Ec.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}if(Ec.isVariableCharacter(i)){s=9;do i=this.value.charCodeAt(e+ ++t);while(Ec.isVariableCharacter(i)||Ec.isDigitCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}s=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof Ec._table[i]>"u"&&!Ec.isDigitCharacter(i)&&!Ec.isVariableCharacter(i));return this.pos+=t,{type:s,pos:e,len:t}}};Ec._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let f$=Ec;class ux{constructor(){this._children=[]}appendChild(e){return e instanceof gr&&this._children[this._children.length-1]instanceof gr?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,s=i.children.indexOf(e),o=i.children.slice(0);o.splice(s,1,...t),i._children=o,function r(a,l){for(const c of a)c.parent=l,r(c.children,c)}(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof OD)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class gr extends ux{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new gr(this.value)}}class q1e extends ux{}class Al extends q1e{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof fx?this._children[0]:void 0}clone(){const e=new Al(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class fx extends ux{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof gr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new fx;return this.options.forEach(e.appendChild,e),e}}class vX extends ux{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,s=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(o=>o instanceof kd&&!!o.elseValue)&&(s=this._replace([])),s}_replace(e){let t="";for(const i of this._children)if(i instanceof kd){let s=e[i.index]||"";s=i.resolve(s),t+=s}else t+=i.toString();return t}toString(){return""}clone(){const e=new vX;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class kd extends ux{constructor(e,t,i,s){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=s}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,s)=>s===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new kd(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class gN extends q1e{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new gr(t)],!0):!1}clone(){const e=new gN(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function oae(n,e){const t=[...n];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class OD extends ux{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Al&&(e.push(i),t=!t||t.indexs===e?(i=!0,!1):(t+=s.len(),!0)),i?t:-1}fullLen(e){let t=0;return oae([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Al&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof gN&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new OD;return this._children=this.children.map(t=>t.clone()),e}walk(e){oae(this.children,e)}}class mw{constructor(){this._scanner=new f$,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const s=new OD;return this.parseFragment(e,s),this.ensureFinalTabstop(s,i??!1,t??!1),s}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const s=new Map,o=[];t.walk(l=>(l instanceof Al&&(l.isFinalTabstop?s.set(0,void 0):!s.has(l.index)&&l.children.length>0?s.set(l.index,l.children):o.push(l)),!0));const r=(l,c)=>{const d=s.get(l.index);if(!d)return;const h=new Al(l.index);h.transform=l.transform;for(const u of d){const f=u.clone();h.appendChild(f),f instanceof Al&&s.has(f.index)&&!c.has(f.index)&&(c.add(f.index),r(f,c),c.delete(f.index))}t.replace(l,[h])},a=new Set;for(const l of o)r(l,a);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Al(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const s=this._scanner.next();if(s.type!==0&&s.type!==4&&s.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new gr(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Al(Number(t)):new gN(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const o=new Al(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new gr("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const r=new fx;for(;;){if(this._parseChoiceElement(r)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(r),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let s;if((s=this._accept(5,!0))?s=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||s:s=this._accept(void 0,!0),!s)return this._backTo(t),!1;i.push(s)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new gr(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const o=new gN(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new gr("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){const t=new vX;let i="",s="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new gr(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){s+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,s)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const s=this._accept(8,!0);if(s)if(i){if(this._accept(4))return e.appendChild(new kd(Number(s))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new kd(Number(s))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new kd(Number(s),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new kd(Number(s),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new kd(Number(s),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const r=this._until(4);if(r)return e.appendChild(new kd(Number(s),void 0,o,r)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new kd(Number(s),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new gr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function K1e(n,e,t){var i,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(o=>new km(n,{range:o,text:typeof t.insertText=="string"?mw.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((s=t.additionalEdit)==null?void 0:s.edits)??[]]}}function G1e(n){function e(r,a){return"mimeType"in r?r.mimeType===a.handledMimeType:!!a.kind&&r.kind.contains(a.kind)}const t=new Map;for(const r of n)for(const a of r.yieldTo??[])for(const l of n)if(l!==r&&e(a,l)){let c=t.get(r);c||(c=[],t.set(r,c)),c.push(l)}if(!t.size)return Array.from(n);const i=new Set,s=[];function o(r){if(!r.length)return[];const a=r[0];if(s.includes(a))return console.warn("Yield to cycle detected",a),r;if(i.has(a))return o(r.slice(1));let l=[];const c=t.get(a);return c&&(s.push(a),l=o(c),s.pop()),i.add(a),[...l,a,...o(r.slice(1))]}return o(Array.from(n))}function U9(n,e){return e&&(n.stack||n.stacktrace)?_(29,"{0}: {1}",aae(n),rae(n.stack)||rae(n.stacktrace)):aae(n)}function rae(n){return Array.isArray(n)?n.join(` +`):n}function aae(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?_(30,"A system error occurred ({0})",n.message):n.message||_(31,"An unknown error occurred. Please consult the log for more details.")}function nO(n=null,e=!1){if(!n)return _(32,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=lh(n),i=nO(t[0],e);return t.length>1?_(33,"{0} ({1} errors in total)",i,t.length):i}if(Cs(n))return n;if(n.detail){const t=n.detail;if(t.error)return U9(t.error,e);if(t.exception)return U9(t.exception,e)}return n.stack?U9(n,e):n.message?n.message:_(34,"An unknown error occurred. Please consult the log for more details.")}var Y1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tM=function(n,e){return function(t,i){e(t,i,n)}};const Z1e="acceptSelectedCodeAction",X1e="previewSelectedCodeAction";class wet{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s;i.text.textContent=((s=e.group)==null?void 0:s.title)??e.label??""}disposeTemplate(e){}}class Cet{get templateId(){return"separator"}renderTemplate(e){e.classList.add("separator");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){i.text.textContent=e.label??""}disposeTemplate(e){}}let g$=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=document.createElement("span");s.className="description",e.append(s);const o=new cx(e,ua);return{container:e,icon:t,text:i,description:s,keybinding:o}}renderElement(e,t,i){var r,a,l;if((r=e.group)!=null&&r.icon?(i.icon.className=$e.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=ge(e.group.icon.color.id))):(i.icon.className=$e.asClassName(de.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;s4e(!e.hideIcon,i.icon),i.text.textContent=sO(e.label),e.keybinding?(i.description.textContent=e.keybinding.getLabel(),i.description.style.display="inline",i.description.style.letterSpacing="0.5px"):e.description?(i.description.textContent=sO(e.description),i.description.style.display="inline"):(i.description.textContent="",i.description.style.display="none");const s=(a=this._keybindingService.lookupKeybinding(Z1e))==null?void 0:a.getLabel(),o=(l=this._keybindingService.lookupKeybinding(X1e))==null?void 0:l.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.tooltip?i.container.title=e.tooltip:e.disabled?i.container.title=e.label:s&&o?this._supportsPreview&&e.canPreview?i.container.title=_(1653,"{0} to Apply, {1} to Preview",s,o):i.container.title=_(1654,"{0} to Apply",s):i.container.title=""}disposeTemplate(e){e.keybinding.dispose()}};g$=Y1e([tM(1,Vt)],g$);class yet extends UIEvent{constructor(){super("acceptSelectedAction")}}class lae extends UIEvent{constructor(){super("previewSelectedAction")}}function xet(n){if(n.kind==="action")return n.label}let p$=class extends G{constructor(e,t,i,s,o,r,a,l){super(),this._delegate=s,this._contextViewService=r,this._keybindingService=a,this._layoutService=l,this._actionLineHeight=28,this._headerLineHeight=28,this._separatorLineHeight=8,this.cts=this._register(new Bi),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const c={getHeight:d=>{switch(d.kind){case"header":return this._headerLineHeight;case"separator":return this._separatorLineHeight;default:return this._actionLineHeight}},getTemplateId:d=>d.kind};this._list=this._register(new pl(e,this.domNode,c,[new g$(t,this._keybindingService),new wet,new Cet],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:xet},accessibilityProvider:{getAriaLabel:d=>{if(d.kind==="action"){let h=d.label?sO(d==null?void 0:d.label):"";return d.description&&(h=h+", "+sO(d.description)),d.disabled&&(h=_(1655,"{0}, Disabled Reason: {1}",h,d.disabled)),h}return null},getWidgetAriaLabel:()=>_(1656,"Action Widget"),getRole:d=>{switch(d.kind){case"action":return"option";case"separator":return"separator";default:return"separator"}},getWidgetRole:()=>"listbox",...o}})),this._list.style(lx),this._register(this._list.onMouseClick(d=>this.onListClick(d))),this._register(this._list.onMouseOver(d=>this.onListHover(d))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(d=>this.onListSelection(d))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(d=>d.kind==="header").length,i=this._allMenuItems.filter(d=>d.kind==="separator").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight+i*this._separatorLineHeight-i*this._actionLineHeight;this._list.layout(r);let a=e;if(this._allMenuItems.length>=50)a=380;else{const d=this._allMenuItems.map((h,u)=>{const f=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(f){f.style.width="auto";const g=f.getBoundingClientRect().width;return f.style.width="",g}return 0});a=Math.max(...d,e)}const c=Math.min(r,this._layoutService.getContainer(Pe(this.domNode)).clientHeight*.7);return this._list.layout(c,a),this.domNode.style.height=`${c}px`,this._list.domFocus(),a}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new lae:new yet;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof lae):this._list.setSelection([])}onFocus(){var s,o;const e=this._list.getFocus();if(e.length===0)return;const t=e[0],i=this._list.element(t);(o=(s=this._delegate).onFocus)==null||o.call(s,i.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};p$=Y1e([tM(5,zg),tM(6,Vt),tM(7,Au)],p$);function sO(n){return n.replace(/\r\n|\r|\n/g," ")}var Let=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q9=function(n,e){return function(t,i){e(t,i,n)}};F("actionBar.toggledBackground",nx,_(1657,"Background color for toggled action items in action bar."));const _w={Visible:new Se("codeActionMenuVisible",!1,_(1658,"Whether the action widget list is visible"))},S_=mt("actionWidgetService");let bw=class extends G{get isVisible(){return _w.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new Gt)}show(e,t,i,s,o,r,a,l){const c=_w.Visible.bindTo(this._contextKeyService),d=this._instantiationService.createInstance(p$,e,t,i,s,l);this._contextViewService.showContextView({getAnchor:()=>o,render:h=>(c.set(!0),this._renderWidget(h,d,a??[])),onHide:h=>{c.reset(),this._onWidgetClosed(h)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)==null||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)==null?void 0:e.value)==null||t.focusNext()}hide(e){var t;(t=this._list.value)==null||t.hide(e),this._list.clear()}_renderWidget(e,t,i){var f;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,this._list.value)s.appendChild(this._list.value.domNode);else throw new Error("List has no value");const o=new ne,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(J(a,_e.MOUSE_DOWN,g=>g.stopPropagation()));const l=document.createElement("div"),c=e.appendChild(l);c.classList.add("context-view-pointerBlock"),o.add(J(c,_e.POINTER_MOVE,()=>c.remove())),o.add(J(c,_e.MOUSE_DOWN,()=>c.remove()));let d=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(s.appendChild(g.getContainer().parentElement),o.add(g),d=g.getContainer().offsetWidth)}const h=(f=this._list.value)==null?void 0:f.layout(d);s.style.width=`${h}px`;const u=o.add(tc(e));return o.add(u.onDidBlur(()=>this.hide(!0))),o}_createActionBar(e,t){if(!t.length)return;const i=me(e),s=new jr(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)==null||t.hide(e)}};bw=Let([q9(0,zg),q9(1,Xe),q9(2,Ae)],bw);Lt(S_,bw,1);const FD=1100;ni(class extends Ps{constructor(){super({id:"hideCodeActionWidget",title:ie(1659,"Hide action widget"),precondition:_w.Visible,keybinding:{weight:FD,primary:9,secondary:[1033]}})}run(n){n.get(S_).hide(!0)}});ni(class extends Ps{constructor(){super({id:"selectPrevCodeAction",title:ie(1660,"Select previous action"),precondition:_w.Visible,keybinding:{weight:FD,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(S_);e instanceof bw&&e.focusPrevious()}});ni(class extends Ps{constructor(){super({id:"selectNextCodeAction",title:ie(1661,"Select next action"),precondition:_w.Visible,keybinding:{weight:FD,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(S_);e instanceof bw&&e.focusNext()}});ni(class extends Ps{constructor(){super({id:Z1e,title:ie(1662,"Accept selected action"),precondition:_w.Visible,keybinding:{weight:FD,primary:3,secondary:[2137]}})}run(n){const e=n.get(S_);e instanceof bw&&e.acceptSelected()}});ni(class extends Ps{constructor(){super({id:X1e,title:ie(1663,"Preview selected action"),precondition:_w.Visible,keybinding:{weight:FD,primary:2051}})}run(n){const e=n.get(S_);e instanceof bw&&e.acceptSelected(!0)}});var Q1e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yy=function(n,e){return function(t,i){e(t,i,n)}},m$,Zv;let _$=(Zv=class extends G{constructor(e,t,i,s,o,r,a,l,c,d,h){super(),this.typeId=e,this.editor=t,this.showCommand=s,this.range=o,this.edits=r,this.onSelectNewEdit=a,this.additionalActions=l,this._keybindingService=d,this._actionWidgetService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(c),this.visibleContext.set(!0),this._register(Re(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Re(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(u=>{this.dispose()})),this._register(ve.runAndSubscribe(d.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=me(".post-edit-widget"),this.button=this._register(new IP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(J(this.domNode,_e.CLICK,()=>this.showSelector()))}getId(){return m$.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){const e=dn(this.button.element),t={x:e.left+e.width,y:e.top+e.height};this._actionWidgetService.show("postEditWidget",!1,this.edits.allEdits.map((i,s)=>({kind:"action",item:i,label:i.title,disabled:!1,canPreview:!1,group:{title:"",icon:$e.fromId(s===this.edits.activeEditIndex?de.check.id:de.blank.id)}})),{onHide:()=>{this.editor.focus()},onSelect:i=>{this._actionWidgetService.hide(!1);const s=this.edits.allEdits.findIndex(o=>o===i);if(s!==this.edits.activeEditIndex)return this.onSelectNewEdit(s)}},t,this.editor.getDomNode()??void 0,this.additionalActions)}},m$=Zv,Zv.baseId="editor.widget.postEditWidget",Zv);_$=m$=Q1e([yy(8,Xe),yy(9,Vt),yy(10,S_)],_$);let oO=class extends G{constructor(e,t,i,s,o,r,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=s,this._getAdditionalActions=o,this._instantiationService=r,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new Gt),this._register(ve.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,s,o){if(!e.length||!this._editor.hasModel())return;const r=this._editor.getModel(),a=t.allEdits.at(t.activeEditIndex);if(!a)return;const l=async b=>{const v=this._editor.getModel();v&&(await v.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:b,allEdits:t.allEdits},i,s,o))},c=(b,v)=>{fl(b)||(this._notificationService.error(v),i&&this.show(e[0],t,l))},d=new Mg(this._editor,3,void 0,o);let h;try{h=await iOe(s(a,d.token),d.token)}catch(b){return c(b,_(937,`Error resolving edit '{0}': +{1}`,a.title,nO(b)))}finally{d.dispose()}if(o.isCancellationRequested)return;const u=K1e(r.uri,e,h),f=e[0],g=r.deltaDecorations([],[{range:f,options:{description:"paste-line-suffix",stickiness:0}}]);this._editor.focus();let p,m;try{p=await this._bulkEditService.apply(u,{editor:this._editor,token:o}),m=r.getDecorationRange(g[0])}catch(b){return c(b,_(938,`Error applying edit '{0}': +{1}`,a.title,nO(b)))}finally{r.deltaDecorations(g,[])}o.isCancellationRequested||i&&p.isApplied&&t.allEdits.length>1&&this.show(m??f,t,l)}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(_$,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i,this._getAdditionalActions()))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)==null||e.showSelector()}};oO=Q1e([yy(5,Ae),yy(6,ED),yy(7,fn)],oO);var ket=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xu=function(n,e){return function(t,i){e(t,i,n)}},Lc;const J1e="editor.changePasteType",Iet="editor.pasteAs.preferences",wX=new Se("pasteWidgetVisible",!1,_(917,"Whether the paste widget is showing")),K9="application/vnd.code.copymetadata";var Xv;let Ag=(Xv=class extends G{static get(e){return e.getContribution(Lc.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._logService=i,this._bulkEditService=s,this._clipboardService=o,this._commandService=r,this._configService=a,this._languageFeaturesService=l,this._quickInputService=c,this._progressService=d,this._editor=e;const h=e.getContainerDomNode();this._register(J(h,"copy",u=>this.handleCopy(u))),this._register(J(h,"cut",u=>this.handleCopy(u))),this._register(J(h,"paste",u=>this.handlePaste(u),!0)),this._pasteProgressManager=this._register(new tO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(oO,"pasteIntoEditor",e,wX,{id:J1e,label:_(918,"Show paste options...")},()=>Lc._configureDefaultAction?[Lc._configureDefaultAction]:[]))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}async pasteAs(e){this._logService.trace("CopyPasteController.pasteAs"),this._editor.focus();try{this._logService.trace("Before calling editor.action.clipboardPasteAction"),this._pasteAsActionContext={preferred:e},await this._commandService.executeCommand("editor.action.clipboardPasteAction")}finally{this._pasteAsActionContext=void 0}}clearWidgets(){this._postPasteWidgetManager.clear()}isPasteAsEnabled(){return this._editor.getOption(97).enabled}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var m,b,v,w;let t=null;if(e.clipboardData){const[C,S]=Ev.getTextData(e.clipboardData),L=S||gu.INSTANCE.get(C);t=(L==null?void 0:L.id)||null,this._logService.trace("CopyPasteController#handleCopy for id : ",t," with text.length : ",C.length)}else this._logService.trace("CopyPasteController#handleCopy");if(!this._editor.hasTextFocus()||((b=(m=this._clipboardService).clearInternalState)==null||b.call(m),!e.clipboardData||!this.isPasteAsEnabled()))return;const i=this._editor.getModel(),s=this._editor.getSelections();if(!i||!(s!=null&&s.length))return;const o=this._editor.getOption(45);let r=s;const a=s.length===1&&s[0].isEmpty();if(a){if(!o)return;r=[new D(r[0].startLineNumber,1,r[0].startLineNumber,1+i.getLineLength(r[0].startLineNumber))]}const l=(v=this._editor._getViewModel())==null?void 0:v.getPlainTextToCopy(s,o,$s),d={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(i).filter(C=>!!C.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const u=z1e(e.clipboardData),f=h.flatMap(C=>C.copyMimeTypes??[]),g=t??Ow();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:f,defaultPastePayload:d});const p=h.map(C=>({providerMimeTypes:C.copyMimeTypes,operation:rs(S=>C.prepareDocumentPaste(i,r,u,S).catch(L=>{console.error(L)}))}));(w=Lc._currentCopyOperation)==null||w.operations.forEach(C=>C.operation.cancel()),Lc._currentCopyOperation={handle:g,operations:p}}async handlePaste(e){var c,d,h;if(e.clipboardData){const[u,f]=Ev.getTextData(e.clipboardData),g=f||gu.INSTANCE.get(u);this._logService.trace("CopyPasteController#handlePaste for id : ",g==null?void 0:g.id)}else this._logService.trace("CopyPasteController#handlePaste");if(!e.clipboardData||!this._editor.hasTextFocus())return;(c=ba.get(this._editor))==null||c.closeMessage(),(d=this._currentPasteOperation)==null||d.cancel(),this._currentPasteOperation=void 0;const t=this._editor.getModel(),i=this._editor.getSelections();if(!(i!=null&&i.length)||!t||this._editor.getOption(104)||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const s=this.fetchCopyMetadata(e);this._logService.trace("CopyPasteController#handlePaste with metadata : ",s==null?void 0:s.id," and text.length : ",e.clipboardData.getData("text/plain").length);const o=j1e(e.clipboardData);o.delete(K9);const r=Array.from(e.clipboardData.files).map(u=>u.type),a=[...e.clipboardData.types,...r,...(s==null?void 0:s.providerCopyMimeTypes)??[],mn.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(t).filter(u=>{var g,p;const f=(g=this._pasteAsActionContext)==null?void 0:g.preferred;return f&&!this.providerMatchesPreference(u,f)?!1:(p=u.pasteMimeTypes)==null?void 0:p.some(m=>iae(m,a))});if(!l.length){(h=this._pasteAsActionContext)!=null&&h.preferred&&(this.showPasteAsNoEditMessage(i,this._pasteAsActionContext.preferred),e.preventDefault(),e.stopImmediatePropagation());return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferred,l,i,o,s):this.doPasteInline(l,i,o,s,e)}showPasteAsNoEditMessage(e,t){var s;const i="only"in t?t.only.value:"preferences"in t?t.preferences.length?t.preferences.map(o=>o.value).join(", "):_(919,"empty"):t.providerId;(s=ba.get(this._editor))==null||s.showMessage(_(920,"No paste edits for '{0}' found",i),e[0].getStartPosition())}doPasteInline(e,t,i,s,o){this._logService.trace("CopyPasteController#doPasteInline");const r=this._editor;if(!r.hasModel())return;const a=new Mg(r,3,void 0),l=rs(async c=>{const d=this._editor;if(!d.hasModel())return;const h=d.getModel(),u=new ne,f=u.add(new Bi(c));u.add(a.token.onCancellationRequested(()=>f.cancel()));const g=f.token;try{if(await this.mergeInDataFromCopy(e,i,s,g),g.isCancellationRequested)return;const p=e.filter(v=>this.isSupportedPasteProvider(v,i));if(!p.length||p.length===1&&p[0]instanceof pw)return this.applyDefaultPasteHandler(i,s,g,o);const m={triggerKind:nE.Automatic},b=await this.getPasteEdits(p,i,h,t,m,g);if(u.add(b),g.isCancellationRequested)return;if(b.edits.length===1&&b.edits[0].provider instanceof pw)return this.applyDefaultPasteHandler(i,s,g,o);if(b.edits.length){const v=d.getOption(97).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:this.getInitialActiveEditIndex(h,b.edits),allEdits:b.edits},v,async(w,C)=>{if(!w.provider.resolveDocumentPasteEdit)return w;const S=w.provider.resolveDocumentPasteEdit(w,C),L=new Dw,x=await this._pasteProgressManager.showWhile(t[0].getEndPosition(),_(921,"Resolving paste edit for '{0}'. Click to cancel",w.title),rS(Promise.race([L.p,S]),C),{cancel:()=>L.cancel()},0);return x&&(w.insertText=x.insertText,w.additionalEdit=x.additionalEdit),w},g)}await this.applyDefaultPasteHandler(i,s,g,o)}finally{u.dispose(),this._currentPasteOperation===l&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),_(922,"Running paste handlers. Click to cancel and do basic paste"),l,{cancel:async()=>{l.cancel(),!a.token.isCancellationRequested&&await this.applyDefaultPasteHandler(i,s,a.token,o)}}).finally(()=>{a.dispose()}),this._currentPasteOperation=l}showPasteAsPick(e,t,i,s,o){this._logService.trace("CopyPasteController#showPasteAsPick");const r=rs(async a=>{var u;const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),d=new ne,h=d.add(new Mg(l,3,void 0,a));try{if(await this.mergeInDataFromCopy(t,s,o,h.token),h.token.isCancellationRequested)return;let f=t.filter(v=>this.isSupportedPasteProvider(v,s,e));e&&(f=f.filter(v=>this.providerMatchesPreference(v,e)));const g={triggerKind:nE.PasteAs,only:e&&"only"in e?e.only:void 0};let p=d.add(await this.getPasteEdits(f,s,c,i,g,h.token));if(h.token.isCancellationRequested)return;if(e&&(p={edits:p.edits.filter(v=>"only"in e?e.only.contains(v.kind):"preferences"in e?e.preferences.some(w=>w.contains(v.kind)):e.providerId===v.provider.id),dispose:p.dispose}),!p.edits.length){e&&this.showPasteAsNoEditMessage(i,e);return}let m;if(e)m=p.edits.at(0);else{const v={id:"editor.pasteAs.default",label:_(923,"Configure default paste action"),edit:void 0},w=await this._quickInputService.pick([...p.edits.map(C=>{var S;return{label:C.title,description:(S=C.kind)==null?void 0:S.value,edit:C}}),...Lc._configureDefaultAction?[{type:"separator"},{label:Lc._configureDefaultAction.label,edit:void 0}]:[]],{placeHolder:_(924,"Select Paste Action")});if(w===v){(u=Lc._configureDefaultAction)==null||u.run();return}m=w==null?void 0:w.edit}if(!m)return;const b=K1e(c.uri,i,m);await this._bulkEditService.apply(b,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===r&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:_(925,"Running paste handlers")},()=>r)}setCopyMetadata(e,t){this._logService.trace("CopyPasteController#setCopyMetadata new id : ",t.id),e.setData(K9,JSON.stringify(t))}fetchCopyMetadata(e){if(this._logService.trace("CopyPasteController#fetchCopyMetadata"),!e.clipboardData)return;const t=e.clipboardData.getData(K9);if(t)try{return JSON.parse(t)}catch{return}const[i,s]=Ev.getTextData(e.clipboardData);if(s)return{defaultPastePayload:{mode:s.mode,multicursorText:s.multicursorText??null,pasteOnNewLine:!!s.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,i,s){var o;if(this._logService.trace("CopyPasteController#mergeInDataFromCopy with metadata : ",i==null?void 0:i.id),i!=null&&i.id&&((o=Lc._currentCopyOperation)==null?void 0:o.handle)===i.id){const r=Lc._currentCopyOperation.operations.filter(l=>e.some(c=>c.pasteMimeTypes.some(d=>iae(d,l.providerMimeTypes)))).map(l=>l.operation),a=await Promise.all(r);if(s.isCancellationRequested)return;for(const l of a.reverse())if(l)for(const[c,d]of l)t.replace(c,d)}if(!t.has(mn.uriList)){const r=await this._clipboardService.readResources();if(s.isCancellationRequested)return;r.length&&t.append(mn.uriList,mX(U3.create(r)))}}async getPasteEdits(e,t,i,s,o,r){const a=new ne,l=await rS(Promise.all(e.map(async d=>{var h,u;try{const f=await((h=d.provideDocumentPasteEdits)==null?void 0:h.call(d,i,s,t,o,r));return f&&a.add(f),(u=f==null?void 0:f.edits)==null?void 0:u.map(g=>({...g,provider:d}))}catch(f){fl(f)||console.error(f);return}})),r),c=lh(l??[]).flat().filter(d=>!o.only||o.only.contains(d.kind));return{edits:G1e(c),dispose:()=>a.dispose()}}async applyDefaultPasteHandler(e,t,i,s){const o=e.get(mn.text)??e.get("text"),r=await(o==null?void 0:o.asString())??"";if(i.isCancellationRequested)return;const a={clipboardEvent:s,text:r,pasteOnNewLine:(t==null?void 0:t.defaultPastePayload.pasteOnNewLine)??!1,multicursorText:(t==null?void 0:t.defaultPastePayload.multicursorText)??null,mode:null};this._logService.trace("CopyPasteController#applyDefaultPasteHandler for id : ",t==null?void 0:t.id),this._editor.trigger("keyboard","paste",a)}isSupportedPasteProvider(e,t,i){var s;return(s=e.pasteMimeTypes)!=null&&s.some(o=>t.matches(o))?!i||this.providerMatchesPreference(e,i):!1}providerMatchesPreference(e,t){return"only"in t?e.providedPasteEditKinds.some(i=>t.only.contains(i)):"preferences"in t?t.preferences.some(i=>t.preferences.some(s=>s.contains(i))):e.id===t.providerId}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Iet,{resource:e.uri});for(const s of Array.isArray(i)?i:[]){const o=new Qi(s),r=t.findIndex(a=>o.contains(a.kind));if(r>=0)return r}return 0}},Lc=Xv,Xv.ID="editor.contrib.copyPasteActionController",Xv);Ag=Lc=ket([Xu(1,Ae),Xu(2,Li),Xu(3,ED),Xu(4,La),Xu(5,ki),Xu(6,lt),Xu(7,De),Xu(8,No),Xu(9,jbe)],Ag);const vw="9_cutcopypaste",Eet=Xd||document.queryCommandSupported("cut"),ewe=Xd||document.queryCommandSupported("copy"),Net=typeof navigator.clipboard>"u"||qr?document.queryCommandSupported("paste"):!0;function CX(n){return n.register(),n}const Det=Eet?CX(new XS({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Xd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(813,"Cu&&t"),order:1},{menuId:Te.EditorContext,group:vw,title:_(814,"Cut"),when:H.writable,order:1},{menuId:Te.CommandPalette,group:"",title:_(815,"Cut"),order:1},{menuId:Te.SimpleEditorContext,group:vw,title:_(816,"Cut"),when:H.writable,order:1}]})):void 0,Tet=ewe?CX(new XS({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Xd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(817,"&&Copy"),order:2},{menuId:Te.EditorContext,group:vw,title:_(818,"Copy"),order:2},{menuId:Te.CommandPalette,group:"",title:_(819,"Copy"),order:1},{menuId:Te.SimpleEditorContext,group:vw,title:_(820,"Copy"),order:2}]})):void 0;Rs.appendMenuItem(Te.MenubarEditMenu,{submenu:Te.MenubarCopy,title:ie(825,"Copy As"),group:"2_ccp",order:3});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextCopy,title:ie(826,"Copy As"),group:vw,order:3});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextShare,title:ie(827,"Share"),group:"11_share",order:-1,when:le.and(le.notEquals("resourceScheme","output"),H.editorTextFocus)});Rs.appendMenuItem(Te.ExplorerContext,{submenu:Te.ExplorerContextShare,title:ie(828,"Share"),group:"11_share",order:-1});const G9=Net?CX(new XS({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Xd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:Te.MenubarEditMenu,group:"2_ccp",title:_(821,"&&Paste"),order:4},{menuId:Te.EditorContext,group:vw,title:_(822,"Paste"),when:H.writable,order:4},{menuId:Te.CommandPalette,group:"",title:_(823,"Paste"),order:1},{menuId:Te.SimpleEditorContext,group:vw,title:_(824,"Paste"),when:H.writable,order:4}]})):void 0;class Ret extends Ne{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:ie(829,"Copy with Syntax Highlighting"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,weight:100}})}run(e,t){const i=e.get(Li);i.trace("ExecCommandCopyWithSyntaxHighlightingAction#run"),!(!t.hasModel()||!t.getOption(45)&&t.getSelection().isEmpty())&&(sV.forceCopyWithSyntaxHighlighting=!0,t.focus(),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (before execCommand copy)"),t.getContainerDomNode().ownerDocument.execCommand("copy"),i.trace("ExecCommandCopyWithSyntaxHighlightingAction (after execCommand copy)"),sV.forceCopyWithSyntaxHighlighting=!1)}}function twe(n,e){n&&(n.addImplementation(1e4,"code-editor",(t,i)=>{const s=t.get(Li);s.trace("registerExecCommandImpl (addImplementation code-editor for : ",e,")");const o=t.get(Bt).getFocusedCodeEditor();if(o&&o.hasTextFocus()){const r=o.getOption(45),a=o.getSelection();return a&&a.isEmpty()&&!r||(o.getOption(170)&&e==="cut"?(cae(o),s.trace("registerExecCommandImpl (before execCommand copy)"),o.getContainerDomNode().ownerDocument.execCommand("copy"),o.trigger(void 0,"cut",void 0),s.trace("registerExecCommandImpl (after execCommand copy)")):(cae(o),s.trace("registerExecCommandImpl (before execCommand "+e+")"),o.getContainerDomNode().ownerDocument.execCommand(e),s.trace("registerExecCommandImpl (after execCommand "+e+")"))),!0}return!1}),n.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(Li);return s.trace("registerExecCommandImpl (addImplementation generic-dom for : ",e,")"),s.trace("registerExecCommandImpl (before execCommand "+e+")"),uD().execCommand(e),s.trace("registerExecCommandImpl (after execCommand "+e+")"),!0}))}function cae(n){if(n.getOption(170)){const t=qY.get(n.getId());t&&t.onWillCopy()}}twe(Det,"cut");twe(Tet,"copy");G9&&(G9.addImplementation(1e4,"code-editor",(n,e)=>{const t=n.get(Li);t.trace("registerExecCommandImpl (addImplementation code-editor for : paste)");const i=n.get(Bt),s=n.get(La),o=n.get(To),r=n.get(aet),a=i.getFocusedCodeEditor();if(a&&a.hasModel()&&a.hasTextFocus()){if(a.getOption(170)){const h=qY.get(a.getId());h&&h.onWillPaste()}const c=Ls.create(!0);t.trace("registerExecCommandImpl (before triggerPaste)");const d=s.triggerPaste(ii().vscodeWindowId);return d?(t.trace("registerExecCommandImpl (triggerPaste defined)"),d.then(async()=>{var h;if(t.trace("registerExecCommandImpl (after triggerPaste)"),r.quality!=="stable"){const u=c.elapsed();o.publicLog2("editorAsyncPaste",{duration:u})}return((h=Ag.get(a))==null?void 0:h.finishedPaste())??Promise.resolve()})):(t.trace("registerExecCommandImpl (triggerPaste undefined)"),Tu?(t.trace("registerExecCommandImpl (Paste handling on web)"),(async()=>{const h=await s.readText();if(h!==""){const u=gu.INSTANCE.get(h);let f=!1,g=null,p=null;u&&(f=a.getOption(45)&&!!u.isFromEmptySelection,g=typeof u.multicursorText<"u"?u.multicursorText:null,p=u.mode),t.trace("registerExecCommandImpl (clipboardText.length : ",h.length," id : ",u==null?void 0:u.id,")"),a.trigger("keyboard","paste",{text:h,pasteOnNewLine:f,multicursorText:g,mode:p})}})()):!0)}return!1}),G9.addImplementation(0,"generic-dom",(n,e)=>(n.get(Li).trace("registerExecCommandImpl (addImplementation generic-dom for : paste)"),n.get(La).triggerPaste(ii().vscodeWindowId)??!1)));ewe&&we(Ret);const Oi=new class{constructor(){this.QuickFix=new Qi("quickfix"),this.Refactor=new Qi("refactor"),this.RefactorExtract=this.Refactor.append("extract"),this.RefactorInline=this.Refactor.append("inline"),this.RefactorMove=this.Refactor.append("move"),this.RefactorRewrite=this.Refactor.append("rewrite"),this.Notebook=new Qi("notebook"),this.Source=new Qi("source"),this.SourceOrganizeImports=this.Source.append("organizeImports"),this.SourceFixAll=this.Source.append("fixAll"),this.SurroundWith=this.Refactor.append("surround")}};var ka;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(ka||(ka={}));function Met(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>iwe(e,t,n.include))||!n.includeSourceActions&&Oi.Source.contains(e))}function Aet(n,e){const t=e.kind?new Qi(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>iwe(t,i,n.include))||!n.includeSourceActions&&t&&Oi.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function iwe(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class Jh{static fromUser(e,t){return!e||typeof e!="object"?new Jh(t.kind,t.apply,!1):new Jh(Jh.getKindFromUser(e,t.kind),Jh.getApplyFromUser(e,t.apply),Jh.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Qi(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class Pet{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}async resolve(e){var t;if((t=this.provider)!=null&&t.resolveCodeAction&&!this.action.edit){let i;try{i=await this.provider.resolveCodeAction(this.action,e)}catch(s){On(s)}i&&(this.action.edit=i.edit)}return this}}const nwe="editor.action.codeAction",yX="editor.action.quickFix",swe="editor.action.autoFix",owe="editor.action.refactor",rwe="editor.action.sourceAction",b$="editor.action.organizeImports",v$="editor.action.fixAll",Oet=1e3;class jk extends G{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Yo(e.diagnostics)?Yo(t.diagnostics)?jk.codeActionsPreferredComparator(e,t):-1:Yo(t.diagnostics)?1:jk.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(jk.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Oi.QuickFix.contains(new Qi(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const dae={actions:[],documentation:void 0};async function C0(n,e,t,i,s,o){var p;const r=i.filter||{},a={...r,excludes:[...r.excludes||[],Oi.Notebook]},l={only:(p=r.include)==null?void 0:p.value,trigger:i.type},c=new pX(e,o),d=i.type===2,h=Fet(n,e,d?a:r),u=new ne,f=h.map(async m=>{const b=setTimeout(()=>s.report(m),1250);try{const v=await m.provideCodeActions(e,t,l,c.token);if(c.token.isCancellationRequested)return v==null||v.dispose(),dae;v&&u.add(v);const w=((v==null?void 0:v.actions)||[]).filter(S=>S&&Aet(r,S)),C=Wet(m,w,r.include);return{actions:w.map(S=>new Pet(S,m)),documentation:C}}catch(v){if(fl(v))throw v;return On(v),dae}finally{clearTimeout(b)}}),g=n.onDidChange(()=>{const m=n.all(e);Fi(m,h)||c.cancel()});try{const m=await Promise.all(f),b=m.map(C=>C.actions).flat(),v=[...lh(m.map(C=>C.documentation)),...Bet(n,e,i,b)],w=new jk(b,v,u);return u.add(w),w}catch(m){throw u.dispose(),m}finally{g.dispose(),c.dispose()}}function Fet(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>Met(t,new Qi(s))):!0)}function*Bet(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)==null?void 0:r.call(a,{trigger:t.type,only:(o=(s=t.filter)==null?void 0:s.include)==null?void 0:o.value},i.map(l=>l.action)))}function Wet(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new Qi(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new Qi(s.kind)))return o.command}}var om;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions",n.FromAILightbulb="fromAILightbulb",n.FromProblemsHover="fromProblemsHover"})(om||(om={}));async function Het(n,e,t,i,s=wt.None){var d,h;const o=n.get(ED),r=n.get(ki),a=n.get(To),l=n.get(fn),c=n.get(Kg);if(a.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),c.playSignal(ur.codeActionTriggered),await e.resolve(s),!s.isCancellationRequested&&!((d=e.action.edit)!=null&&d.edits.length&&!(await o.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==om.OnSave,showPreview:i==null?void 0:i.preview,reason:vo.codeAction({kind:e.action.kind,providerId:A5.fromExtensionId((h=e.provider)==null?void 0:h.extensionId)})})).isApplied)){if(e.action.command)try{await r.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const f=Vet(u);l.error(typeof f=="string"?f:_(830,"An unknown error occurred while applying the code action"))}setTimeout(()=>c.playSignal(ur.codeActionApplied),Oet)}}function Vet(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Rt.registerCommand("_executeCodeActionProvider",async function(n,e,t,i,s){if(!(e instanceof He))throw ql();const{codeActionProvider:o}=n.get(De),r=n.get(Ui).getModel(e);if(!r)throw ql();const a=Ie.isISelection(t)?Ie.liftSelection(t):D.isIRange(t)?r.validateRange(t):void 0;if(!a)throw ql();const l=typeof i=="string"?new Qi(i):void 0,c=await C0(o,r,a,{type:1,triggerAction:ka.Default,filter:{includeSourceActions:!0,include:l}},Vd.None,wt.None),d=[],h=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let u=0;uu.action)}finally{setTimeout(()=>c.dispose(),100)}});var zet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jet=function(n,e){return function(t,i){e(t,i,n)}},w$,Qv;let C$=(Qv=class{constructor(e){this.keybindingService=e}getResolver(){const e=new ro(()=>this.keybindingService.getKeybindings().filter(t=>w$.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===b$?i={kind:Oi.SourceOrganizeImports.value}:t.command===v$&&(i={kind:Oi.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,...Jh.fromUser(i,{kind:Qi.None,apply:"never"})}}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new Qi(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}},w$=Qv,Qv.codeActionCommands=[owe,nwe,rwe,b$,v$],Qv);C$=w$=zet([jet(0,Vt)],C$);F("symbolIcon.arrayForeground",xt,_(1495,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.booleanForeground",xt,_(1496,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1497,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.colorForeground",xt,_(1498,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constantForeground",xt,_(1499,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1500,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1501,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1502,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},_(1503,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1504,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.fileForeground",xt,_(1505,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.folderForeground",xt,_(1506,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1507,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1508,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keyForeground",xt,_(1509,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.keywordForeground",xt,_(1510,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},_(1511,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.moduleForeground",xt,_(1512,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.namespaceForeground",xt,_(1513,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.nullForeground",xt,_(1514,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.numberForeground",xt,_(1515,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.objectForeground",xt,_(1516,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.operatorForeground",xt,_(1517,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.packageForeground",xt,_(1518,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.propertyForeground",xt,_(1519,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.referenceForeground",xt,_(1520,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.snippetForeground",xt,_(1521,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.stringForeground",xt,_(1522,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.structForeground",xt,_(1523,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.textForeground",xt,_(1524,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.typeParameterForeground",xt,_(1525,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.unitForeground",xt,_(1526,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));F("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},_(1527,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const awe=Object.freeze({kind:Qi.Empty,title:_(866,"More Actions...")}),$et=Object.freeze([{kind:Oi.QuickFix,title:_(867,"Quick Fix")},{kind:Oi.RefactorExtract,title:_(868,"Extract"),icon:de.wrench},{kind:Oi.RefactorInline,title:_(869,"Inline"),icon:de.wrench},{kind:Oi.RefactorRewrite,title:_(870,"Rewrite"),icon:de.wrench},{kind:Oi.RefactorMove,title:_(871,"Move"),icon:de.wrench},{kind:Oi.SurroundWith,title:_(872,"Surround With"),icon:de.surroundWith},{kind:Oi.Source,title:_(873,"Source Action"),icon:de.symbolFile},awe]);function Uet(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:awe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!((r=o.action.edit)!=null&&r.edits.length)}});const i=$et.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new Qi(o.action.kind):Qi.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions){const a=o.group;s.push({kind:"action",item:r,group:r.action.isAI?{title:a.title,kind:a.kind,icon:de.sparkle}:a,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}}return s}const lwe=new Se("supportedCodeAction",""),hae="_typescript.applyFixAllCodeAction";class qet extends G{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new ya),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>t_(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:ka.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const i=this._editor.getOption(73).enabled;if(i!==Tc.Off){{if(i===Tc.On)return t;if(i===Tc.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:r,column:a}=t.getPosition(),l=o.getLineContent(r);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(r)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var Wb;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(fl(r))return y$;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(Wb||(Wb={}));const y$=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class Ket extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new Gt),this._state=Wb.Empty,this._onDidChangeState=this._register(new q),this.onDidChangeState=this._onDidChangeState.event,this.codeActionsDisposable=this._register(new Gt),this._disposed=!1,this._supportedCodeActions=lwe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(73)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(Wb.Empty,!0))}_settingEnabledNearbyQuickfixes(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:e==null?void 0:e.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(Wb.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(104)){const t=this._registry.all(e).flatMap(i=>i.providedCodeActionKinds??[]);this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new qet(this._editor,this._markerService,i=>{var l;if(!i){this.setState(Wb.Empty);return}const s=i.selection.getStartPosition(),o=rs(async c=>{var h,u,f,g,p,m,b,v,w,C;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===ka.QuickFix||(u=(h=i.trigger.filter)==null?void 0:h.include)!=null&&u.contains(Oi.QuickFix))){const S=await C0(this._registry,e,i.selection,i.trigger,Vd.None,c);this.codeActionsDisposable.value=S;const L=[...S.allActions];if(c.isCancellationRequested)return S.dispose(),y$;const x=(f=S.validActions)==null?void 0:f.some(E=>E.action.kind&&Oi.QuickFix.contains(new Qi(E.action.kind))&&!E.action.isAI),I=this._markerService.read({resource:e.uri});if(x){for(const E of S.validActions)(p=(g=E.action.command)==null?void 0:g.arguments)!=null&&p.some(R=>typeof R=="string"&&R.includes(hae))&&(E.action.diagnostics=[...I.filter(R=>R.relatedInformation)]);return{validActions:S.validActions,allActions:L,documentation:S.documentation,hasAutoFix:S.hasAutoFix,hasAIFix:S.hasAIFix,allAIFixes:S.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=S}}}else if(!x&&I.length>0){const E=i.selection.getPosition();let R=E,M=Number.MAX_VALUE;const A=[...S.validActions];for(const P of I){const B=P.endColumn,V=P.endLineNumber,K=P.startLineNumber;if(V===E.lineNumber||K===E.lineNumber){R=new U(V,B);const z={type:i.trigger.type,triggerAction:i.trigger.triggerAction,filter:{include:(m=i.trigger.filter)!=null&&m.include?(b=i.trigger.filter)==null?void 0:b.include:Oi.QuickFix},autoApply:i.trigger.autoApply,context:{notAvailableMessage:((v=i.trigger.context)==null?void 0:v.notAvailableMessage)||"",position:R}},j=new Ie(R.lineNumber,R.column,R.lineNumber,R.column),X=await C0(this._registry,e,j,z,Vd.None,c);if(c.isCancellationRequested)return X.dispose(),y$;if(X.validActions.length!==0){for(const Y of X.validActions)(C=(w=Y.action.command)==null?void 0:w.arguments)!=null&&C.some(te=>typeof te=="string"&&te.includes(hae))&&(Y.action.diagnostics=[...I.filter(te=>te.relatedInformation)]);S.allActions.length===0&&L.push(...X.allActions),Math.abs(E.column-B)V.findIndex(K=>K.action.title===P.action.title)===B);return W.sort((P,B)=>P.action.isPreferred&&!B.action.isPreferred?-1:!P.action.isPreferred&&B.action.isPreferred||P.action.isAI&&!B.action.isAI?1:!P.action.isAI&&B.action.isAI?-1:0),{validActions:W,allActions:L,documentation:S.documentation,hasAutoFix:S.hasAutoFix,hasAIFix:S.hasAIFix,allAIFixes:S.allAIFixes,dispose:()=>{this.codeActionsDisposable.value=S}}}}if(i.trigger.type===1){const S=await C0(this._registry,e,i.selection,i.trigger,Vd.None,c);return this.codeActionsDisposable.value=S,S}const d=await C0(this._registry,e,i.selection,i.trigger,Vd.None,c);return this.codeActionsDisposable.value=d,d});i.trigger.type===1&&((l=this._progressService)==null||l.showWhile(o,250));const r=new Wb.Triggered(i.trigger,s,o);let a=!1;this._state.type===1&&(a=this._state.trigger.type===1&&r.type===1&&r.trigger.type===2&&this._state.position!==r.position),a?setTimeout(()=>{this.setState(r)},500):this.setState(r)},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:ka.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)==null||t.trigger(e),this.codeActionsDisposable.dispose()}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var Get=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yet=function(n,e){return function(t,i){e(t,i,n)}},AC;const uae=Ri("gutter-lightbulb",de.lightBulb,_(874,"Icon which spawns code actions menu from the gutter when there is no space in the editor.")),fae=Ri("gutter-lightbulb-auto-fix",de.lightbulbAutofix,_(875,"Icon which spawns code actions menu from the gutter when there is no space in the editor and a quick fix is available.")),gae=Ri("gutter-lightbulb-sparkle",de.lightbulbSparkle,_(876,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix is available.")),pae=Ri("gutter-lightbulb-aifix-auto-fix",de.lightbulbSparkleAutofix,_(877,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available.")),mae=Ri("gutter-lightbulb-sparkle-filled",de.sparkleFilled,_(878,"Icon which spawns code actions menu from the gutter when there is no space in the editor and an AI fix and a quick fix is available."));var _d;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(_d||(_d={}));var Jf;let pN=(Jf=class extends G{constructor(e,t){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new q),this.onClick=this._onClick.event,this._state=_d.Hidden,this._gutterState=_d.Hidden,this._iconClasses=[],this.lightbulbClasses=["codicon-"+uae.id,"codicon-"+pae.id,"codicon-"+fae.id,"codicon-"+gae.id,"codicon-"+mae.id],this.gutterDecoration=AC.GUTTER_DECORATION,this._domNode=me("div.lightBulbWidget"),this._domNode.role="listbox",this._register(Eo.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide(),(this.gutterState.type!==1||!s||this.gutterState.editorPosition.lineNumber>=s.getLineCount())&&this.gutterHide()})),this._register(qOe(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=dn(this._domNode),r=this._editor.getOption(75);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(ve.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var i,s;this._preferredKbLabel=((i=this._keybindingService.lookupKeybinding(swe))==null?void 0:i.getLabel())??void 0,this._quickFixKbLabel=((s=this._keybindingService.lookupKeybinding(yX))==null?void 0:s.getLabel())??void 0,this._updateLightBulbTitleAndIcon()})),this._register(this._editor.onMouseDown(async i=>{if(!i.target.element||!this.lightbulbClasses.some(l=>i.target.element&&i.target.element.classList.contains(l))||this.gutterState.type!==1)return;this._editor.focus();const{top:s,height:o}=dn(i.target.element),r=this._editor.getOption(75);let a=Math.floor(r/3);this.gutterState.widgetPosition.position!==null&&this.gutterState.widgetPosition.position.lineNumber22,g=S=>S>2&&this._editor.getTopForLineNumber(S)===this._editor.getTopForLineNumber(S-1),p=this._editor.getLineDecorations(a);let m=!1;if(p)for(const S of p){const L=S.options.glyphMarginClassName;if(L&&!this.lightbulbClasses.some(x=>L.includes(x))){m=!0;break}}let b=a,v=1;if(!f){const S=L=>{const x=r.getLineContent(L);return/^\s*$|^\s+/.test(x)||x.length<=v};if(a>1&&!g(a-1)){const L=r.getLineCount(),x=a===L,I=a>1&&S(a-1),E=!x&&S(a+1),R=S(a),M=!E&&!I;if(!E&&!I&&!m)return this.gutterState=new _d.Showing(e,t,i,{position:{lineNumber:b,column:v},preference:AC._posPref}),this.renderGutterLightbub(),this.hide();I||x||I&&!R?b-=1:(E||M&&R)&&(b+=1)}else if(a===1&&(a===r.getLineCount()||!S(a+1)&&!S(a)))if(this.gutterState=new _d.Showing(e,t,i,{position:{lineNumber:b,column:v},preference:AC._posPref}),m)this.gutterHide();else return this.renderGutterLightbub(),this.hide();else if(a{this._gutterDecorationID=t.addDecoration(new D(e,0,e,0),this.gutterDecoration)})}_removeGutterDecoration(e){this._editor.changeDecorations(t=>{t.removeDecoration(e),this._gutterDecorationID=void 0})}_updateGutterDecoration(e,t){this._editor.changeDecorations(i=>{i.changeDecoration(e,new D(t,0,t,0)),i.changeDecorationOptions(e,this.gutterDecoration)})}_updateLightbulbTitle(e,t){this.state.type===1&&(t?this.title=_(879,"Run: {0}",this.state.actions.validActions[0].action.title):e&&this._preferredKbLabel?this.title=_(880,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):!e&&this._quickFixKbLabel?this.title=_(881,"Show Code Actions ({0})",this._quickFixKbLabel):e||(this.title=_(882,"Show Code Actions")))}set title(e){this._domNode.title=e}},AC=Jf,Jf.GUTTER_DECORATION=st.register({description:"codicon-gutter-lightbulb-decoration",glyphMarginClassName:$e.asClassName(de.lightBulb),glyphMargin:{position:Qd.Left},stickiness:1}),Jf.ID="editor.contrib.lightbulbWidget",Jf._posPref=[0],Jf);pN=AC=Get([Yet(1,Vt)],pN);var Zet=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sh=function(n,e){return function(t,i){e(t,i,n)}},PC;const Xet="quickfix-edit-highlight";var Am;let ww=(Am=class extends G{static get(e){return e.getContribution(PC.ID)}constructor(e,t,i,s,o,r,a,l,c,d,h){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._progressService=h,this._activeCodeActions=this._register(new Gt),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new Ket(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new ro(()=>{const u=this._editor.getContribution(pN.ID);return u&&this._register(u.onClick(f=>this.showCodeActionsFromLightbulb(f.actions,f))),u}),this._resolver=s.createInstance(C$),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const i=e.validActions[0],s=i.action.command;s&&s.id==="inlineChat.start"&&s.arguments&&s.arguments.length>=1&&s.arguments[0]&&(s.arguments[0]={...s.arguments[0],autoSend:!1}),await this.applyCodeAction(i,!1,!1,om.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var r;if(!this._editor.hasModel())return;(r=ba.get(this._editor))==null||r.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}async applyCodeAction(e,t,i,s){const o=this._progressService.show(!0,500);try{await this._instantiationService.invokeFunction(Het,e,s,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:ka.QuickFix,filter:{}}),o.done()}}hideLightBulbWidget(){var e,t;(e=this._lightBulbWidget.rawValue)==null||e.hide(),(t=this._lightBulbWidget.rawValue)==null||t.gutterHide()}async update(e){var s,o,r,a,l;if(e.type!==1){this.hideLightBulbWidget();return}let t;try{t=await e.actions}catch(c){Je(c);return}if(this._disposed)return;const i=this._editor.getSelection();if((i==null?void 0:i.startLineNumber)===e.position.lineNumber)if((s=this._lightBulbWidget.value)==null||s.update(t,e.trigger,e.position),e.trigger.type===1){if((o=e.trigger.filter)!=null&&o.include){const d=this.tryGetValidActionToApply(e.trigger,t);if(d){try{this.hideLightBulbWidget(),await this.applyCodeAction(d,!1,!1,om.FromCodeActions)}finally{t.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,t);if(h&&h.action.disabled){(r=ba.get(this._editor))==null||r.showMessage(h.action.disabled,e.trigger.context.position),t.dispose();return}}}const c=!!((a=e.trigger.filter)!=null&&a.include);if(e.trigger.context&&(!t.allActions.length||!c&&!t.validActions.length)){(l=ba.get(this._editor))==null||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=t,t.dispose();return}this._activeCodeActions.value=t,this.showCodeActionList(t,this.toCoords(e.position),{includeDisabledActions:c,fromLightbulb:!1})}else this._actionWidgetService.isVisible?t.dispose():this._activeCodeActions.value=t}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:i})=>i.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,i){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=U.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,d)=>{this.applyCodeAction(c,!0,!!d,i.fromLightbulb?om.FromAILightbulb:om.FromCodeActions),this._actionWidgetService.hide(!1),s.clear()},onHide:c=>{var d;(d=this._editor)==null||d.focus(),s.clear()},onHover:async(c,d)=>{var f;if(d.isCancellationRequested)return;let h=!1;const u=c.action.kind;if(u){const g=new Qi(u);h=[Oi.RefactorExtract,Oi.RefactorInline,Oi.RefactorRewrite,Oi.RefactorMove,Oi.Source].some(m=>m.contains(g))}return{canPreview:h||!!((f=c.action.edit)!=null&&f.edits.length)}},onFocus:c=>{var d,h;if(c&&c.action){const u=c.action.ranges,f=c.action.diagnostics;if(s.clear(),u&&u.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:PC.DECORATION})):u.map(p=>({range:p,options:PC.DECORATION}));s.set(g)}else if(f&&f.length>0){const g=f.map(m=>({range:m,options:PC.DECORATION}));s.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const m=(h=(d=this._editor.getModel())==null?void 0:d.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))==null?void 0:h.word;Jd(_(863,"Context: {0} at line {1} and column {2}.",m,p.startLineNumber,p.startColumn))}}}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,Uet(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=dn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var t;const e=(t=this._editor)==null?void 0:t.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:e==null?void 0:e.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>({id:o.id,label:o.title,tooltip:o.tooltip??"",class:void 0,enabled:!0,run:()=>this._commandService.executeCommand(o.id,...o.arguments??[])}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:_(864,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:_(865,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}},PC=Am,Am.ID="editor.contrib.codeActionController",Am.DECORATION=st.register({description:"quickfix-highlight",className:Xet}),Am);ww=PC=Zet([Sh(1,Ou),Sh(2,Xe),Sh(3,Ae),Sh(4,De),Sh(5,Tg),Sh(6,ki),Sh(7,lt),Sh(8,S_),Sh(9,Ae),Sh(10,Tg)],ww);dc((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Uf));const i=n.getColor(Xp);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${Gd(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});function BD(n){return le.regex(lwe.keys()[0],new RegExp("(\\s|^)"+wa(n.value)+"\\b"))}const SX={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:_(831,"Kind of the code action to run.")},apply:{type:"string",description:_(832,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[_(833,"Always apply the first returned code action."),_(834,"Apply the first returned code action if it is the only one."),_(835,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:_(836,"Controls if only preferred code actions should be returned.")}}};function $w(n,e,t,i,s=ka.Default){if(n.hasModel()){const o=ww.get(n);o==null||o.manualTriggerAtCurrentPosition(e,s,t,i)}}class Qet extends Ne{constructor(){super({id:yX,label:ie(853,"Quick Fix..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),kbOpts:{kbExpr:H.textInputFocus,primary:2137,weight:100}})}run(e,t){return $w(t,_(837,"No code actions available"),void 0,void 0,ka.QuickFix)}}class Jet extends hs{constructor(){super({id:nwe,precondition:le.and(H.writable,H.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:SX}]}})}runEditorCommand(e,t,i){const s=Jh.fromUser(i,{kind:Qi.Empty,apply:"ifSingle"});return $w(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(838,"No preferred code actions for '{0}' available",i.kind):_(839,"No code actions for '{0}' available",i.kind):s.preferred?_(840,"No preferred code actions available"):_(841,"No code actions available"),{include:s.kind,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply)}}class ett extends Ne{constructor(){super({id:owe,label:ie(854,"Refactor..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),kbOpts:{kbExpr:H.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:le.and(H.writable,BD(Oi.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:SX}]}})}run(e,t,i){const s=Jh.fromUser(i,{kind:Oi.Refactor,apply:"never"});return $w(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(842,"No preferred refactorings for '{0}' available",i.kind):_(843,"No refactorings for '{0}' available",i.kind):s.preferred?_(844,"No preferred refactorings available"):_(845,"No refactorings available"),{include:Oi.Refactor.contains(s.kind)?s.kind:Qi.None,onlyIncludePreferredActions:s.preferred},s.apply,ka.Refactor)}}class ttt extends Ne{constructor(){super({id:rwe,label:ie(855,"Source Action..."),precondition:le.and(H.writable,H.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:le.and(H.writable,BD(Oi.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:SX}]}})}run(e,t,i){const s=Jh.fromUser(i,{kind:Oi.Source,apply:"never"});return $w(t,typeof(i==null?void 0:i.kind)=="string"?s.preferred?_(846,"No preferred source actions for '{0}' available",i.kind):_(847,"No source actions for '{0}' available",i.kind):s.preferred?_(848,"No preferred source actions available"):_(849,"No source actions available"),{include:Oi.Source.contains(s.kind)?s.kind:Qi.None,includeSourceActions:!0,onlyIncludePreferredActions:s.preferred},s.apply,ka.SourceAction)}}class itt extends Ne{constructor(){super({id:b$,label:ie(856,"Organize Imports"),precondition:le.and(H.writable,BD(Oi.SourceOrganizeImports)),kbOpts:{kbExpr:H.textInputFocus,primary:1581,weight:100},metadata:{description:ie(857,"Organize imports in the current file. Also called 'Optimize Imports' by some tools")}})}run(e,t){return $w(t,_(850,"No organize imports action available"),{include:Oi.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",ka.OrganizeImports)}}class ntt extends Ne{constructor(){super({id:v$,label:ie(858,"Fix All"),precondition:le.and(H.writable,BD(Oi.SourceFixAll))})}run(e,t){return $w(t,_(851,"No fix all action available"),{include:Oi.SourceFixAll,includeSourceActions:!0},"ifSingle",ka.FixAll)}}class stt extends Ne{constructor(){super({id:swe,label:ie(859,"Auto Fix..."),precondition:le.and(H.writable,BD(Oi.QuickFix)),kbOpts:{kbExpr:H.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return $w(t,_(852,"No auto fixes available"),{include:Oi.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",ka.AutoFix)}}At(ww.ID,ww,3);At(pN.ID,pN,4);we(Qet);we(ett);we(ttt);we(itt);we(stt);we(ntt);ye(new Jet);Ji.as(ch.Configuration).registerConfiguration({...N3,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:6,description:_(860,"Enable/disable showing group headers in the Code Action menu."),default:!0}}});Ji.as(ch.Configuration).registerConfiguration({...N3,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:6,description:_(861,"Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});Ji.as(ch.Configuration).registerConfiguration({...N3,properties:{"editor.codeActions.triggerOnFocusChange":{type:"boolean",scope:6,markdownDescription:_(862,"Enable triggering {0} when {1} is set to {2}. Code Actions must be set to {3} to be triggered for window and focus changes.","`#editor.codeActionsOnSave#`","`#files.autoSave#`","`afterDelay`","`always`"),default:!1}}});const uF=class uF{constructor(){this.lenses=[]}dispose(){var e;(e=this._store)==null||e.dispose()}get isDisposed(){var e;return((e=this._store)==null?void 0:e.isDisposed)??!1}add(e,t){Nw(e)&&(this._store??(this._store=new ne),this._store.add(e));for(const i of e.lenses)this.lenses.push({symbol:i,provider:t})}};uF.Empty=new uF;let ES=uF;async function cwe(n,e,t){const i=n.ordered(e),s=new Map,o=new ES,r=i.map(async(a,l)=>{s.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){On(c)}});return await Promise.all(r),t.isCancellationRequested?(o.dispose(),ES.Empty):(o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:s.get(a.provider)s.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o)}Rt.registerCommand("_executeCodeLensProvider",function(n,...e){let[t,i]=e;Ft(He.isUri(t)),Ft(typeof i=="number"||!i);const{codeLensProvider:s}=n.get(De),o=n.get(Ui).getModel(t);if(!o)throw ql();const r=[],a=new ne;return cwe(s,o,wt.None).then(l=>{a.add(l);const c=[];for(const d of l.lenses)i==null||d.symbol.command?r.push(d.symbol):i-- >0&&d.provider.resolveCodeLens&&c.push(Promise.resolve(d.provider.resolveCodeLens(o,d.symbol,wt.None)).then(h=>r.push(h||d.symbol)));return Promise.all(c)}).then(()=>r).finally(()=>{setTimeout(()=>a.dispose(),100)})});var ott=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rtt=function(n,e){return function(t,i){e(t,i,n)}};const dwe=mt("ICodeLensCache");class _ae{constructor(e,t){this.lineCount=e,this.data=t}}let S$=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new Qc(20,.75);const t="codelens/cache";NL(ri,()=>e.remove(t,1));const i="codelens/cache2",s=e.get(i,1,"{}");this._deserialize(s);const o=ve.filter(e.onWillSaveState,r=>r.reason===Lm.SHUTDOWN);ve.once(o)(r=>{e.store(i,this._serialize(),1,1)})}put(e,t){const i=t.lenses.map(r=>{var a;return{range:r.symbol.range,command:r.symbol.command&&{id:"",title:(a=r.symbol.command)==null?void 0:a.title}}}),s=new ES;s.add({lenses:i},this._fakeProvider);const o=new _ae(e.getLineCount(),s);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,i]of this._cache){const s=new Set;for(const o of i.data.lenses)s.add(o.symbol.range.startLineNumber);e[t]={lineCount:i.lineCount,lines:[...s.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const i in t){const s=t[i],o=[];for(const a of s.lines)o.push({range:new D(a,1,a,11)});const r=new ES;r.add({lenses:o},this._fakeProvider),this._cache.set(i,new _ae(s.lineCount,r))}}catch{}}};S$=ott([rtt(0,Jo)],S$);Lt(dwe,S$,1);class att{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}const wI=class wI{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${wI._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const i=[];let s=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),i.addDecoration({range:c.symbol.range,options:bae},h=>this._decorationIds[d]=h),a?a=D.plusRange(a,c.symbol.range):a=D.lift(c.symbol.range)}),this._viewZone=new att(a.startLineNumber-1,o,r),this._viewZoneId=s.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new x$(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const i=this._editor.getModel().getDecorationRange(e),s=this._data[t].symbol;return!!(i&&D.isEmpty(s.range)===i.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((i,s)=>{t.addDecoration({range:i.symbol.range,options:bae},o=>this._decorationIds[s]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dL=function(n,e){return function(t,i){e(t,i,n)}},Ey;let mN=(Ey=class{constructor(e,t,i,s,o,r){this._editor=e,this._languageFeaturesService=t,this._commandService=s,this._notificationService=o,this._codeLensCache=r,this._disposables=new ne,this._localToDispose=new ne,this._lenses=[],this._oldCodeLensModels=new ne,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new ai(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(59)||a.hasChanged(25)||a.hasChanged(24))&&this._updateLensStyle(),a.hasChanged(23)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._localToDispose.dispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)==null||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(75)/this._editor.getOption(61));let t=this._editor.getOption(25);return(!t||t<5)&&(t=this._editor.getOption(61)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(24),s=this._editor.getOption(59),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",s.fontFeatureSettings),i&&(o.setProperty("--vscode-editorCodeLens-fontFamily",i),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",zr.fontFamily)),this._editor.changeViewZones(r=>{for(const a of this._lenses)a.updateHeight(e,r)})}_localDispose(){var e,t,i;(e=this._getCodeLensModelPromise)==null||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)==null||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(i=this._currentCodeLensModel)==null||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(23)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&kg(()=>{const s=this._codeLensCache.get(e);t===s&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const s of this._languageFeaturesService.codeLensProvider.all(e))if(typeof s.onDidChange=="function"){const o=s.onDidChange(()=>i.schedule());this._localToDispose.add(o)}const i=new ai(()=>{var o;const s=Date.now();(o=this._getCodeLensModelPromise)==null||o.cancel(),this._getCodeLensModelPromise=rs(r=>cwe(this._languageFeaturesService.codeLensProvider,e,r)),this._getCodeLensModelPromise.then(r=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=r,this._codeLensCache.put(e,r);const a=this._provideCodeLensDebounce.update(e,Date.now()-s);i.delay=a,this._renderCodeLensSymbols(r),this._resolveCodeLensesInViewportSoon()},Je)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(Re(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var s;this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{const a=[];let l=-1;this._lenses.forEach(d=>{!d.isValid()||l===d.getLineNumber()?a.push(d):(d.update(r),l=d.getLineNumber())});const c=new Y9;a.forEach(d=>{d.dispose(c,r),this._lenses.splice(this._lenses.indexOf(d),1)}),c.commit(o)})}),i.schedule(),this._resolveCodeLensesScheduler.cancel(),(s=this._resolveCodeLensesPromise)==null||s.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorText(()=>{i.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{i.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(s=>{s.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Re(()=>{if(this._editor.getModel()){const s=oh.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(r=>{this._disposeAllLenses(o,r)})}),s.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(s=>{if(s.target.type!==9)return;let o=s.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const r of this._lenses){const a=r.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),i.schedule()}_disposeAllLenses(e,t){const i=new Y9;for(const s of this._lenses)s.dispose(i,t);e&&i.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),i=[];let s;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(s&&s[s.length-1].symbol.range.startLineNumber===l?s.push(a):(s=[a],i.push(s)))}if(!i.length&&!this._lenses.length)return;const o=oh.capture(this._editor),r=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new Y9;let d=0,h=0;for(;hthis._resolveCodeLensesInViewportSoon())),d++,h++)}for(;dthis._resolveCodeLensesInViewportSoon())),h++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var r;(r=this._resolveCodeLensesPromise)==null||r.cancel(),this._resolveCodeLensesPromise=void 0;const e=this._editor.getModel();if(!e)return;const t=[],i=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(e);l&&(t.push(l),i.push(a))}),t.length===0){this._oldCodeLensModels.clear();return}const s=Date.now(),o=rs(a=>{const l=t.map((c,d)=>{const h=new Array(c.length),u=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(e,f.symbol,a)).then(p=>{h[g]=p},On):(h[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(u).then(()=>{!a.isCancellationRequested&&!i[d].isDisposed()&&i[d].updateCommands(h)})});return Promise.all(l)});this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(e,Date.now()-s);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(e,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{Je(a),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,(e=this._currentCodeLensModel)!=null&&e.isDisposed?void 0:this._currentCodeLensModel}},Ey.ID="css.editor.codeLens",Ey);mN=ltt([dL(1,De),dL(2,hc),dL(3,ki),dL(4,fn),dL(5,dwe)],mN);At(mN.ID,mN,1);we(class extends Ne{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:H.hasCodeLensProvider,label:ie(884,"Show CodeLens Commands for Current Line")})}async run(e,t){if(!t.hasModel())return;const i=e.get(No),s=e.get(ki),o=e.get(fn),r=t.getSelection().positionLineNumber,a=t.getContribution(mN.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const u of l.lenses)u.symbol.command&&u.symbol.range.startLineNumber===r&&c.push({label:u.symbol.command.title,command:u.symbol.command});if(c.length===0)return;const d=await i.pick(c,{canPickMany:!1,placeHolder:_(883,"Select a command")});if(!d)return;let h=d.command;if(l.isDisposed){const u=await a.getModel(),f=u==null?void 0:u.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===r&&((p=g.symbol.command)==null?void 0:p.title)===h.title});if(!f||!f.symbol.command)return;h=f.symbol.command}try{await s.executeCommand(h.id,...h.arguments||[])}catch(u){o.error(u)}}});class Z9{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class FL{constructor(e,t,i,s,o,r){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=s,this.initialMousePosY=o,this.supportsMarkerHover=r,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}class Cw{constructor(e,t){this.renderedHoverParts=e,this.disposables=t}dispose(){var e;for(const t of this.renderedHoverParts)t.dispose();(e=this.disposables)==null||e.dispose()}}const Uw=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};var hwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},L$=function(n,e){return function(t,i){e(t,i,n)}};let _N=class{constructor(e){this._editorWorkerService=e}async provideDocumentColors(e,t){return this._editorWorkerService.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,i){const s=t.range,o=t.color,r=o.alpha,a=new se(new ae(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),r)),l=r?se.Format.CSS.formatRGBA(a):se.Format.CSS.formatRGB(a),c=r?se.Format.CSS.formatHSLA(a):se.Format.CSS.formatHSL(a),d=r?se.Format.CSS.formatHexA(a):se.Format.CSS.formatHex(a),h=[];return h.push({label:l,textEdit:{range:s,text:l}}),h.push({label:c,textEdit:{range:s,text:c}}),h.push({label:d,textEdit:{range:s,text:d}}),h}};_N=hwe([L$(0,Qr)],_N);let k$=class extends G{constructor(e,t){super(),this._register(e.colorProvider.register("*",new _N(t)))}};k$=hwe([L$(0,De),L$(1,Qr)],k$);async function uwe(n,e,t,i="auto"){return xX(new ctt,n,e,t,i)}function fwe(n,e,t,i){return Promise.resolve(t.provideColorPresentations(n,e,i))}class ctt{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({colorInfo:r,provider:e});return Array.isArray(o)}}class dtt{constructor(){}async compute(e,t,i,s){const o=await e.provideDocumentColors(t,i);if(Array.isArray(o))for(const r of o)s.push({range:r.range,color:[r.color.red,r.color.green,r.color.blue,r.color.alpha]});return Array.isArray(o)}}class htt{constructor(e){this.colorInfo=e}async compute(e,t,i,s){const o=await e.provideColorPresentations(t,this.colorInfo,wt.None);return Array.isArray(o)&&s.push(...o),Array.isArray(o)}}async function xX(n,e,t,i,s){let o=!1,r;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const d=l[c];if(s!=="always"&&d instanceof _N)r=d;else try{await n.compute(d,t,i,a)&&(o=!0)}catch(h){On(h)}}return o?a:r&&s!=="never"?(await n.compute(r,t,i,a),a):[]}function gwe(n,e){const{colorProvider:t}=n.get(De),i=n.get(Ui).getModel(e);if(!i)throw ql();const s=n.get(lt).getValue("editor.defaultColorDecorators",{resource:e});return{model:i,colorProviderRegistry:t,defaultColorDecoratorsEnablement:s}}var utt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X9=function(n,e){return function(t,i){e(t,i,n)}},I$;const pwe=Object.create({});var Pm;let NS=(Pm=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new ne),this._decorationsIds=[],this._colorDatas=new Map,this._decoratorLimitReporter=this._register(new ftt),this._colorDecorationClassRefs=this._register(new ne),this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=this._register(new BA(this._editor)),this._debounceInformation=s.for(i.colorProvider,"Document Colors",{min:I$.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(i.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const r=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167);const a=r!==this._isColorDecoratorsEnabled||o.hasChanged(27),l=o.hasChanged(167);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._defaultColorDecoratorsEnablement=this._editor.getOption(167),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&typeof i=="object"){const s=i.colorDecorators;if(s&&s.enable!==void 0&&!s.enable)return s.enable}return this._editor.getOption(26)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new ya,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=rs(async e=>{const t=this._editor.getModel();if(!t)return[];const i=new Ls(!1),s=await uwe(this._languageFeaturesService.colorProvider,t,e,this._defaultColorDecoratorsEnablement);return this._debounceInformation.update(t,i.elapsed()),s});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){Je(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(i=>({range:{startLineNumber:i.colorInfo.range.startLineNumber,startColumn:i.colorInfo.range.startColumn,endLineNumber:i.colorInfo.range.endLineNumber,endColumn:i.colorInfo.range.endColumn},options:st.EMPTY}));this._editor.changeDecorations(i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((s,o)=>this._colorDatas.set(s,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(27);for(let o=0;othis._colorDatas.has(s.id));return i.length===0?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}},I$=Pm,Pm.ID="editor.contrib.colorDetector",Pm.RECOMPUTE_TIME=1e3,Pm);NS=I$=utt([X9(1,lt),X9(2,De),X9(3,hc)],NS);class ftt extends G{constructor(){super(...arguments),this._onDidChange=this._register(new q),this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}const mwe="editor.action.showHover",gtt="editor.action.showDefinitionPreviewHover",ptt="editor.action.hideHover",mtt="editor.action.scrollUpHover",_tt="editor.action.scrollDownHover",btt="editor.action.scrollLeftHover",vtt="editor.action.scrollRightHover",wtt="editor.action.pageUpHover",Ctt="editor.action.pageDownHover",ytt="editor.action.goToTopHover",Stt="editor.action.goToBottomHover",q3="editor.action.increaseHoverVerbosityLevel",xtt=_(1102,"Increase Hover Verbosity Level"),K3="editor.action.decreaseHoverVerbosityLevel",Ltt=_(1103,"Decrease Hover Verbosity Level"),bN="editor.action.inlineSuggest.commit",_we="editor.action.inlineSuggest.showPrevious",bwe="editor.action.inlineSuggest.showNext",ktt="editor.action.inlineSuggest.jump",vwe="editor.action.inlineSuggest.hide",E$="editor.action.inlineSuggest.toggleShowCollapsed";var LX=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Fc=function(n,e){return function(t,i){e(t,i,n)}},iM;let N$=class extends G{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=qt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).showToolbar==="always"),this.sessionPosition=void 0,this.position=oe(this,s=>{var l,c;const o=(l=this.model.read(s))==null?void 0:l.primaryGhostText.read(s);if(!this.alwaysShowToolbar.read(s)||!o||o.parts.length===0)return this.sessionPosition=void 0,null;const r=o.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==o.lineNumber&&(this.sessionPosition=void 0);const a=new U(o.lineNumber,Math.min(r,((c=this.sessionPosition)==null?void 0:c.column)??Number.MAX_SAFE_INTEGER));return this.sessionPosition=a,a}),this._register(ko((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=oe(c=>{const d=c.store.add(this.instantiationService.createInstance(DS.hot.read(c),this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.activeCommands,r.warning,()=>{}));return e.addContentWidget(d),c.store.add(Re(()=>e.removeContentWidget(d))),c.store.add(qe(h=>{this.position.read(h)&&r.lastTriggerKind.read(h)!==Pr.Explicit&&r.triggerExplicitly()})),d}),l=Hg(this,(c,d)=>!!this.position.read(c)||!!d);o.add(qe(c=>{l.read(c)&&a.read(c)}))}))}};N$=LX([Fc(2,Ae)],N$);const Itt=Ri("inline-suggestion-hints-next",de.chevronRight,_(1207,"Icon for show next parameter hint.")),Ett=Ri("inline-suggestion-hints-previous",de.chevronLeft,_(1208,"Icon for show previous parameter hint."));var iu;let DS=(iu=class extends G{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new ol(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=_(1209,"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._warning=a,this._relayout=l,this._commandService=c,this.keybindingService=h,this._contextKeyService=u,this._menuService=f,this.id=`InlineSuggestionHintsContentWidget${iM.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._warningMessageContentNode=oe(g=>{const p=this._warning.read(g);return p?typeof p.message=="string"?p.message:g.store.add(ID(p.message)).element:void 0}),this._warningMessageNode=ht.div({class:"warningMessage",style:{maxWidth:400,margin:4,marginBottom:4,display:oe(g=>this._warning.read(g)?"block":"none")}},[this._warningMessageContentNode]).keepUpdated(this._store),this.nodes=Ot("div.inlineSuggestionsHints",{className:this.withBorder?"monaco-hover monaco-hover-content":""},[this._warningMessageNode.element,Ot("div@toolBar")]),this.previousAction=this._register(this.createCommandAction(_we,_(1210,"Previous"),$e.asClassName(Ett))),this.availableSuggestionCountAction=this._register(new ol("inlineSuggestionHints.availableSuggestionCount","",void 0,!1)),this.nextAction=this._register(this.createCommandAction(bwe,_(1211,"Next"),$e.asClassName(Itt))),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(Te.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new ai(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new ai(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this._register(qe(g=>{this._warningMessageContentNode.read(g),this._warningMessageNode.readEffect(g),this._relayout()})),this.toolBar=this._register(d.createInstance(D$,this.nodes.toolBar,Te.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:g=>g.startsWith("primary")},actionViewItemProvider:(g,p)=>{if(g instanceof rl)return d.createInstance(Dtt,g,void 0);if(g===this.availableSuggestionCountAction){const m=new Ntt(void 0,g,{label:!0,icon:!1});return m.setClass("availableSuggestionCount"),m}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(g=>{iM._dropDownVisible=g})),this._register(qe(g=>{this._position.read(g),this.editor.layoutContentWidget(this)})),this._register(qe(g=>{const p=this._suggestionCount.read(g),m=this._currentSuggestionIdx.read(g);p!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${m+1}/${p}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),p!==void 0&&p>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(qe(g=>{const m=this._extraCommands.read(g).map(b=>({class:void 0,id:b.command.id,enabled:!0,tooltip:b.command.tooltip||"",label:b.command.title,run:v=>this._commandService.executeCommand(b.command.id)}));for(const[b,v]of this.inlineCompletionsActionsMenus.getActions())for(const w of v)w instanceof rl&&m.push(w);m.length>0&&m.unshift(new Zn),this.toolBar.setAdditionalSecondaryActions(m)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}},iM=iu,iu.hot=j3(iu),iu._dropDownVisible=!1,iu.id=0,iu);DS=iM=LX([Fc(8,ki),Fc(9,Ae),Fc(10,Vt),Fc(11,Xe),Fc(12,lc)],DS);class Ntt extends xS{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}class Dtt extends l_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService,!0);if(!e)return super.updateLabel();if(this.label){const t=Ot("div.keybinding").root;this._register(new cx(t,ua,{disableTitle:!0,...wGe})).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}}let D$=class extends YP{constructor(e,t,i,s,o,r,a,l,c){super(e,{resetMenu:t,...i},s,o,r,a,l,c),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this.additionalPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var i,s,o,r,a,l,c;const{primary:e,secondary:t}=sve(this.menu.getActions((i=this.options2)==null?void 0:i.menuOptions),(o=(s=this.options2)==null?void 0:s.toolbarOptions)==null?void 0:o.primaryGroup,(a=(r=this.options2)==null?void 0:r.toolbarOptions)==null?void 0:a.shouldInlineSubmenu,(c=(l=this.options2)==null?void 0:l.toolbarOptions)==null?void 0:c.useSeparatorsInPrimaryActions);t.push(...this.additionalActions),e.unshift(...this.prependedPrimaryActions),e.push(...this.additionalPrimaryActions),this.setActions(e,t)}setPrependedPrimaryActions(e){Fi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Fi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};D$=LX([Fc(3,lc),Fc(4,Xe),Fc(5,gl),Fc(6,Vt),Fc(7,ki),Fc(8,To)],D$);function G3(n,e,t){const i=dn(n);return!(ei.left+i.width||ti.top+i.height)}class Ttt{constructor(e,t,i,s){this.value=e,this.isComplete=t,this.hasLoadingMessage=i,this.options=s}}class wwe extends G{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._asyncComputationScheduler=this._register(new Q9(i=>this._triggerAsyncComputation(i),0)),this._syncComputationScheduler=this._register(new Q9(i=>this._triggerSyncComputation(i),0)),this._loadingMessageScheduler=this._register(new Q9(i=>this._triggerLoadingMessage(i),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._options=void 0,super.dispose()}get _hoverTime(){return this._editor.getOption(69).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t){this._options=t,this._state=e,this._fireResult(t)}_triggerAsyncComputation(e){this._setState(2,e),this._syncComputationScheduler.schedule(e,this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=lOe(t=>this._computer.computeAsync(e,t)),(async()=>{try{for await(const t of this._asyncIterable)t&&(this._result.push(t),this._fireResult(e));this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0,e)}catch(t){Je(t)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(e){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync(e))),this._setState(this._asyncIterableDone?0:3,e)}_triggerLoadingMessage(e){this._state===3&&this._setState(4,e)}_fireResult(e){if(this._state===1||this._state===2)return;const t=this._state===0,i=this._state===4;this._onResult.fire(new Ttt(this._result.slice(0),t,i,e))}start(e,t){if(e===0)this._state===0&&(this._setState(1,t),this._asyncComputationScheduler.schedule(t,this._firstWaitTime),this._loadingMessageScheduler.schedule(t,this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(t),this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break;case 2:this._syncComputationScheduler.cancel(),this._triggerSyncComputation(t);break}}cancel(){this._asyncComputationScheduler.cancel(),this._syncComputationScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._options=void 0,this._state=0}get options(){return this._options}}class Q9 extends G{constructor(e,t){super(),this._scheduler=this._register(new ai(()=>e(this._options),t))}schedule(e,t){this._options=e,this._scheduler.schedule(t)}cancel(){this._scheduler.cancel()}}class kX{get onDidWillResize(){return this._onDidWillResize.event}get onDidResize(){return this._onDidResize.event}constructor(){this._onDidWillResize=new q,this._onDidResize=new q,this._sashListener=new ne,this._size=new Jt(0,0),this._minSize=new Jt(0,0),this._maxSize=new Jt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new _o(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new _o(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new _o(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:EP.North}),this._southSash=new _o(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:EP.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,i=0;this._sashListener.add(ve.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)})),this._sashListener.add(ve.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,i=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(s=>{e&&(i=s.currentX-s.startX,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(s=>{e&&(i=-(s.currentX-s.startX),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(s=>{e&&(t=-(s.currentY-s.startY),this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ve.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ve.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,i,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Jt(t,e);Jt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const Rtt=30,Mtt=24;class Att extends G{constructor(e,t=new Jt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new kX),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Jt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Jt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return(e=this._contentPosition)!=null&&e.position?U.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:dn(t).top+i.top-Rtt}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=dn(t),o=Jm(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-Mtt}_findPositionPreference(e,t){const i=Math.min(this._availableVerticalSpaceBelow(t)??1/0,e),s=Math.min(this._availableVerticalSpaceAbove(t)??1/0,e),o=Math.min(Math.max(s,i),e),r=Math.min(e,o);let a;return this._editor.getOption(69).above?a=r<=s?1:2:a=r<=i?2:1,a===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),a}_resize(e){this._resizableNode.layout(e.height,e.width)}}var Ptt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},E2=function(n,e){return function(t,i){e(t,i,n)}},kc;const wae=30;var Om;let T$=(Om=class extends Att{get isVisibleFromKeyboard(){var e;return((e=this._renderedHover)==null?void 0:e.source)===2}get isVisible(){return this._hoverVisibleKey.get()??!1}get isFocused(){return this._hoverFocusedKey.get()??!1}constructor(e,t,i,s,o){const r=e.getOption(75)+8,a=150,l=new Jt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new uZ(!0)),this._onDidResize=this._register(new q),this.onDidResize=this._onDidResize.event,this._onDidScroll=this._register(new q),this.onDidScroll=this._onDidScroll.event,this._onContentsChanged=this._register(new q),this.onContentsChanged=this._onContentsChanged.event,this._minimumSize=l,this._hoverVisibleKey=H.hoverVisible.bindTo(t),this._hoverFocusedKey=H.hoverFocused.bindTo(t),he(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._resizableNode.domNode.className="monaco-resizable-hover",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(59)&&this._updateFont()}));const c=this._register(tc(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._register(this._hover.scrollbar.onScroll(d=>{this._onDidScroll.fire(d)})),this._setRenderedHover(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._renderedHover)==null||e.dispose(),this._editor.removeContentWidget(this)}getId(){return kc.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return kc._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return kc._applyDimensions(i,e,t)}_setScrollableElementDimensions(e,t){const i=this._hover.scrollbar.getDomNode();return kc._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContainerDomNodeDimensions(e,t),this._setScrollableElementDimensions(e,t),this._setContentsDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){kc._applyMaxDimensions(this._hover.contentsDomNode,e,t),kc._applyMaxDimensions(this._hover.scrollbar.getDomNode(),e,t),kc._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none"),this._setHoverWidgetDimensions(e.width,e.height)}_updateResizableNodeMaxDimensions(){const e=this._findMaximumRenderingWidth()??1/0,t=this._findMaximumRenderingHeight()??1/0;this._resizableNode.maxSize=new Jt(e,t),this._setHoverWidgetMaxDimensions(e,t)}_resize(e){kc._lastDimensions=new Jt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),this._onDidResize.fire()}_findAvailableSpaceVertically(){var t;const e=(t=this._renderedHover)==null?void 0:t.showAtPosition;if(e)return this._positionPreference===1?this._availableVerticalSpaceAbove(e):this._availableVerticalSpaceBelow(e)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let i=this._hover.contentsDomNode.children.length-1;return Array.from(this._hover.contentsDomNode.children).forEach(s=>{i+=s.clientHeight}),Math.min(e,i)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth;return e||this._hover.containerDomNode.clientWidththis._renderedHover.closestMouseDistance+4?!1:(this._renderedHover.closestMouseDistance=Math.min(this._renderedHover.closestMouseDistance,s),!0)}_setRenderedHover(e){var t;(t=this._renderedHover)==null||t.dispose(),this._renderedHover=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(59),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,kc._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,750,kc._lastDimensions.width);this._resizableNode.maxSize=new Jt(t,e),this._setHoverWidgetMaxDimensions(t,e)}_render(e){this._setRenderedHover(e),this._updateFont(),this._updateContent(e.domNode),this.handleContentsChanged(),this._editor.render()}getPosition(){return this._renderedHover?{position:this._renderedHover.showAtPosition,secondaryPosition:this._renderedHover.showAtSecondaryPosition,positionAffinity:this._renderedHover.shouldAppearBeforeContent?3:void 0,preference:[this._positionPreference??1]}:null}show(e){var r;if(!this._editor||!this._editor.hasModel())return;this._render(e);const t=zf(this._hover.containerDomNode),i=e.showAtPosition;this._positionPreference=this._findPositionPreference(t,i)??1,this.handleContentsChanged(),e.shouldFocus&&this._hover.containerDomNode.focus(),this._onDidResize.fire();const o=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&J_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),((r=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))==null?void 0:r.getAriaLabel())??"");o&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+o)}hide(){if(!this._renderedHover)return;const e=this._renderedHover.shouldFocus||this._hoverFocusedKey.get();this._setRenderedHover(void 0),this._resizableNode.maxSize=new Jt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto"),this._updateMaxDimensions()}setMinimumDimensions(e){this._minimumSize=new Jt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Jt(e,this._minimumSize.height)}handleContentsChanged(){var s;this._removeConstraintsRenderNormally();const e=this._hover.contentsDomNode;let t=zf(e),i=aa(e)+2;if(this._resizableNode.layout(t,i),this._setHoverWidgetDimensions(i,t),t=zf(e),i=aa(e),this._contentWidth=i,this._updateMinimumWidth(),this._resizableNode.layout(t,i),(s=this._renderedHover)!=null&&s.showAtPosition){const o=zf(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._renderedHover.showAtPosition)}this._layoutContentWidget(),this._onContentsChanged.fire()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(59);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-wae})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+wae})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}},kc=Om,Om.ID="editor.contrib.resizableContentHoverWidget",Om._lastDimensions=new Jt(0,0),Om);T$=kc=Ptt([E2(1,Xe),E2(2,lt),E2(3,Us),E2(4,Vt)],T$);function Cae(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}class rO{constructor(e,t){this._editor=e,this._participants=t}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e,t){const i=e.anchor;if(!this._editor.hasModel()||!i)return Kl.EMPTY;const s=rO._getLineDecorations(this._editor,i);return Kl.merge(this._participants.map(o=>o.computeAsync?o.computeAsync(i,s,e.source,t):Kl.EMPTY))}computeSync(e){if(!this._editor.hasModel())return[];const t=e.anchor,i=rO._getLineDecorations(this._editor,t);let s=[];for(const o of this._participants)s=s.concat(o.computeSync(t,i,e.source));return lh(s)}}class Cwe{constructor(e,t,i){this.hoverParts=e,this.isComplete=t,this.options=i}filter(e){const t=this.hoverParts.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.hoverParts.length?this:new Ott(this,t,this.isComplete,this.options)}}class Ott extends Cwe{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}var Ftt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yae=function(n,e){return function(t,i){e(t,i,n)}};const Sae=me;let aO=class extends G{get hasContent(){return this._hasContent}constructor(e,t){super(),this._keybindingService=e,this._hoverService=t,this.actions=[],this._hasContent=!1,this.hoverElement=Sae("div.hover-row.status-bar"),this.hoverElement.tabIndex=0,this.actionsElement=he(this.hoverElement,Sae("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;this._hasContent=!0;const s=this._register(L3.render(this.actionsElement,e,i));return this._register(this._hoverService.setupManagedHover(Pu("element"),s.actionContainer,s.actionRenderedLabel)),this.actions.push(s),s}append(e){const t=he(this.actionsElement,e);return this._hasContent=!0,t}};aO=Ftt([yae(0,Vt),yae(1,Sr)],aO);const Oo=class Oo{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Oo._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Oo._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new D(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,Oo._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Oo._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=Oo._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,d=Math.max(2,Math.ceil(3/c));let h=e[0].range.startLineNumber,u=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>u&&(u=p.endLineNumber):(o.push({range:new D(h,1,u,1),options:Oo._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),h=p.startLineNumber,u=p.endLineNumber)}o.push({range:new D(h,1,u,1),options:Oo._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Oo._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const i=this._decorations[t],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rD.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function xae(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function Lae(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=ywe([s[a]],r)+t}),o.slice(0,-1)}class kae{constructor(e){this.staticValue=e,this.kind=0}}class Wtt{constructor(e){this.pieces=e,this.kind=1}}class TS{static fromStaticValue(e){return new TS([Ov.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new kae(""):e.length===1&&e[0].staticValue!==null?this._state=new kae(e[0].staticValue):this._state=new Wtt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?ywe(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let h=0,u=a.length;h=c){l.push(a.slice(h));break}switch(r.caseOps[d]){case"U":l.push(a[h].toUpperCase());break;case"u":l.push(a[h].toUpperCase()),d++;break;case"L":l.push(a[h].toLowerCase());break;case"l":l.push(a[h].toLowerCase()),d++;break;default:l.push(a[h])}}a=l.join("")}i+=a}return i}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let i="";for(;e>0;){if(e=s)break;const r=n.charCodeAt(i);switch(r){case 92:t.emitUnchanged(i-1),t.emitStatic("\\",i+1);break;case 110:t.emitUnchanged(i-1),t.emitStatic(` +`,i+1);break;case 116:t.emitUnchanged(i-1),t.emitStatic(" ",i+1);break;case 117:case 85:case 108:case 76:t.emitUnchanged(i-1),t.emitStatic("",i+1),e.push(String.fromCharCode(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1{if(this._editor.hasModel())return this.research(!1)},100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition(i=>{(i.reason===3||i.reason===5||i.reason===6)&&this._decorations.setStartPosition(this._editor.getPosition())})),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent(i=>{this._ignoreModelContentChanged||(i.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())})),this._toDispose.add(this._state.onFindReplaceStateChange(i=>this._onStateChanged(i))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,ei(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){this._isDisposed||this._editor.hasModel()&&(e.searchString||e.isReplaceRevealed||e.isRegex||e.wholeWord||e.matchCase||e.searchScope)&&(this._editor.getModel().isTooLargeForSyncing()?(this._startSearchingTimer.cancel(),this._startSearchingTimer.setIfNotSet(()=>{e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor)},ztt)):e.searchScope?this.research(e.moveCursor,this._state.searchScope):this.research(e.moveCursor))}static _getSearchRange(e,t){return t||e.getFullModelRange()}research(e,t){let i=null;typeof t<"u"?t!==null&&(Array.isArray(t)?i=t:i=[t]):i=this._decorations.getFindScopes(),i!==null&&(i=i.map(a=>{if(a.startLineNumber!==a.endLineNumber){let l=a.endLineNumber;return a.endColumn===1&&(l=l-1),new D(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,rm);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=bE(s.map(l=>l.range),l=>D.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(50).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new U(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new U(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()$k._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=rm?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new hb(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(148):null).parseSearchRequest();if(!t)return;let i=t.regex;if(!i.multiline){let h="mu";i.ignoreCase&&(h+="i"),i.global&&(h+="g"),i=new RegExp(i.source,h)}const s=this._editor.getModel(),o=s.getValue(1),r=s.getFullModelRange(),a=this._getReplacePattern();let l;const c=this._state.preserveCase;a.hasReplacementPatterns||c?l=o.replace(i,function(){return a.buildReplaceString(arguments,c)}):l=o.replace(i,a.buildReplaceString(null,c));const d=new MY(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new Ie(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;o{this._onDidOptionChange.fire(u),!u&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(u=>{this._onPreserveCaseKeyDown.fire(u)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,u=>{if(u.equals(15)||u.equals(17)||u.equals(9)){const f=d.indexOf(this.domNode.ownerDocument.activeElement);if(f>=0){let g=-1;u.equals(17)?g=(f+1)%d.length:u.equals(15)&&(f===0?g=d.length-1:g=f-1),u.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),Ht.stop(u,!0)}}});const h=document.createElement("div");h.className="controls",h.style.display=this._showOptionButtons?"block":"none",h.appendChild(this.preserveCase.domNode),this.domNode.appendChild(h),e==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)==null||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var Swe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xwe=function(n,e){return function(t,i){e(t,i,n)}};const EX=new Se("suggestWidgetVisible",!1,_(1698,"Whether suggestion are visible")),NX="historyNavigationWidgetFocus",Lwe="historyNavigationForwardsEnabled",kwe="historyNavigationBackwardsEnabled";let ug;const A2=[];function Iwe(n,e){if(A2.includes(e))throw new Error("Cannot register the same widget multiple times");A2.push(e);const t=new ne,i=new Se(NX,!1).bindTo(n),s=new Se(Lwe,!0).bindTo(n),o=new Se(kwe,!0).bindTo(n),r=()=>{i.set(!0),ug=e},a=()=>{i.set(!1),ug===e&&(ug=void 0)};return H5(e.element)&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Re(()=>{A2.splice(A2.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let M$=class extends vve{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(Iwe(o,this.inputBox))}};M$=Swe([xwe(3,Xe)],M$);let A$=class extends qtt{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(Iwe(r,this.inputBox))}};A$=Swe([xwe(3,Xe)],A$);As.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:le.and(le.has(NX),le.equals(kwe,!0),le.not("isComposing"),EX.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{ug==null||ug.showPreviousValue()}});As.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:le.and(le.has(NX),le.equals(Lwe,!0),le.not("isComposing"),EX.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{ug==null||ug.showNextValue()}});function Iae(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))==null?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))==null?void 0:t.getElectronAccelerator())==="Down"}const Eae=Ri("find-collapsed",de.chevronRight,_(956,"Icon to indicate that the editor find widget is collapsed.")),Nae=Ri("find-expanded",de.chevronDown,_(957,"Icon to indicate that the editor find widget is expanded.")),Ktt=Ri("find-selection",de.selection,_(958,"Icon for 'Find in Selection' in the editor find widget.")),Gtt=Ri("find-replace",de.replace,_(959,"Icon for 'Replace' in the editor find widget.")),Ytt=Ri("find-replace-all",de.replaceAll,_(960,"Icon for 'Replace All' in the editor find widget.")),Ztt=Ri("find-previous-match",de.arrowUp,_(961,"Icon for 'Find Previous' in the editor find widget.")),Xtt=Ri("find-next-match",de.arrowDown,_(962,"Icon for 'Find Next' in the editor find widget.")),Qtt=_(963,"Find / Replace"),Jtt=_(964,"Find"),eit=_(965,"Find"),tit=_(966,"Previous Match"),iit=_(967,"Next Match"),nit=_(968,"Find in Selection"),sit=_(969,"Close"),oit=_(970,"Replace"),rit=_(971,"Replace"),ait=_(972,"Replace"),lit=_(973,"Replace All"),cit=_(974,"Toggle Replace"),dit=_(975,"Only the first {0} results are highlighted, but all find operations work on the entire text.",rm),hit=_(976,"{0} of {1}"),Dae=_(977,"No results"),xh=419,uit=275,fit=uit-54;let hL=69;const git=33,Tae=yt?256:2048;class J9{constructor(e){this.afterLineNumber=e,this.heightInPx=git,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function Rae(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function Mae(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._updateHistoryDelayer.cancel())),this._register(this._state.onFindReplaceStateChange(d=>this._onStateChanged(d))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration(d=>{if(d.hasChanged(104)&&(this._codeEditor.getOption(104)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(165)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(50)){const h=this._codeEditor.getOption(50).loop;this._state.change({loop:h},!1);const u=this._codeEditor.getOption(50).addExtraSpaceOnTop;u&&!this._viewZone&&(this._viewZone=new J9(0),this._showViewZone()),!u&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(async()=>{if(this._isVisible){const d=await this._controller.getGlobalBufferTerm();d&&d!==this._state.searchString&&(this._state.change({searchString:d},!1),this._findInput.select())}})),this._findInputFocused=Y3.bindTo(r),this._findFocusTracker=this._register(tc(this._findInput.inputBox.inputElement)),this._register(this._findFocusTracker.onDidFocus(()=>{this._findInputFocused.set(!0),this._updateSearchScope()})),this._register(this._findFocusTracker.onDidBlur(()=>{this._findInputFocused.set(!1)})),this._replaceInputFocused=IX.bindTo(r),this._replaceFocusTracker=this._register(tc(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(50).addExtraSpaceOnTop&&(this._viewZone=new J9(0)),this._register(this._codeEditor.onDidChangeModel(()=>{this._isVisible&&(this._viewZoneId=void 0)})),this._register(this._codeEditor.onDidScrollChange(d=>{if(d.scrollTopChanged){this._layoutViewZone();return}setTimeout(()=>{this._layoutViewZone()},0)}))}getId(){return fF.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}:null}_onStateChanged(e){if(e.searchString){try{this._ignoreChangeEvent=!0,this._findInput.setValue(this._state.searchString)}finally{this._ignoreChangeEvent=!1}this._updateButtons()}if(e.replaceString&&(this._replaceInput.inputBox.value=this._state.replaceString),e.isRevealed&&(this._state.isRevealed?this._reveal():this._hide(!0)),e.isReplaceRevealed&&(this._state.isReplaceRevealed?!this._codeEditor.getOption(104)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=aa(this._findInput.domNode),this._updateButtons(),this._replaceInput.inputBox.layout()):this._isReplaceVisible&&(this._isReplaceVisible=!1,this._updateButtons())),(e.isRevealed||e.isReplaceRevealed)&&(this._state.isRevealed||this._state.isReplaceRevealed)&&this._tryUpdateHeight()&&this._showViewZone(),e.isRegex&&this._findInput.setRegex(this._state.isRegex),e.wholeWord&&this._findInput.setWholeWords(this._state.wholeWord),e.matchCase&&this._findInput.setCaseSensitive(this._state.matchCase),e.preserveCase&&this._replaceInput.setPreserveCase(this._state.preserveCase),e.searchScope&&(this._state.searchScope?this._toggleSelectionFind.checked=!0:this._toggleSelectionFind.checked=!1,this._updateToggleSelectionFindButton()),e.searchString||e.matchesCount||e.matchesPosition){const t=this._state.searchString.length>0&&this._state.matchesCount===0;this._domNode.classList.toggle("no-results",t),this._updateMatchesCount(),this._updateButtons()}(e.searchString||e.currentMatch)&&this._layoutViewZone(),e.updateHistory&&this._delayedUpdateHistory(),e.loop&&this._updateButtons()}_delayedUpdateHistory(){this._updateHistoryDelayer.trigger(this._updateHistory.bind(this)).then(void 0,Je)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){var t;this._matchesCount.style.minWidth=hL+"px",this._state.matchesCount>=rm?this._matchesCount.title=dit:this._matchesCount.title="",(t=this._matchesCount.firstChild)==null||t.remove();let e;if(this._state.matchesCount>0){let i=String(this._state.matchesCount);this._state.matchesCount>=rm&&(i+="+");let s=String(this._state.matchesPosition);s==="0"&&(s="?"),e=Z1(hit,s,i)}else e=Dae;this._matchesCount.appendChild(document.createTextNode(e)),vr(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),hL=Math.max(hL,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===Dae)return i===""?_(978,"{0} found",e):_(979,"{0} found for '{1}'",e,i);if(t){const s=_(980,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),o=this._codeEditor.getModel();return o&&t.startLineNumber<=o.getLineCount()&&t.startLineNumber>=1?`${o.getLineContent(t.startLineNumber)}, ${s}`:s}return _(981,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=e?e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn:!1,i=this._toggleSelectionFind.checked;this._isVisible&&(i||t)?this._toggleSelectionFind.enable():this._toggleSelectionFind.disable()}_updateButtons(){this._findInput.setEnabled(this._isVisible),this._replaceInput.setEnabled(this._isVisible&&this._isReplaceVisible),this._updateToggleSelectionFindButton(),this._closeBtn.setEnabled(this._isVisible);const e=this._state.searchString.length>0,t=!!this._state.matchesCount;this._prevBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateBack()),this._nextBtn.setEnabled(this._isVisible&&e&&t&&this._state.canNavigateForward()),this._replaceBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._replaceAllBtn.setEnabled(this._isVisible&&this._isReplaceVisible&&e),this._domNode.classList.toggle("replaceToggled",this._isReplaceVisible),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);const i=!this._codeEditor.getOption(104);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(50).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(50).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=dn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=Jge(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(50).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(50).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new J9(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(96).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.addZone(i),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+o)}})}_removeViewZone(){this._codeEditor.changeViewZones(e=>{this._viewZoneId!==void 0&&(e.removeZone(this._viewZoneId),this._viewZoneId=void 0,this._viewZone&&(this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()-this._viewZone.heightInPx),this._viewZone=void 0))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!this._domNode.isConnected)return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0){this._domNode.classList.add("hiddenEditor");return}else this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const i=e.width,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&aa(this._domNode)>xh){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=aa(this._findInput.domNode);return}if(xh+28+s>=i&&(r=!0),xh+28+s-hL>=i&&(a=!0),xh+28+s-hL>=i+50&&(o=!0),this._domNode.classList.toggle("collapsed-find-widget",o),this._domNode.classList.toggle("narrow-find-widget",a),this._domNode.classList.toggle("reduced-find-widget",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=aa(this._findInput.domNode))}_getHeight(){let e=0;return e+=4,e+=this._findInput.inputBox.height+2,this._isReplaceVisible&&(e+=4,e+=this._replaceInput.inputBox.height+2),e+=4,e}_tryUpdateHeight(){const e=this._getHeight();return this._cachedHeight!==null&&this._cachedHeight===e?!1:(this._cachedHeight=e,this._domNode.style.height=`${e}px`,!0)}focusFindInput(){this._findInput.select(),this._findInput.focus()}focusReplaceInput(){this._replaceInput.select(),this._replaceInput.focus()}highlightFindOptions(){this._findInput.highlightFindOptions()}_updateSearchScope(){if(this._codeEditor.hasModel()&&this._toggleSelectionFind.checked){const e=this._codeEditor.getSelections();e.map(t=>{t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(t.endLineNumber-1)));const i=this._state.currentMatch;return t.startLineNumber!==t.endLineNumber&&!D.equalsRange(t,i)?t:null}).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){if(e.equals(Tae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._findInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Rae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return Mae(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(Tae|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{this._replaceInput.inputBox.insertAtCursor(` +`),e.preventDefault();return}if(e.equals(2)){this._findInput.focusOnCaseSensitive(),e.preventDefault();return}if(e.equals(1026)){this._findInput.focus(),e.preventDefault();return}if(e.equals(2066)){this._codeEditor.focus(),e.preventDefault();return}if(e.equals(16))return Rae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return Mae(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"))}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const i=this._codeEditor.getOption(50).history,s=this._codeEditor.getOption(50).replaceHistory;this._findInput=this._register(new M$(null,this._contextViewProvider,{width:fit,label:Jtt,placeholder:eit,appendCaseSensitiveLabel:this._keybindingLabelFor(Si.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Si.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Si.ToggleRegexCommand),validation:h=>{if(h.length===0||!this._findInput.getRegex())return null;try{return new RegExp(h,"gu"),null}catch(u){return{content:u.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>Iae(this._keybindingService),inputBoxStyles:yP,toggleStyles:CP,history:i==="workspace"?this._findWidgetSearchHistory:new Set([])},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(h=>{h.equals(3)&&!this._codeEditor.getOption(50).findOnType&&this._state.change({searchString:this._findInput.getValue()},!0),this._onFindInputKeyDown(h)})),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||!this._codeEditor.getOption(50).findOnType||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(h=>{h.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),h.preventDefault())})),this._register(this._findInput.onRegexKeyDown(h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),h.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(h=>{this._tryUpdateHeight()&&this._showViewZone()})),Ur&&this._register(this._findInput.onMouseDown(h=>this._onFindInputMouseDown(h))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount();const o={groupId:"find-widget"};this._prevBtn=this._register(new _b({label:tit+this._keybindingLabelFor(Si.PreviousMatchFindAction),icon:Ztt,hoverLifecycleOptions:o,onTrigger:()=>{qp(this._codeEditor.getAction(Si.PreviousMatchFindAction)).run().then(void 0,Je)}},this._hoverService)),this._nextBtn=this._register(new _b({label:iit+this._keybindingLabelFor(Si.NextMatchFindAction),icon:Xtt,hoverLifecycleOptions:o,onTrigger:()=>{qp(this._codeEditor.getAction(Si.NextMatchFindAction)).run().then(void 0,Je)}},this._hoverService));const r=document.createElement("div");r.className="find-part",r.appendChild(this._findInput.domNode);const a=document.createElement("div");a.className="find-actions",r.appendChild(a),a.appendChild(this._matchesCount),a.appendChild(this._prevBtn.domNode),a.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new Ug({icon:Ktt,title:nit+this._keybindingLabelFor(Si.ToggleSearchScopeCommand),isChecked:!1,hoverLifecycleOptions:o,inputActiveOptionBackground:ge(nx),inputActiveOptionBorder:ge(mD),inputActiveOptionForeground:ge(_D)})),this._register(this._toggleSelectionFind.onChange(()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){let h=this._codeEditor.getSelections();h=h.map(u=>(u.endColumn===1&&u.endLineNumber>u.startLineNumber&&(u=u.setEndPosition(u.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(u.endLineNumber-1))),u.isEmpty()?null:u)).filter(u=>!!u),h.length&&this._state.change({searchScope:h},!0)}}else this._state.change({searchScope:null},!0)})),a.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new _b({label:sit+this._keybindingLabelFor(Si.CloseFindWidgetCommand),icon:Yve,hoverLifecycleOptions:o,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:h=>{h.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),h.preventDefault())}},this._hoverService)),this._replaceInput=this._register(new A$(null,void 0,{label:oit,placeholder:rit,appendPreserveCaseLabel:this._keybindingLabelFor(Si.TogglePreserveCaseCommand),history:s==="workspace"?this._replaceWidgetHistory:new Set([]),flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>Iae(this._keybindingService),inputBoxStyles:yP,toggleStyles:CP,hoverLifecycleOptions:o},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown(h=>this._onReplaceInputKeyDown(h))),this._register(this._replaceInput.inputBox.onDidChange(()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)})),this._register(this._replaceInput.inputBox.onDidHeightChange(h=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()})),this._register(this._replaceInput.onDidOptionChange(()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)})),this._register(this._replaceInput.onPreserveCaseKeyDown(h=>{h.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),h.preventDefault())})),this._replaceBtn=this._register(new _b({label:ait+this._keybindingLabelFor(Si.ReplaceOneAction),icon:Gtt,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replace()},onKeyDown:h=>{h.equals(1026)&&(this._closeBtn.focus(),h.preventDefault())}},this._hoverService)),this._replaceAllBtn=this._register(new _b({label:lit+this._keybindingLabelFor(Si.ReplaceAllAction),icon:Ytt,hoverLifecycleOptions:o,onTrigger:()=>{this._controller.replaceAll()}},this._hoverService));const l=document.createElement("div");l.className="replace-part",l.appendChild(this._replaceInput.domNode);const c=document.createElement("div");c.className="replace-actions",l.appendChild(c),c.appendChild(this._replaceBtn.domNode),c.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new _b({label:cit,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=aa(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}},this._hoverService)),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=Qtt,this._domNode.role="dialog",this._domNode.style.width=`${xh}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(r),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(l),this._resizeSash=this._register(new _o(this._domNode,this,{orientation:0,size:2})),this._resized=!1;let d=xh;this._register(this._resizeSash.onDidStart(()=>{d=aa(this._domNode)})),this._register(this._resizeSash.onDidChange(h=>{this._resized=!0;const u=d+h.startX-h.currentX;if(uf||(this._domNode.style.width=`${u}px`,this._isReplaceVisible&&(this._replaceInput.width=aa(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const h=aa(this._domNode);if(hthis._codeEditor.getScrollTop()),{widgetViewZoneVisible:e,scrollTop:this._codeEditor.getScrollTop()}}setViewState(e){e&&e.widgetViewZoneVisible&&this._layoutViewZone(e.scrollTop)}};fF.ID="editor.contrib.findWidget";let P$=fF;class _b extends Da{constructor(e,t){super(),this._opts=e;let i="button";this._opts.className&&(i=i+" "+this._opts.className),this._opts.icon&&(i=i+" "+$e.asClassName(this._opts.icon)),this._domNode=document.createElement("div"),this._domNode.tabIndex=0,this._domNode.className=i,this._domNode.setAttribute("role","button"),this._domNode.setAttribute("aria-label",this._opts.label),this._register(t.setupDelayedHover(this._domNode,{content:this._opts.label,style:1},e.hoverLifecycleOptions)),this.onclick(this._domNode,s=>{this._opts.onTrigger(),s.preventDefault()}),this.onkeydown(this._domNode,s=>{var o,r;if(s.equals(10)||s.equals(3)){this._opts.onTrigger(),s.preventDefault();return}(r=(o=this._opts).onKeyDown)==null||r.call(o,s)})}get domNode(){return this._domNode}isEnabled(){return this._domNode.tabIndex>=0}focus(){this._domNode.focus()}setEnabled(e){this._domNode.classList.toggle("disabled",!e),this._domNode.setAttribute("aria-disabled",String(!e)),this._domNode.tabIndex=e?0:-1}setExpanded(e){this._domNode.setAttribute("aria-expanded",String(!!e)),e?(this._domNode.classList.remove(...$e.asClassNameArray(Eae)),this._domNode.classList.add(...$e.asClassNameArray(Nae))):(this._domNode.classList.remove(...$e.asClassNameArray(Nae)),this._domNode.classList.add(...$e.asClassNameArray(Eae)))}}dc((n,e)=>{const t=n.getColor(Xp);t&&e.addRule(`.monaco-editor .findMatch { border: 1px ${Gd(n.type)?"dotted":"solid"} ${t}; box-sizing: border-box; }`);const i=n.getColor(p8e);i&&e.addRule(`.monaco-editor .findScope { border: 1px ${Gd(n.type)?"dashed":"solid"} ${i}; }`);const s=n.getColor(Tt);s&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${s}; }`);const o=n.getColor(f8e);o&&e.addRule(`.monaco-editor .findMatchInline { color: ${o}; }`);const r=n.getColor(g8e);r&&e.addRule(`.monaco-editor .currentFindMatchInline { color: ${r}; }`)});var pit=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Aae=function(n,e){return function(t,i){e(t,i,n)}};let O$=class extends G{constructor(e,t,i,s){super(),this._container=e,this._getContent=t,this._clipboardService=i,this._hoverService=s,this._container.classList.add("hover-row-with-copy"),this._button=this._register(new _b({label:_(1128,"Copy"),icon:de.copy,onTrigger:()=>this._copyContent(),className:"hover-copy-button"},this._hoverService)),this._container.appendChild(this._button.domNode)}async _copyContent(){const e=this._getContent();e&&(await this._clipboardService.writeText(e),Jd(_(1129,"Copied to clipboard")))}};O$=pit([Aae(2,La),Aae(3,Sr)],O$);class mit{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}async function _it(n,e,t,i,s){const o=await Promise.resolve(n.provideHover(t,i,s)).catch(On);if(!(!o||!bit(o)))return new mit(n,o,e)}function DX(n,e,t,i,s=!1){const r=n.ordered(e,s).map((a,l)=>_it(a,l,e,t,i));return Kl.fromPromisesResolveOrder(r).coalesce()}async function Ewe(n,e,t,i,s=!1){const o=[];for await(const r of DX(n,e,t,i,s))o.push(r.hover);return o}Xr("_executeHoverProvider",(n,e,t)=>{const i=n.get(De);return Ewe(i.hoverProvider,e,t,wt.None)});Xr("_executeHoverProvider_recursive",(n,e,t)=>{const i=n.get(De);return Ewe(i.hoverProvider,e,t,wt.None,!0)});function bit(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var vit=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wC=function(n,e){return function(t,i){e(t,i,n)}};const mv=me,wit=Ri("hover-increase-verbosity",de.add,_(1130,"Icon for increaseing hover verbosity.")),Cit=Ri("hover-decrease-verbosity",de.remove,_(1131,"Icon for decreasing hover verbosity."));class Bc{constructor(e,t,i,s,o,r=void 0){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o,this.source=r}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}class Nwe{constructor(e,t,i){this.hover=e,this.hoverProvider=t,this.hoverPosition=i}supportsVerbosityAction(e){switch(e){case la.Increase:return this.hover.canIncreaseVerbosity??!1;case la.Decrease:return this.hover.canDecreaseVerbosity??!1}}}let vN=class{constructor(e,t,i,s,o,r,a){this._editor=e,this._markdownRendererService=t,this._configurationService=i,this._languageFeaturesService=s,this._keybindingService=o,this._hoverService=r,this._commandService=a,this.hoverOrdinal=3}createLoadingMessage(e){return new Bc(this,e.range,[new Co().appendText(_(1132,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(133),h=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let u=!1;d>=0&&l>d&&e.range.startColumn>=d&&(u=!0,r.push(new Bc(this,e.range,[{value:_(1133,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!u&&typeof h=="number"&&l>=h&&r.push(new Bc(this,e.range,[{value:_(1134,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,m=g.range.endLineNumber===s?g.range.endColumn:o,b=g.options.hoverMessage;if(!b||yS(b))continue;g.options.beforeContentClassName&&(f=!0);const v=new D(e.range.startLineNumber,p,e.range.startLineNumber,m);r.push(new Bc(this,v,CG(b),f,a++))}return r}computeAsync(e,t,i,s){if(!this._editor.hasModel()||e.type!==1)return Kl.EMPTY;const o=this._editor.getModel(),r=this._languageFeaturesService.hoverProvider;return r.has(o)?this._getMarkdownHovers(r,o,e,s):Kl.EMPTY}async*_getMarkdownHovers(e,t,i,s){const o=i.range.getStartPosition(),r=DX(e,t,o,s);for await(const a of r)if(!yS(a.hover.contents)){const l=a.hover.range?D.lift(a.hover.range):i.range,c=new Nwe(a.hover,a.provider,o);yield new Bc(this,l,a.hover.contents,!1,a.ordinal,c)}}renderHoverParts(e,t){return this._renderedHoverParts=new yit(t,e.fragment,this,this._editor,this._commandService,this._keybindingService,this._hoverService,this._configurationService,this._markdownRendererService,e.onContentsChanged),this._renderedHoverParts}handleScroll(e){var t;(t=this._renderedHoverParts)==null||t.handleScroll(e)}getAccessibleContent(e){var t;return((t=this._renderedHoverParts)==null?void 0:t.getAccessibleContent(e))??""}updateMarkdownHoverVerbosityLevel(e,t){var i;return Promise.resolve((i=this._renderedHoverParts)==null?void 0:i.updateMarkdownHoverPartVerbosityLevel(e,t))}};vN=vit([wC(1,ed),wC(2,lt),wC(3,De),wC(4,Vt),wC(5,Sr),wC(6,ki)],vN);class P2{constructor(e,t,i,s){this.hoverPart=e,this.hoverElement=t,this.disposables=i,this.actionsContainer=s}dispose(){this.disposables.dispose()}}class yit{constructor(e,t,i,s,o,r,a,l,c,d){this._hoverParticipant=i,this._editor=s,this._commandService=o,this._keybindingService=r,this._hoverService=a,this._configurationService=l,this._markdownRendererService=c,this._onFinishedRendering=d,this._ongoingHoverOperations=new Map,this._disposables=new ne,this.renderedHoverParts=this._renderHoverParts(e,t,this._onFinishedRendering),this._disposables.add(Re(()=>{this.renderedHoverParts.forEach(h=>{h.dispose()}),this._ongoingHoverOperations.forEach(h=>{h.tokenSource.dispose(!0)})}))}_renderHoverParts(e,t,i){return e.sort(co(s=>s.ordinal,ma)),e.map(s=>{const o=this._renderHoverPart(s,i);return t.appendChild(o.hoverElement),o})}_renderHoverPart(e,t){const i=this._renderMarkdownHover(e,t),s=i.hoverElement,o=e.source,r=new ne;if(r.add(i),!o)return new P2(e,s,r);const a=o.supportsVerbosityAction(la.Increase),l=o.supportsVerbosityAction(la.Decrease);if(!a&&!l)return new P2(e,s,r);const c=mv("div.verbosity-actions");s.prepend(c);const d=mv("div.verbosity-actions-inner");return c.append(d),r.add(this._renderHoverExpansionAction(d,la.Increase,a)),r.add(this._renderHoverExpansionAction(d,la.Decrease,l)),new P2(e,s,r,d)}_renderMarkdownHover(e,t){return Dwe(this._editor,e,this._markdownRendererService,t)}_renderHoverExpansionAction(e,t,i){const s=new ne,o=t===la.Increase,r=he(e,mv($e.asCSSSelector(o?wit:Cit)));r.tabIndex=0;const a=new CS("mouse",void 0,{target:e,position:{hoverPosition:0}},this._configurationService,this._hoverService);if(s.add(this._hoverService.setupManagedHover(a,r,xit(this._keybindingService,t))),!i)return r.classList.add("disabled"),s;r.classList.add("enabled");const l=()=>this._commandService.executeCommand(t===la.Increase?q3:K3,{focus:!0});return s.add(new ebe(r,l)),s.add(new tbe(r,l,[3,10])),s}handleScroll(e){this.renderedHoverParts.forEach(t=>{const i=t.actionsContainer;if(!i)return;const s=t.hoverElement,r=e.scrollTop+e.height,a=s.offsetTop,l=s.clientHeight,c=a+l,d=22;let h;c<=r||a>=r?h=l-d:h=r-a-d,i.style.top=`${h}px`})}async updateMarkdownHoverPartVerbosityLevel(e,t){const i=this._editor.getModel();if(!i)return;const s=this._getRenderedHoverPartAtIndex(t),o=s==null?void 0:s.hoverPart.source;if(!s||!(o!=null&&o.supportsVerbosityAction(e)))return;const r=await this._fetchHover(o,i,e);if(!r)return;const a=new Nwe(r,o.hoverProvider,o.hoverPosition),l=s.hoverPart,c=new Bc(this._hoverParticipant,l.range,r.contents,l.isBeforeContent,l.ordinal,a),d=this._updateRenderedHoverPart(t,c);if(d)return{hoverPart:c,hoverElement:d.hoverElement}}getAccessibleContent(e){const t=this.renderedHoverParts.findIndex(r=>r.hoverPart===e);if(t===-1)return;const i=this._getRenderedHoverPartAtIndex(t);return i?i.hoverElement.innerText.replace(/[^\S\n\r]+/gu," "):void 0}async _fetchHover(e,t,i){let s=i===la.Increase?1:-1;const o=e.hoverProvider,r=this._ongoingHoverOperations.get(o);r&&(r.tokenSource.cancel(),s+=r.verbosityDelta);const a=new Bi;this._ongoingHoverOperations.set(o,{verbosityDelta:s,tokenSource:a});const l={verbosityRequest:{verbosityDelta:s,previousHover:e.hover}};let c;try{c=await Promise.resolve(o.provideHover(t,e.hoverPosition,a.token,l))}catch(d){On(d)}return a.dispose(),this._ongoingHoverOperations.delete(o),c}_updateRenderedHoverPart(e,t){if(e>=this.renderedHoverParts.length||e<0)return;const i=this._renderHoverPart(t,this._onFinishedRendering),s=this.renderedHoverParts[e],o=s.hoverElement,r=i.hoverElement,a=Array.from(r.children);o.replaceChildren(...a);const l=new P2(t,o,i.disposables,i.actionsContainer);return s.dispose(),this.renderedHoverParts[e]=l,l}_getRenderedHoverPartAtIndex(e){return this.renderedHoverParts[e]}dispose(){this._disposables.dispose()}}function Sit(n,e,t,i){e.sort(co(o=>o.ordinal,ma));const s=[];for(const o of e){const r=Dwe(t,o,i,n.onContentsChanged);n.fragment.appendChild(r.hoverElement),s.push(r)}return new Cw(s)}function Dwe(n,e,t,i){const s=new ne,o=mv("div.hover-row"),r=mv("div.hover-row-contents");o.appendChild(r);const a=e.contents;for(const c of a){if(yS(c))continue;const d=mv("div.markdown-hover"),h=he(d,mv("div.hover-contents")),u=s.add(t.render(c,{context:n,asyncRenderCallback:()=>{h.className="hover-contents code-hover-contents",i()}}));h.appendChild(u.element),r.appendChild(d)}return{hoverPart:e,hoverElement:o,dispose(){s.dispose()}}}function xit(n,e){switch(e){case la.Increase:{const t=n.lookupKeybinding(q3);return t?_(1135,"Increase Hover Verbosity ({0})",t.getLabel()):_(1136,"Increase Hover Verbosity")}case la.Decrease:{const t=n.lookupKeybinding(K3);return t?_(1137,"Decrease Hover Verbosity ({0})",t.getLabel()):_(1138,"Decrease Hover Verbosity")}}}const Pae=me;class Lit extends G{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._domNode=Pae(".saturation-wrap"),he(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",he(this._domNode,this._canvas),this.selection=Pae(".saturation-selection"),he(this._domNode,this.selection),this.layout(),this._register(J(this._domNode,_e.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new tx);const t=dn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,s=>this.onDidChangePosition(s.pageX-t.left,s.pageY-t.top),()=>null);const i=J(e.target.ownerDocument,_e.POINTER_UP,()=>{this._onColorFlushed.fire(),i.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const i=Math.max(0,Math.min(1,e/this.width)),s=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(i,s),this._onDidChange.fire({s:i,v:s})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new se(new ru(e.h,1,1,1)),i=this._canvas.getContext("2d"),s=i.createLinearGradient(0,0,this._canvas.width,0);s.addColorStop(0,"rgba(255, 255, 255, 1)"),s.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),s.addColorStop(1,"rgba(255, 255, 255, 0)");const o=i.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=se.Format.CSS.format(t),i.fill(),i.fillStyle=s,i.fill(),i.fillStyle=o,i.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class kit extends G{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=he(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(J(this._button,_e.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}const uL=me;class Twe extends G{constructor(e,t,i){super(),this.model=t,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,i==="standalone"?(this.domNode=he(e,uL(".standalone-strip")),this.overlay=he(this.domNode,uL(".standalone-overlay"))):(this.domNode=he(e,uL(".strip")),this.overlay=he(this.domNode,uL(".overlay"))),this.slider=he(this.domNode,uL(".slider")),this.slider.style.top="0px",this._register(J(this.domNode,_e.POINTER_DOWN,s=>this.onPointerDown(s))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new tx),i=dn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-i.top),()=>null);const s=J(e.target.ownerDocument,_e.POINTER_UP,()=>{this._onColorFlushed.fire(),s.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class Iit extends Twe{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:i,b:s}=e.rgba,o=new se(new ae(t,i,s,1)),r=new se(new ae(t,i,s,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${r} 100%)`}getValue(e){return e.hsva.a}}class Eit extends Twe{constructor(e,t,i){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}const Nit=me;class Dit extends G{constructor(e,t,i,s){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=Nit(".colorpicker-body"),he(e,this._domNode),this._saturationBox=new Lit(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Iit(this._domNode,this.model,s),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Eit(this._domNode,this.model,s),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),s==="standalone"&&(this._insertButton=this._register(new kit(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const i=this.model.color.hsva;this.model.color=new se(new ru(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new se(new ru(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=(1-e)*360;this.model.color=new se(new ru(i===360?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}const Tit=me;class Rit extends G{constructor(e){super(),this._onClicked=this._register(new q),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),he(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),he(this._button,t),he(t,Tit(".button"+$e.asCSSSelector(Ri("color-picker-close",de.close,_(885,"Icon to close the color picker"))))).classList.add("close-icon"),this._register(J(this._button,_e.CLICK,()=>{this._onClicked.fire()}))}}const O2=me;class Mit extends G{constructor(e,t,i,s){super(),this.model=t,this.type=s,this._closeButton=null,this._domNode=O2(".colorpicker-header"),he(e,this._domNode),this._pickedColorNode=he(this._domNode,O2(".picked-color")),he(this._pickedColorNode,O2("span.codicon.codicon-color-mode")),this._pickedColorPresentation=he(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const o=_(886,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",o),this._originalColorNode=he(this._domNode,O2(".original-color")),this._originalColorNode.style.backgroundColor=se.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(OA)||se.white,this._register(i.onDidColorThemeChange(r=>{this.backgroundColor=r.getColor(OA)||se.white})),this._register(J(this._pickedColorNode,_e.CLICK,()=>this.model.selectNextColorPresentation())),this._register(J(this._originalColorNode,_e.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=se.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.type==="standalone"&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Rit(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=se.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}const Ait=me;class Rwe extends Da{constructor(e,t,i,s,o){super(),this.model=t,this.pixelRatio=i,this._register(gE.getInstance(Pe(e)).onDidChange(()=>this.layout())),this._domNode=Ait(".colorpicker-widget"),e.appendChild(this._domNode),this.header=this._register(new Mit(this._domNode,this.model,s,o)),this.body=this._register(new Dit(this._domNode,this.model,this.pixelRatio,o))}layout(){this.body.layout()}get domNode(){return this._domNode}}class Pit{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,i){this.presentationIndex=i,this._onColorFlushed=new q,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new q,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new q,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let i=-1;for(let s=0;s=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Fit=function(n,e){return function(t,i){e(t,i,n)}};class lO{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}static fromBaseColor(e,t){return new lO(e,t.range,t.model,t.provider)}}let cO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t,i){return[]}computeAsync(e,t,i,s){return Kl.fromPromise(this._computeAsync(e,t,i))}async _computeAsync(e,t,i){if(!this._editor.hasModel())return[];if(!this._isValidRequest(i))return[];const s=NS.get(this._editor);if(!s)return[];for(const o of t){if(!s.isColorDecoration(o))continue;const r=s.getColorData(o.range.getStartPosition());if(r)return[lO.fromBaseColor(this,await Mwe(this._editor.getModel(),r.colorInfo,r.provider))]}return[]}_isValidRequest(e){const t=this._editor.getOption(168);switch(e){case 0:return t==="hover"||t==="clickAndHover";case 1:return t==="click"||t==="clickAndHover";case 2:return!0}}renderHoverParts(e,t){const i=this._editor;if(t.length===0||!i.hasModel())return new Cw([]);const s=i.getOption(75)+8;e.setMinimumDimensions(new Jt(302,s));const o=new ne,r=t[0],a=i.getModel(),l=r.model;this._colorPicker=o.add(new Rwe(e.fragment,l,i.getOption(163),this._themeService,"hover"));let c=!1,d=new D(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);o.add(l.onColorFlushed(async u=>{await wN(a,l,u,d,r),c=!0,d=Awe(i,d,l)})),o.add(l.onDidChangeColor(u=>{wN(a,l,u,d,r)})),o.add(i.onDidChangeModelContent(u=>{c?c=!1:(e.hide(),i.focus())}));const h={hoverPart:lO.fromBaseColor(this,r),hoverElement:this._colorPicker.domNode,dispose(){o.dispose()}};return new Cw([h])}getAccessibleContent(e){return _(887,"There is a color picker here.")}handleResize(){var e;(e=this._colorPicker)==null||e.layout()}handleContentsChanged(){var e;(e=this._colorPicker)==null||e.layout()}handleHide(){var e;(e=this._colorPicker)==null||e.dispose(),this._colorPicker=void 0}isColorPickerVisible(){return!!this._colorPicker}};cO=Oit([Fit(1,en)],cO);function F$(n,e){return!!n[e]}class e6{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.mouseMiddleClickAction=t.mouseMiddleClickAction,this.hasTriggerModifier=F$(e.event,t.triggerModifier),this.isMiddleClick&&t.mouseMiddleClickAction==="ctrlLeftClick"&&(this.isMiddleClick=!1,this.isLeftClick=!0,this.hasTriggerModifier=!0),this.hasSideBySideModifier=F$(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Oae{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=F$(e,t.triggerModifier)}}class F2{constructor(e,t,i,s,o){this.mouseMiddleClickAction=o,this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=i,this.triggerSideBySideModifier=s}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier&&this.mouseMiddleClickAction===e.mouseMiddleClickAction}}function Fae(n,e){return n==="altKey"?yt?new F2(57,"metaKey",6,"altKey",e):new F2(5,"ctrlKey",6,"altKey",e):yt?new F2(6,"altKey",57,"metaKey",e):new F2(6,"altKey",5,"ctrlKey",e)}class Z3 extends G{constructor(e,t){super(),this._onMouseMoveOrRelevantKeyDown=this._register(new q),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new q),this.onExecute=this._onExecute.event,this._onCancel=this._register(new q),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(t==null?void 0:t.extractLineNumberFromMouseEvent)??(i=>i.target.position?i.target.position.lineNumber:0),this._opts=Fae(this._editor.getOption(86),this._editor.getOption(87)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(i=>{if(i.hasChanged(86)||i.hasChanged(87)){const s=Fae(this._editor.getOption(86),this._editor.getOption(87));if(this._opts.equals(s))return;this._opts=s,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(i=>this._onEditorMouseMove(new e6(i,this._opts)))),this._register(this._editor.onMouseDown(i=>this._onEditorMouseDown(new e6(i,this._opts)))),this._register(this._editor.onMouseUp(i=>this._onEditorMouseUp(new e6(i,this._opts)))),this._register(this._editor.onKeyDown(i=>this._onEditorKeyDown(new Oae(i,this._opts)))),this._register(this._editor.onKeyUp(i=>this._onEditorKeyUp(new Oae(i,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(i=>this._onDidChangeCursorSelection(i))),this._register(this._editor.onDidChangeModel(i=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(i=>{(i.scrollTopChanged||i.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);!!this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&(this._hasTriggerKeyOnMouseDown||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink")&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}class Pwe{constructor(e,t){this.range=e,this.direction=t}}class TX{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new TX(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}async resolve(e){if(typeof this.provider.resolveInlayHint=="function"){if(this._currentResolve)return await this._currentResolve,e.isCancellationRequested?void 0:this.resolve(e);this._isResolved||(this._currentResolve=this._doResolve(e).finally(()=>this._currentResolve=void 0)),await this._currentResolve}}async _doResolve(e){try{const t=await Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=(t==null?void 0:t.tooltip)??this.hint.tooltip,this.hint.label=(t==null?void 0:t.label)??this.hint.label,this.hint.textEdits=(t==null?void 0:t.textEdits)??this.hint.textEdits,this._isResolved=!0}catch(t){On(t),this._isResolved=!1}}}const H0=class H0{static async create(e,t,i,s){const o=[],r=e.ordered(t).reverse().map(a=>i.map(async l=>{try{const c=await a.provideInlayHints(t,l,s);(c!=null&&c.hints.length||a.onDidChangeInlayHints)&&o.push([c??H0._emptyInlayHintList,a])}catch(c){On(c)}}));if(await Promise.all(r.flat()),s.isCancellationRequested||t.isDisposed())throw new Ql;return new H0(i,o,t)}constructor(e,t,i){this._disposables=new ne,this.ranges=e,this.provider=new Set;const s=[];for(const[o,r]of t){this._disposables.add(o),this.provider.add(r);for(const a of o.hints){const l=i.validatePosition(a.position);let c="before";const d=H0._getRangeAtPosition(i,l);let h;d.getStartPosition().isBefore(l)?(h=D.fromPositions(d.getStartPosition(),l),c="after"):(h=D.fromPositions(l,d.getEndPosition()),c="before"),s.push(new TX(a,new Pwe(h,c),r))}}this.items=s.sort((o,r)=>U.compare(o.hint.position,r.hint.position))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,s=e.getWordAtPosition(t);if(s)return new D(i,s.startColumn,i,s.endColumn);e.tokenization.tokenizeIfCheap(i);const o=e.tokenization.getLineTokens(i),r=t.column-1,a=o.findTokenIndexAtOffset(r);let l=o.getStartOffset(a),c=o.getEndOffset(a);return c-l===1&&(l===r&&a>1?(l=o.getStartOffset(a-1),c=o.getEndOffset(a-1)):c===r&&a=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qu=function(n,e){return function(t,i){e(t,i,n)}};let Pg=class extends ow{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){super(e,{...s.getRawOptions(),overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()},i,o,r,a,l,c,d,h,u,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){D5(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Pg=Wit([Qu(4,Ae),Qu(5,Bt),Qu(6,ki),Qu(7,Xe),Qu(8,en),Qu(9,fn),Qu(10,Us),Qu(11,qi),Qu(12,De)],Pg);function Owe(n){const e=n.get(Bt).getFocusedCodeEditor();return e instanceof Pg?e.getParentEditor():e}const Bae=new se(new ae(0,122,204)),Hit={showArrow:!0,showFrame:!0,className:"",frameColor:Bae,arrowColor:Bae,keepEditorSelection:!1},Vit="vs.editor.contrib.zoneWidget";class zit{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class jit{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}const gF=class gF{constructor(e){this._editor=e,this._ruleName=gF._IdGenerator.nextId(),this._color=null,this._height=-1,this._decorations=this._editor.createDecorationsCollection()}dispose(){this.hide(),KH(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){KH(this._ruleName),AA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px !important; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:D.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};gF._IdGenerator=new wZ(".arrow-decoration-");let B$=gF;class $it{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._isSashResizeHeight=!1,this._viewZone=null,this._disposables=new ne,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=$h(t),D5(this.options,Hit,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(i=>{const s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new B$(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)==null||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=D.isIRange(e)?D.lift(e):D.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:st.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)==null||e.hide(),this._positionMarkerId.clear(),this._isSashResizeHeight=!1}_decoratingElementsHeight(){const e=this.editor.getOption(75);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=this.options.frameWidth??Math.round(e/9);t+=2*i}return t}_getMaximumHeightInLines(){return Math.max(12,this.editor.getLayoutInfo().height/this.editor.getOption(75)*.8)}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(75),l=this._getMaximumHeightInLines();l!==void 0&&(t=Math.min(t,l));let c=0,d=0;if(this._arrow&&this.options.showArrow&&(c=Math.round(a/3),this._arrow.height=c,this._arrow.show(i)),this.options.showFrame&&(d=Math.round(a/9)),this.editor.changeViewZones(f=>{this._viewZone&&f.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new zit(r,i.lineNumber,i.column,t,g=>this._onViewZoneTop(g),g=>this._onViewZoneHeight(g),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=f.addZone(this._viewZone),this._overlayWidget=new jit(Vit+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this._updateSashEnablement(),this.container&&this.options.showFrame){const f=this.options.frameWidth?this.options.frameWidth:d;this.container.style.borderTopWidth=f+"px",this.container.style.borderBottomWidth=f+"px"}const h=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=c+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const f=u.validateRange(new D(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(f,f.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e,t){const i=this._getMaximumHeightInLines(),s=t&&i!==void 0?Math.min(i,e):e;this._viewZone&&this._viewZone.heightInLines!==s&&(this.editor.changeViewZones(o=>{this._viewZone&&(this._viewZone.heightInLines=s,o.layoutZone(this._viewZone.id))}),this._updateSashEnablement())}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new _o(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines,...this._getResizeBounds()})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(75),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;o>e.minLines&&o=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Bwe=function(n,e){return function(t,i){e(t,i,n)}};const Wwe=mt("IPeekViewService");Lt(Wwe,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var Yr;(function(n){n.inPeekEditor=new Se("inReferenceSearchEditor",!0,_(1316,"Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(Yr||(Yr={}));var Ny;let hO=(Ny=class{constructor(e,t){e instanceof Pg&&Yr.inPeekEditor.bindTo(t)}dispose(){}},Ny.ID="editor.contrib.referenceController",Ny);hO=Fwe([Bwe(1,Xe)],hO);At(hO.ID,hO,0);const Uit={headerBackgroundColor:se.white,primaryHeadingColor:se.fromHex("#333333"),secondaryHeadingColor:se.fromHex("#6c6c6cb3")};let uO=class extends $it{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,D5(this.options,Uit,!1);const s=$i(this.editor);s.openedPeekWidgets.set(s.openedPeekWidgets.get()+1,void 0)}dispose(){if(!this.disposed){this.disposed=!0,super.dispose(),this._onDidClose.fire(this);const e=$i(this.editor);e.openedPeekWidgets.set(e.openedPeekWidgets.get()-1,void 0)}}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=me(".head"),this._bodyElement=me(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=me(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),kn(this._titleElement,"click",o=>this._onTitleClick(o))),he(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=me("span.filename"),this._secondaryHeading=me("span.dirname"),this._metaHeading=me("span.meta"),he(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=me(".peekview-actions");he(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new jr(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(this._disposables.add(new ol("peekview.close",_(1317,"Close"),$e.asClassName(de.close),!0,()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:MZ.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:js(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,ca(this._metaHeading)):cr(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(75)*1.2),s=Math.round(e-(i+1));this._doLayoutHead(i,t),this._doLayoutBody(s,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};uO=Fwe([Bwe(2,Ae)],uO);const qit=F("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:se.black,hcLight:se.white},_(1318,"Background color of the peek view title area.")),Hwe=F("peekViewTitleLabel.foreground",{dark:se.white,light:se.black,hcDark:se.white,hcLight:Mu},_(1319,"Color of the peek view title.")),Vwe=F("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},_(1320,"Color of the peek view title info.")),Kit=F("peekView.border",{dark:yu,light:yu,hcDark:Tt,hcLight:Tt},_(1321,"Color of the peek view borders and arrow.")),Git=F("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:se.black,hcLight:se.white},_(1322,"Background color of the peek view result list."));F("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:se.white,hcLight:Mu},_(1323,"Foreground color for line nodes in the peek view result list."));F("peekViewResult.fileForeground",{dark:se.white,light:"#1E1E1E",hcDark:se.white,hcLight:Mu},_(1324,"Foreground color for file nodes in the peek view result list."));F("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},_(1325,"Background color of the selected entry in the peek view result list."));F("peekViewResult.selectionForeground",{dark:se.white,light:"#6C6C6C",hcDark:se.white,hcLight:Mu},_(1326,"Foreground color of the selected entry in the peek view result list."));const RX=F("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:se.black,hcLight:se.white},_(1327,"Background color of the peek view editor."));F("peekViewEditorGutter.background",RX,_(1328,"Background color of the gutter in the peek view editor."));F("peekViewEditorStickyScroll.background",RX,_(1329,"Background color of sticky scroll in the peek view editor."));F("peekViewEditorStickyScrollGutter.background",RX,_(1330,"Background color of the gutter part of sticky scroll in the peek view editor."));F("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},_(1331,"Match highlight color in the peek view result list."));F("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},_(1332,"Match highlight color in the peek view editor."));F("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Hi,hcLight:Hi},_(1333,"Match highlight border in the peek view editor."));class Og{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=oz.nextId()}get uri(){return this.link.uri}get range(){return this._range??this.link.targetSelectionRange??this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var t;const e=(t=this.parent.getPreview(this))==null?void 0:t.preview(this.range);return e?_(1088,"{0} in {1} on line {2} at column {3}",e.value,ic(this.uri),this.range.startLineNumber,this.range.startColumn):_(1087,"in {0} on line {1} at column {2}",ic(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Yit{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new D(s,l.startColumn,s,o),d=new D(r,a,r,1073741824),h=i.getValueInRange(c).replace(/^\s+/,""),u=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:h+u+f,highlight:{start:h.length,end:h.length+u.length}}}}class RS{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new En}dispose(){ei(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?_(1089,"1 symbol in {0}, full path {1}",ic(this.uri),this.uri.fsPath):_(1090,"{0} symbols in {1}, full path {2}",e,ic(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const i=await e.createModelReference(t.uri);this._previews.set(t.uri,new Yit(i))}catch(i){Je(i)}return this}}class va{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new q,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(va._compareReferences);let s;for(const o of e)if((!s||!Wi.isEqual(s.uri,o.uri,!0))&&(s=new RS(this,o.uri),this.groups.push(s)),s.children.length===0||va._compareReferences(o,s.children[s.children.length-1])!==0){const r=new Og(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){ei(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new va(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?_(1091,"No results found"):this.references.length===1?_(1092,"Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?_(1093,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):_(1094,"Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:Gc(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.offsetDist?1:0)[0];if(i)return this.references[i.idx]}referenceAt(e,t){for(const i of this.references)if(i.uri.toString()===e.toString()&&D.containsPosition(i.range,t))return i}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Wi.compare(e.uri,t.uri)||D.compareRangesUsingStarts(e.range,t.range)}}var X3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q3=function(n,e){return function(t,i){e(t,i,n)}},W$;let H$=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof va||e instanceof RS}getChildren(e){if(e instanceof va)return e.groups;if(e instanceof RS)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};H$=X3([Q3(0,Qo)],H$);class Zit{getHeight(){return 23}getTemplateId(e){return e instanceof RS?fO.id:gO.id}}let V$=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Og){const i=(t=e.parent.getPreview(e))==null?void 0:t.preview(e.range);if(i)return i.value}return ic(e.uri)}};V$=X3([Q3(0,Vt)],V$);class Xit{getId(e){return e instanceof Og?e.id:e.uri}}let z$=class extends G{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new tN(i,{supportHighlights:!0})),this.badge=this._register(new Zz(he(i,me(".count")),{},ive)),e.appendChild(i)}set(e,t){const i=X5(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(i,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(_(1081,"{0} references",s)):this.badge.setTitleFormat(_(1082,"{0} reference",s))}};z$=X3([Q3(1,lw)],z$);var Jv;let fO=(Jv=class{constructor(e){this._instantiationService=e,this.templateId=W$.id}renderTemplate(e){return this._instantiationService.createInstance(z$,e)}renderElement(e,t,i){i.set(e.element,xD(e.filterData))}disposeTemplate(e){e.dispose()}},W$=Jv,Jv.id="FileReferencesRenderer",Jv);fO=W$=X3([Q3(0,Ae)],fO);class Qit extends G{constructor(e){super(),this.label=this._register(new Im(e))}set(e,t){var s;const i=(s=e.parent.getPreview(e))==null?void 0:s.preview(e.range);if(!i||!i.value)this.label.set(`${ic(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=i;t&&!$c.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,xD(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}const pF=class pF{constructor(){this.templateId=pF.id}renderTemplate(e){return new Qit(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(e){e.dispose()}};pF.id="OneReferenceRenderer";let gO=pF;class Jit{getWidgetAriaLabel(){return _(1083,"References")}getAriaLabel(e){return e.ariaMessage}}var zwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bb=function(n,e){return function(t,i){e(t,i,n)}};const mF=class mF{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new ne,this._callOnModelChange=new ne,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],i=[];for(let s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;rthis.labelService.getUriBasenameLabel(i.uri)).join(", ")}onDragStart(e,t){if(!t.dataTransfer)return;const s=e.elements.map(o=>this.getDragURI(o)).filter(Boolean);s.length&&(t.dataTransfer.setData(cw.RESOURCES,JSON.stringify(s)),t.dataTransfer.setData(cw.TEXT,s.join(` +`)))}onDragOver(){return!1}drop(){}dispose(){this.disposables.dispose()}};$$=zwe([bb(0,lw)],$$);let U$=class extends uO{constructor(e,t,i,s,o,r,a,l,c){super(e,{showFrame:!1,showArrow:!0,isResizeable:!0,isAccessible:!0,supportOnTitleClick:!0},r),this._defaultTreeKeyboardSupport=t,this.layoutData=i,this._textModelResolverService=o,this._instantiationService=r,this._peekViewService=a,this._uriLabel=l,this._keybindingService=c,this._disposeOnNewModel=new ne,this._callOnDispose=new ne,this._onDidSelectReference=new q,this.onDidSelectReference=this._onDidSelectReference.event,this._dim=new Jt(0,0),this._isClosing=!1,this._applyTheme(s.getColorTheme()),this._callOnDispose.add(s.onDidColorThemeChange(this._applyTheme.bind(this))),this._peekViewService.addExclusiveWidget(e,this),this.create()}get isClosing(){return this._isClosing}dispose(){this._isClosing=!0,this.setModel(void 0),this._callOnDispose.dispose(),this._disposeOnNewModel.dispose(),ei(this._preview),ei(this._previewNotAvailableMessage),ei(this._tree),ei(this._previewModelReference),this._splitView.dispose(),super.dispose()}_applyTheme(e){const t=e.getColor(Kit)||se.transparent;this.style({arrowColor:t,frameColor:t,headerBackgroundColor:e.getColor(qit)||se.transparent,primaryHeadingColor:e.getColor(Hwe),secondaryHeadingColor:e.getColor(Vwe)})}show(e){super.show(e,this.layoutData.heightInLines||18)}focusOnReferenceTree(){this._tree.domFocus()}focusOnPreviewEditor(){this._preview.focus()}isPreviewEditorFocused(){return this._preview.hasTextFocus()}_onTitleClick(e){this._preview&&this._preview.getModel()&&this._onDidSelectReference.fire({element:this._getFocusedReference(),kind:e.ctrlKey||e.metaKey||e.altKey?"side":"open",source:"title"})}_fillBody(e){this.setCssClass("reference-zone-widget"),this._messageContainer=he(e,me("div.messages")),cr(this._messageContainer),this._splitView=new Lve(e,{orientation:1}),this._previewContainer=he(e,me("div.preview.inline"));const t={scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:14,horizontal:"auto",useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,alwaysConsumeMouseWheel:!0},overviewRulerLanes:2,fixedOverflowWidgets:!0,minimap:{enabled:!1}};this._preview=this._instantiationService.createInstance(Pg,this._previewContainer,t,{},this.editor),cr(this._previewContainer),this._previewNotAvailableMessage=this._instantiationService.createInstance(sw,_(1084,"no preview available"),al,sw.DEFAULT_CREATION_OPTIONS,null),this._treeContainer=he(e,me("div.ref-tree.inline"));const i={keyboardSupport:this._defaultTreeKeyboardSupport,accessibilityProvider:new Jit,keyboardNavigationLabelProvider:this._instantiationService.createInstance(V$),identityProvider:new Xit,openOnSingleClick:!0,selectionNavigation:!0,overrideStyles:{listBackground:Git},dnd:this._instantiationService.createInstance($$)};this._defaultTreeKeyboardSupport&&this._callOnDispose.add(kn(this._treeContainer,"keydown",o=>{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(tnt,"ReferencesWidget",this._treeContainer,new Zit,[this._instantiationService.createInstance(fO),this._instantiationService.createInstance(gO)],this._instantiationService.createInstance(H$),i),this._splitView.addView({onDidChange:ve.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},DP.Distribute),this._splitView.addView({onDidChange:ve.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},DP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof Og&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._disposables.add(this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")})),cr(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Jt(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=_(1085,"No results"),ca(this._messageContainer),Promise.resolve(void 0)):(cr(this._messageContainer),this._decorationsManager=new j$(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:i}=e;if(t.detail!==2)return;const s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),ca(this._treeContainer),ca(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof Og)return e;if(e instanceof RS&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==Ge.inMemory?this.setTitle(U4e(e.uri),this._uriLabel.getUriLabel(X5(e.uri))):this.setTitle(_(1086,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const s=await i;if(!this._model){s.dispose();return}ei(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=D.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()}};U$=zwe([bb(3,en),bb(4,Qo),bb(5,Ae),bb(6,Wwe),bb(7,lw),bb(8,Vt)],U$);var int=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},CC=function(n,e){return function(t,i){e(t,i,n)}},nM;const qw=new Se("referenceSearchVisible",!1,_(1078,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));var e1;let yw=(e1=class{static get(e){return e.getContribution(nM.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new ne,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=qw.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)==null||e.dispose(),(t=this._model)==null||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))return;this._peekMode=i,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",r=ent.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(U$,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(_(1079,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget?(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget.isClosing||this.closeWidget(),this._widget=void 0):this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:d}=l;if(c)switch(d){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":i?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)==null||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(_(1080,"{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,h=new U(e.startLineNumber,e.startColumn),u=this._model.nearestReference(d,h);if(u)return this._widget.setSelection(u).then(()=>{this._widget&&this._editor.getOption(99)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const i=this._model.nearestReference(this._editor.getModel().uri,t);if(!i)return;const s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();await this._widget.setSelection(s),await this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,i;(t=this._widget)==null||t.dispose(),(i=this._model)==null||i.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var s;(s=this._widget)==null||s.hide(),this._ignoreModelChangeEvent=!0;const i=D.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:i,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(i),this._widget.focusOnReferenceTree();else{const r=nM.get(o),a=this._model.clone();this.closeWidget(),o.focus(),r==null||r.toggleWidget(i,rs(l=>Promise.resolve(a)),this._peekMode??!1)}},o=>{this._ignoreModelChangeEvent=!1,Je(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}},nM=e1,e1.ID="editor.contrib.referencesController",e1);yw=nM=int([CC(2,Xe),CC(3,Bt),CC(4,fn),CC(5,Ae),CC(6,Jo),CC(7,lt)],yw);function Kw(n,e){const t=Owe(n);if(!t)return;const i=yw.get(t);i&&e(i)}As.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Fn(2089,60),when:le.or(qw,Yr.inPeekEditor),handler(n){Kw(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});As.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:le.or(qw,Yr.inPeekEditor),handler(n){Kw(n,e=>{e.goToNextOrPreviousReference(!0)})}});As.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:le.or(qw,Yr.inPeekEditor),handler(n){Kw(n,e=>{e.goToNextOrPreviousReference(!1)})}});Rt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Rt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Rt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Rt.registerCommand("closeReferenceSearch",n=>Kw(n,e=>e.closeWidget()));As.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:le.and(Yr.inPeekEditor,le.not("config.editor.stablePeek"))});As.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:le.and(qw,le.not("config.editor.stablePeek"),le.or(H.editorTextFocus,$Z.negate()))});As.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:le.and(qw,Pve,GZ.negate(),YZ.negate()),handler(n){var i;const t=(i=n.get(uc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Kw(n,s=>s.revealReference(t[0]))}});As.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:le.and(qw,Pve,GZ.negate(),YZ.negate()),handler(n){var i;const t=(i=n.get(uc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Kw(n,s=>s.openReference(t[0],!0,!0))}});Rt.registerCommand("openReference",n=>{var i;const t=(i=n.get(uc).lastFocusedList)==null?void 0:i.getFocus();Array.isArray(t)&&t[0]instanceof Og&&Kw(n,s=>s.openReference(t[0],!1,!0))});var jwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},BL=function(n,e){return function(t,i){e(t,i,n)}};const MX=new Se("hasSymbols",!1,_(1095,"Whether there are symbol locations that can be navigated via keyboard-only.")),J3=mt("ISymbolNavigationService");let q$=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=MX.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)==null||e.dispose(),(t=this._currentMessage)==null||t.close(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new K$(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const h of t.references)if(t_(h.uri,a.uri))c=!0,d=d||D.containsPosition(h.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=Vc(i,s)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:D.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var i;(i=this._currentMessage)==null||i.close();const e=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),t=e?_(1096,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,e.getLabel()):_(1097,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(t)}};q$=jwe([BL(0,Xe),BL(1,Bt),BL(2,fn),BL(3,Vt)],q$);Lt(J3,q$,1);ye(new class extends hs{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:MX,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(J3).revealNext(e)}});As.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:MX,primary:9,handler(n){n.get(J3).reset()}});let K$=class{constructor(e){this._listener=new Map,this._disposables=new ne,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),ei(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Vc(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))==null||t.dispose(),this._listener.delete(e)}};K$=jwe([BL(0,Bt)],K$);function G$(n,e){return e.uri.scheme===n.uri.scheme?!0:!uH(e.uri,Ge.walkThroughSnippet,Ge.vscodeChatCodeBlock,Ge.vscodeChatCodeCompareBlock)}async function WD(n,e,t,i,s){const r=t.ordered(n,i).map(l=>Promise.resolve(s(l,n,e)).then(void 0,c=>{On(c)})),a=await Promise.all(r);return lh(a.flat()).filter(l=>G$(n,l))}function HD(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideDefinition(r,a,s))}function AX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideDeclaration(r,a,s))}function PX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideImplementation(r,a,s))}function OX(n,e,t,i,s){return WD(e,t,n,i,(o,r,a)=>o.provideTypeDefinition(r,a,s))}function VD(n,e,t,i,s,o){return WD(e,t,n,s,async(r,a,l)=>{var h,u;const c=(h=await r.provideReferences(a,l,{includeDeclaration:!0},o))==null?void 0:h.filter(f=>G$(a,f));if(!i||!c||c.length!==2)return c;const d=(u=await r.provideReferences(a,l,{includeDeclaration:!1},o))==null?void 0:u.filter(f=>G$(a,f));return d&&d.length===1?d:c})}async function Bu(n){const e=await n(),t=new va(e,""),i=t.references.map(s=>s.link);return t.dispose(),i}Xr("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(De),s=HD(i.definitionProvider,e,t,!1,wt.None);return Bu(()=>s)});Xr("_executeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(De),s=HD(i.definitionProvider,e,t,!0,wt.None);return Bu(()=>s)});Xr("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(De),s=OX(i.typeDefinitionProvider,e,t,!1,wt.None);return Bu(()=>s)});Xr("_executeTypeDefinitionProvider_recursive",(n,e,t)=>{const i=n.get(De),s=OX(i.typeDefinitionProvider,e,t,!0,wt.None);return Bu(()=>s)});Xr("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(De),s=AX(i.declarationProvider,e,t,!1,wt.None);return Bu(()=>s)});Xr("_executeDeclarationProvider_recursive",(n,e,t)=>{const i=n.get(De),s=AX(i.declarationProvider,e,t,!0,wt.None);return Bu(()=>s)});Xr("_executeReferenceProvider",(n,e,t)=>{const i=n.get(De),s=VD(i.referenceProvider,e,t,!1,!1,wt.None);return Bu(()=>s)});Xr("_executeReferenceProvider_recursive",(n,e,t)=>{const i=n.get(De),s=VD(i.referenceProvider,e,t,!1,!0,wt.None);return Bu(()=>s)});Xr("_executeImplementationProvider",(n,e,t)=>{const i=n.get(De),s=PX(i.implementationProvider,e,t,!1,wt.None);return Bu(()=>s)});Xr("_executeImplementationProvider_recursive",(n,e,t)=>{const i=n.get(De),s=PX(i.implementationProvider,e,t,!0,wt.None);return Bu(()=>s)});Rs.appendMenuItem(Te.EditorContext,{submenu:Te.EditorContextPeek,title:_(1038,"Peek"),group:"navigation",order:100});class MS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof MS||U.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}const Nc=class Nc extends Jc{static all(){return Nc._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const i of Dt.wrap(t.menu))(i.id===Te.EditorContext||i.id===Te.EditorContextPeek)&&(i.when=le.and(e.precondition,i.when));return t}constructor(e,t){super(Nc._patchConfig(t)),this.configuration=e,Nc._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(fn),r=e.get(Bt),a=e.get(Tg),l=e.get(J3),c=e.get(De),d=e.get(Ae),h=t.getModel(),u=t.getPosition(),f=MS.is(i)?i:new MS(h,u),g=new Mg(t,5),p=rS(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async m=>{var w;if(!m||g.token.isCancellationRequested)return;vr(m.ariaMessage);let b;if(m.referenceAt(h.uri,u)){const C=this._getAlternativeCommand(t);C!==void 0&&!Nc._activeAlternativeCommands.has(C)&&Nc._allSymbolNavigationCommands.has(C)&&(b=Nc._allSymbolNavigationCommands.get(C))}const v=m.references.length;if(v===0){if(!this.configuration.muteMessage){const C=h.getWordAtPosition(u);(w=ba.get(t))==null||w.showMessage(this._getNoResultFoundMessage(C),u)}}else if(v===1&&b)Nc._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(C=>b.runEditorCommand(C,t,i,s).finally(()=>{Nc._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,m,s)},m=>{o.error(m)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,i,s,o){const r=this._getGoToPreference(i);if(!(i instanceof Pg)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=await this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}}async _openReference(e,t,i,s,o){let r;if(LPe(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=await t.openCodeEditor({resource:i.uri,options:{selection:D.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,i){const s=yw.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),rs(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}};Nc._allSymbolNavigationCommands=new Map,Nc._activeAlternativeCommands=new Set;let Fg=Nc;class zD extends Fg{async _getLocationModel(e,t,i,s){return new va(await HD(e.definitionProvider,t,i,!1,s),_(1039,"Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?_(1040,"No definition found for '{0}'",e.word):_(1041,"No definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleDefinitions}}var Fm;ni((Fm=class extends zD{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Fm.id,title:{...ie(1065,"Go to Definition"),mnemonicTitle:_(1042,"Go to &&Definition")},precondition:H.hasDefinitionProvider,keybinding:[{when:H.editorTextFocus,primary:70,weight:100},{when:le.and(H.editorTextFocus,Tve),primary:2118,weight:100}],menu:[{id:Te.EditorContext,group:"navigation",order:1.1},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Rt.registerCommandAlias("editor.action.goToDeclaration",Fm.id)}},Fm.id="editor.action.revealDefinition",Fm));var Bm;ni((Bm=class extends zD{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Bm.id,title:ie(1066,"Open Definition to the Side"),precondition:le.and(H.hasDefinitionProvider,H.isInEmbeddedEditor.toNegated()),keybinding:[{when:H.editorTextFocus,primary:Fn(2089,70),weight:100},{when:le.and(H.editorTextFocus,Tve),primary:Fn(2089,2118),weight:100}]}),Rt.registerCommandAlias("editor.action.openDeclarationToTheSide",Bm.id)}},Bm.id="editor.action.revealDefinitionAside",Bm));var Wm;ni((Wm=class extends zD{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Wm.id,title:ie(1067,"Peek Definition"),precondition:le.and(H.hasDefinitionProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:Te.EditorContextPeek,group:"peek",order:2}}),Rt.registerCommandAlias("editor.action.previewDeclaration",Wm.id)}},Wm.id="editor.action.peekDefinition",Wm));class $we extends Fg{async _getLocationModel(e,t,i,s){return new va(await AX(e.declarationProvider,t,i,!1,s),_(1043,"Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?_(1044,"No declaration found for '{0}'",e.word):_(1045,"No declaration found")}_getAlternativeCommand(e){return e.getOption(67).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(67).multipleDeclarations}}var t1;ni((t1=class extends $we{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:t1.id,title:{...ie(1068,"Go to Declaration"),mnemonicTitle:_(1046,"Go to &&Declaration")},precondition:le.and(H.hasDeclarationProvider,H.isInEmbeddedEditor.toNegated()),menu:[{id:Te.EditorContext,group:"navigation",order:1.3},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?_(1047,"No declaration found for '{0}'",e.word):_(1048,"No declaration found")}},t1.id="editor.action.revealDeclaration",t1));ni(class extends $we{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:ie(1069,"Peek Declaration"),precondition:le.and(H.hasDeclarationProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:3}})}});class Uwe extends Fg{async _getLocationModel(e,t,i,s){return new va(await OX(e.typeDefinitionProvider,t,i,!1,s),_(1049,"Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?_(1050,"No type definition found for '{0}'",e.word):_(1051,"No type definition found")}_getAlternativeCommand(e){return e.getOption(67).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(67).multipleTypeDefinitions}}var i1;ni((i1=class extends Uwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:i1.ID,title:{...ie(1070,"Go to Type Definition"),mnemonicTitle:_(1052,"Go to &&Type Definition")},precondition:H.hasTypeDefinitionProvider,keybinding:{when:H.editorTextFocus,primary:0,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.4},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},i1.ID="editor.action.goToTypeDefinition",i1));var n1;ni((n1=class extends Uwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:n1.ID,title:ie(1071,"Peek Type Definition"),precondition:le.and(H.hasTypeDefinitionProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:4}})}},n1.ID="editor.action.peekTypeDefinition",n1));class qwe extends Fg{async _getLocationModel(e,t,i,s){return new va(await PX(e.implementationProvider,t,i,!1,s),_(1053,"Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?_(1054,"No implementation found for '{0}'",e.word):_(1055,"No implementation found")}_getAlternativeCommand(e){return e.getOption(67).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(67).multipleImplementations}}var s1;ni((s1=class extends qwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:s1.ID,title:{...ie(1072,"Go to Implementations"),mnemonicTitle:_(1056,"Go to &&Implementations")},precondition:H.hasImplementationProvider,keybinding:{when:H.editorTextFocus,primary:2118,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},s1.ID="editor.action.goToImplementation",s1));var o1;ni((o1=class extends qwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:o1.ID,title:ie(1073,"Peek Implementations"),precondition:le.and(H.hasImplementationProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:3142,weight:100},menu:{id:Te.EditorContextPeek,group:"peek",order:5}})}},o1.ID="editor.action.peekImplementation",o1));class Kwe extends Fg{_getNoResultFoundMessage(e){return e?_(1057,"No references found for '{0}'",e.word):_(1058,"No references found")}_getAlternativeCommand(e){return e.getOption(67).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(67).multipleReferences}}ni(class extends Kwe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...ie(1074,"Go to References"),mnemonicTitle:_(1059,"Go to &&References")},precondition:le.and(H.hasReferenceProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),keybinding:{when:H.editorTextFocus,primary:1094,weight:100},menu:[{id:Te.EditorContext,group:"navigation",order:1.45},{id:Te.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,i,s){return new va(await VD(e.referenceProvider,t,i,!0,!1,s),_(1060,"References"))}});ni(class extends Kwe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:ie(1075,"Peek References"),precondition:le.and(H.hasReferenceProvider,Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated()),menu:{id:Te.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,i,s){return new va(await VD(e.referenceProvider,t,i,!1,!1,s),_(1061,"References"))}});class nnt extends Fg{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:ie(1076,"Go to Any Symbol"),precondition:le.and(Yr.notInPeekEditor,H.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}async _getLocationModel(e,t,i,s){return new va(this._references,_(1062,"Locations"))}_getNoResultFoundMessage(e){return e&&_(1063,"No results for '{0}'",e.word)||""}_getGoToPreference(e){return this._gotoMultipleBehaviour??e.getOption(67).multipleReferences}_getAlternativeCommand(){}}Rt.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:He},{name:"position",description:"The position at which to start",constraint:U.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(n,e,t,i,s,o,r)=>{Ft(He.isUri(e)),Ft(U.isIPosition(t)),Ft(Array.isArray(i)),Ft(typeof s>"u"||typeof s=="string"),Ft(typeof r>"u"||typeof r=="boolean");const a=n.get(Bt),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(rh(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends nnt{_getNoResultFoundMessage(h){return o||super._getNoResultFoundMessage(h)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(Ae).invokeFunction(d.run.bind(d),l)})}});Rt.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:He},{name:"position",description:"The position at which to start",constraint:U.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(n,e,t,i,s)=>{n.get(ki).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)}});Rt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Ft(He.isUri(e)),Ft(U.isIPosition(t));const i=n.get(De),s=n.get(Bt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!rh(o)||!o.hasModel())return;const r=yw.get(o);if(!r)return;const a=rs(c=>VD(i.referenceProvider,o.getModel(),U.lift(t),!1,!1,c).then(d=>new va(d,_(1064,"References")))),l=new D(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Rt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");async function snt(n,e,t,i){const s=n.get(Qo),o=n.get(gl),r=n.get(ki),a=n.get(Ae),l=n.get(fn);if(await i.item.resolve(wt.None),!i.part.location)return;const c=i.part.location,d=[],h=new Set(Rs.getMenuItems(Te.EditorContext).map(f=>ey(f)?f.command.id:Ow()));for(const f of Fg.all())h.has(f.desc.id)&&d.push(new ol(f.desc.id,rl.label(f.desc,{renderShortTitle:!0}),void 0,!0,async()=>{const g=await s.createModelReference(c.uri);try{const p=new MS(g.object.textEditorModel,D.getStartPosition(c.range)),m=i.item.anchor.range;await a.invokeFunction(f.runEditorCommand.bind(f),e,p,m)}finally{g.dispose()}}));if(i.part.command){const{command:f}=i.part;d.push(new Zn),d.push(new ol(f.id,f.title,void 0,!0,async()=>{try{await r.executeCommand(f.id,...f.arguments??[])}catch(g){l.notify({severity:rx.Error,source:i.item.provider.displayName,message:g})}}))}const u=e.getOption(144);o.showContextMenu({domForShadowRoot:u?e.getDomNode()??void 0:void 0,getAnchor:()=>{const f=dn(t);return{x:f.left,y:f.top+f.height+8}},getActions:()=>d,onHide:()=>{e.focus()},autoSelectFirstItem:!0})}async function Gwe(n,e,t,i){const o=await n.get(Qo).createModelReference(i.uri);await t.invokeWithinContext(async r=>{const a=e.hasSideBySideModifier,l=r.get(Xe),c=Yr.inPeekEditor.getValue(l),d=!a&&t.getOption(101)&&!c;return new zD({openToSide:a,openInPeek:d,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(r,new MS(o.object.textEditorModel,D.getStartPosition(i.range)),D.lift(i.range))}),o.dispose()}var ont=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yC=function(n,e){return function(t,i){e(t,i,n)}},OC;class pO{constructor(){this._entries=new Qc(50)}get(e){const t=pO._key(e);return this._entries.get(t)}set(e,t){const i=pO._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const Ywe=mt("IInlayHintsCache");Lt(Ywe,pO,1);class Y${constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return typeof e=="string"?{label:e}:e[this.index]}}class rnt{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}class ant{constructor(){this._store=new Gt,this._tokenSource=new Bi}dispose(){this._store.dispose(),this._tokenSource.dispose(!0)}reset(){return this._tokenSource.dispose(!0),this._tokenSource=new Bi,this._store.value=new ne,{store:this._store.value,token:this._tokenSource.token}}}var eg;let CN=(eg=class{static get(e){return e.getContribution(OC.ID)??void 0}constructor(e,t,i,s,o,r,a){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=s,this._commandService=o,this._notificationService=r,this._instaService=a,this._disposables=new ne,this._sessionDisposables=new ne,this._decorationsMetadata=new Map,this._activeRenderMode=0,this._ruleFactory=this._disposables.add(new BA(this._editor)),this._debounceInfo=i.for(t.inlayHintsProvider,"InlayHint",{min:25}),this._disposables.add(t.inlayHintsProvider.onDidChange(()=>this._update())),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(l=>{l.hasChanged(159)&&this._update()})),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(159);if(e.enabled==="off")return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;if(e.enabled==="on")this._activeRenderMode=0;else{let c,d;e.enabled==="onUnlessPressed"?(c=0,d=1):(c=1,d=0),this._activeRenderMode=c,this._sessionDisposables.add(jf.getInstance().event(h=>{if(!this._editor.hasModel())return;const u=h.altKey&&h.ctrlKey&&!(h.shiftKey||h.metaKey)?d:c;if(u!==this._activeRenderMode){this._activeRenderMode=u;const f=this._editor.getModel(),g=this._copyInlayHintsWithCurrentAnchor(f);this._updateHintsDecorators([f.getFullModelRange()],g),a.schedule(0)}}))}const i=this._inlayHintsCache.get(t);i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(Re(()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)}));let s;const o=new Set;this._sessionDisposables.add(t.onWillDispose(()=>s==null?void 0:s.cancel()));const r=this._sessionDisposables.add(new ant),a=new ai(async()=>{const c=Date.now(),{store:d,token:h}=r.reset();try{const u=await dO.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),h);if(a.delay=this._debounceInfo.update(t,Date.now()-c),h.isCancellationRequested){u.dispose();return}for(const f of u.provider)typeof f.onDidChangeInlayHints=="function"&&!o.has(f)&&(o.add(f),d.add(f.onDidChangeInlayHints(()=>{a.isScheduled()||a.schedule()})));d.add(u),this._updateHintsDecorators(u.ranges,u.items),this._cacheHintsForFastRestore(t)}catch(u){Je(u)}},this._debounceInfo.get(t));this._sessionDisposables.add(a),a.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange(c=>{(c.scrollTopChanged||!a.isScheduled())&&a.schedule()}));const l=this._sessionDisposables.add(new Gt);this._sessionDisposables.add(this._editor.onDidChangeModelContent(c=>{const d=Math.max(a.delay,800);this._cursorInfo={position:this._editor.getPosition(),notEarlierThan:Date.now()+d},l.value=kg(()=>a.schedule(0),d),a.schedule()})),this._sessionDisposables.add(this._editor.onDidChangeConfiguration(c=>{c.hasChanged(159)&&a.schedule()})),this._sessionDisposables.add(this._installDblClickGesture(()=>a.schedule(0))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new ne,t=e.add(new Z3(this._editor)),i=new ne;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown(s=>{const[o]=s,r=this._getInlayHintLabelPart(o),a=this._editor.getModel();if(!r||!a){i.clear();return}const l=new Bi;i.add(Re(()=>l.dispose(!0))),r.item.resolve(l.token),this._activeInlayHintPart=r.part.command||r.part.location?new rnt(r,o.hasTriggerModifier):void 0;const c=a.validatePosition(r.item.hint.position).lineNumber,d=new D(c,1,c,a.getLineMaxColumn(c)),h=this._getInlineHintsForRange(d);this._updateHintsDecorators([d],h),i.add(Re(()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([d],h)}))})),e.add(t.onCancel(()=>i.clear())),e.add(t.onExecute(async s=>{const o=this._getInlayHintLabelPart(s);if(o){const r=o.part;r.location?this._instaService.invokeFunction(Gwe,s,this._editor,r.location):hW.is(r.command)&&await this._invokeCommand(r.command,o.item)}})),e}_getInlineHintsForRange(e){const t=new Set;for(const i of this._decorationsMetadata.values())e.containsRange(i.item.anchor.range)&&t.add(i.item);return Array.from(t)}_installDblClickGesture(e){return this._editor.onMouseUp(async t=>{if(t.event.detail!==2)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),await i.item.resolve(wt.None),Yo(i.item.hint.textEdits))){const s=i.item.hint.textEdits.map(o=>ln.replace(D.lift(o.range),o.text));this._editor.executeEdits("inlayHint.default",s),e()}})}_installContextMenu(){return this._editor.onContextMenu(async e=>{if(!hn(e.event.target))return;const t=this._getInlayHintLabelPart(e);t&&await this._instaService.invokeFunction(snt,this._editor,e.event.target,t)})}_getInlayHintLabelPart(e){var i;if(e.target.type!==6)return;const t=(i=e.target.detail.injectedText)==null?void 0:i.options;if(t instanceof a_&&(t==null?void 0:t.attachedData)instanceof Y$)return t.attachedData}async _invokeCommand(e,t){try{await this._commandService.executeCommand(e.id,...e.arguments??[])}catch(i){this._notificationService.notify({severity:rx.Error,source:t.provider.displayName,message:i})}}_cacheHintsForFastRestore(e){const t=this._copyInlayHintsWithCurrentAnchor(e);this._inlayHintsCache.set(e,t)}_copyInlayHintsWithCurrentAnchor(e){const t=new Map;for(const[i,s]of this._decorationsMetadata){if(t.has(s.item))continue;const o=e.getDecorationRange(i);if(o){const r=new Pwe(o,s.item.anchor.direction),a=s.item.with({anchor:r});t.set(s.item,a)}}return Array.from(t.values())}_getHintsRanges(){const t=this._editor.getModel(),i=this._editor.getVisibleRangesPlusViewportAboveBelow(),s=[];for(const o of i.sort(D.compareRangesUsingStarts)){const r=t.validateRange(new D(o.startLineNumber-30,o.startColumn,o.endLineNumber+30,o.endColumn));s.length===0||!D.areIntersectingOrTouching(s[s.length-1],r)?s.push(r):s[s.length-1]=D.plusRange(s[s.length-1],r)}return s}_updateHintsDecorators(e,t){var m,b;const i=new Map;if(this._cursorInfo&&this._cursorInfo.notEarlierThan>Date.now()&&e.some(v=>v.containsPosition(this._cursorInfo.position))){const{position:v}=this._cursorInfo;this._cursorInfo=void 0;const w=new Map;for(const x of this._editor.getLineDecorations(v.lineNumber)??[]){const I=this._decorationsMetadata.get(x.id);if(x.range.startColumn>v.column)continue;const E=I==null?void 0:I.decoration.options[I.item.anchor.direction];if(E&&E.attachedData!==OC._whitespaceData){const R=w.get(I.item)??0;w.set(I.item,R+E.content.length)}}const C=t.filter(x=>x.anchor.range.startLineNumber===v.lineNumber&&x.anchor.range.endColumn<=v.column),S=Array.from(w.values());let L;for(;;){const x=C.shift(),I=S.shift();if(!I&&!x)break;if(x)i.set(x,I??0),L=x;else if(L&&I){let E=i.get(L);E+=I,E+=S.reduce((R,M)=>R+M,0),S.length=0;break}}}const s=[],o=(v,w,C,S,L)=>{const x={content:C,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:w.className,cursorStops:S,attachedData:L};s.push({item:v,classNameRef:w,decoration:{range:v.anchor.range,options:{description:"InlayHint",showIfCollapsed:v.anchor.range.isEmpty(),collapseOnReplaceEdit:!v.anchor.range.isEmpty(),stickiness:0,[v.anchor.direction]:this._activeRenderMode===0?x:void 0}}})},r=(v,w)=>{const C=this._ruleFactory.createClassNameRef({width:`${a/3|0}px`,display:"inline-block"});o(v,C," ",w?Wl.Right:Wl.None,OC._whitespaceData)},{fontSize:a,fontFamily:l,padding:c,isUniform:d}=this._getLayoutInfo(),h=this._editor.getOption(159).maximumLength,u="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(u,l);let f={line:0,totalLen:0};for(let v=0;vh)continue;w.hint.paddingLeft&&r(w,!1);const C=typeof w.hint.label=="string"?[{label:w.hint.label}]:w.hint.label,S=i.get(w);let L=0;for(let x=0;x0&&(A=A.slice(0,-P)+"…",W=!0),L+=A.length,S!==void 0){const B=L-S;B>=0&&(L-=B,A=A.slice(0,-(1+B))+"…",W=!0)}if(c&&(E&&(R||W)?(M.padding=`1px ${Math.max(1,a/4)|0}px`,M.borderRadius=`${a/4|0}px`):E?(M.padding=`1px 0 1px ${Math.max(1,a/4)|0}px`,M.borderRadius=`${a/4|0}px 0 0 ${a/4|0}px`):R||W?(M.padding=`1px ${Math.max(1,a/4)|0}px 1px 0`,M.borderRadius=`0 ${a/4|0}px ${a/4|0}px 0`):M.padding="1px 0 1px 0"),o(w,this._ruleFactory.createClassNameRef(M),lnt(A),R&&!w.hint.paddingRight?Wl.Right:Wl.None,new Y$(w,x)),W)break}if(S!==void 0&&LOC._MAX_DECORATORS)break}const g=[];for(const[v,w]of this._decorationsMetadata){const C=(b=this._editor.getModel())==null?void 0:b.getDecorationRange(v);C&&e.some(S=>S.containsRange(C))&&(g.push(v),w.classNameRef.dispose(),this._decorationsMetadata.delete(v))}const p=oh.capture(this._editor);this._editor.changeDecorations(v=>{const w=v.deltaDecorations(g,s.map(C=>C.decoration));for(let C=0;Ci)&&(o=i);const r=e.fontFamily||s;return{fontSize:o,fontFamily:r,padding:t,isUniform:!t&&r===s&&o===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}},OC=eg,eg.ID="editor.contrib.InlayHints",eg._MAX_DECORATORS=1500,eg._whitespaceData={},eg);CN=OC=ont([yC(1,De),yC(2,hc),yC(3,Ywe),yC(4,ki),yC(5,fn),yC(6,Ae)],CN);function lnt(n){return n.replace(/[ \t]/g," ")}Rt.registerCommand("_executeInlayHintProvider",async(n,...e)=>{const[t,i]=e;Ft(He.isUri(t)),Ft(D.isIRange(i));const{inlayHintsProvider:s}=n.get(De),o=await n.get(Qo).createModelReference(t);try{const r=await dO.create(s,o.object.textEditorModel,[D.lift(i)],wt.None),a=r.items.map(l=>l.hint);return setTimeout(()=>r.dispose(),0),a}finally{o.dispose()}});var cnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X_=function(n,e){return function(t,i){e(t,i,n)}};class Wae extends FL{constructor(e,t,i,s){super(10,t,e.item.anchor.range,i,s,!0),this.part=e}}let mO=class extends vN{constructor(e,t,i,s,o,r,a,l){super(e,t,o,a,i,s,l),this._resolverService=r,this.hoverOrdinal=6}suggestHoverAnchor(e){var s;if(!CN.get(this._editor)||e.target.type!==6)return null;const i=(s=e.target.detail.injectedText)==null?void 0:s.options;return i instanceof a_&&i.attachedData instanceof Y$?new Wae(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i,s){return e instanceof Wae?new Kl(async o=>{const{part:r}=e;if(await r.item.resolve(s),s.isCancellationRequested)return;let a;typeof r.item.hint.tooltip=="string"?a=new Co().appendText(r.item.hint.tooltip):r.item.hint.tooltip&&(a=r.item.hint.tooltip),a&&o.emitOne(new Bc(this,e.range,[a],!1,0)),Yo(r.item.hint.textEdits)&&o.emitOne(new Bc(this,e.range,[new Co().appendText(_(1164,"Double-click to insert"))],!1,10001));let l;if(typeof r.part.tooltip=="string"?l=new Co().appendText(r.part.tooltip):r.part.tooltip&&(l=r.part.tooltip),l&&o.emitOne(new Bc(this,e.range,[l],!1,1)),r.part.location||r.part.command){let d;const u=this._editor.getOption(86)==="altKey"?yt?_(1165,"cmd + click"):_(1166,"ctrl + click"):yt?_(1167,"option + click"):_(1168,"alt + click");r.part.location&&r.part.command?d=new Co().appendText(_(1169,"Go to Definition ({0}), right click for more",u)):r.part.location?d=new Co().appendText(_(1170,"Go to Definition ({0})",u)):r.part.command&&(d=new Co(`[${_(1171,"Execute Command")}](${Bit(r.part.command)} "${r.part.command.title}") (${u})`,{isTrusted:!0})),d&&o.emitOne(new Bc(this,e.range,[d],!1,1e4))}const c=this._resolveInlayHintLabelPartHover(r,s);for await(const d of c)o.emitOne(d)}):Kl.EMPTY}async*_resolveInlayHintLabelPartHover(e,t){if(!e.part.location)return;const{uri:i,range:s}=e.part.location,o=await this._resolverService.createModelReference(i);try{const r=o.object.textEditorModel;if(!this._languageFeaturesService.hoverProvider.has(r))return;for await(const a of DX(this._languageFeaturesService.hoverProvider,r,new U(s.startLineNumber,s.startColumn),t))yS(a.hover.contents)||(yield new Bc(this,e.item.anchor.range,a.hover.contents,!1,2+a.ordinal))}finally{o.dispose()}}};mO=cnt([X_(1,ed),X_(2,Vt),X_(3,Sr),X_(4,lt),X_(5,Qo),X_(6,De),X_(7,ki)],mO);var Zwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_O=function(n,e){return function(t,i){e(t,i,n)}};class Hae{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let Z$=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new q,this.onDidChange=this._onDidChange.event,this._dispoables=new ne,this._markers=[],this._nextIdx=-1,He.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=oE(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=D.compareRangesUsingStarts(a,l)||Xi.compare(a.severity,l.severity):c=Xi.compare(a.severity,l.severity)||D.compareRangesUsingStarts(a,l)),c},r=()=>{let a=this._markerService.read({resource:He.isUri(e)?e:void 0,severities:Xi.Error|Xi.Warning|Xi.Info});return typeof e=="function"&&(a=a.filter(l=>this._resourceFilter(l.resource))),a.sort(o),Fi(a,this._markers,(l,c)=>l.resource.toString()===c.resource.toString()&&l.startLineNumber===c.startLineNumber&&l.startColumn===c.startColumn&&l.endLineNumber===c.endLineNumber&&l.endColumn===c.endColumn&&l.severity===c.severity&&l.message===c.message)?!1:(this._markers=a,!0)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&r()&&(this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Hae(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=this._markers.findIndex(o=>t_(o.resource,e.uri));if(s<0)s=vG(this._markers.length,o=>oE(this._markers[o].resource.toString(),e.uri.toString())),s<0&&(s=~s),i?this._nextIdx=s:this._nextIdx=(this._markers.length+s-1)%this._markers.length;else{let o=!1,r=!1;for(let a=s;as.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},SC=function(n,e){return function(t,i){e(t,i,n)}},J$;class hnt{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new ne,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(kn(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new Lme(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){ei(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=Ca(i);this._lines=a.length,this._longestLineLength=0;for(const u of a)this._longestLineLength=Math.max(u.length+r,this._longestLineLength);js(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const u of a)l=document.createElement("div"),l.innerText=u,u===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const u=document.createElement("span");if(u.classList.add("details"),l.appendChild(u),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),u.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),u.appendChild(f)}else{this._codeLink=me("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=he(this._codeLink,me("span"));f.innerText=o.value,u.appendChild(this._codeLink)}}if(js(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Yo(s)){const u=this._relatedBlock.appendChild(document.createElement("div"));u.style.paddingTop=`${Math.floor(this._editor.getOption(75)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const m=document.createElement("span");m.innerText=f.message,g.appendChild(p),g.appendChild(m),this._lines+=1,u.appendChild(g)}}const c=this._editor.getOption(59),d=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),h=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:d,scrollHeight:h})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case Xi.Error:t=_(1024,"Error");break;case Xi.Warning:t=_(1025,"Warning");break;case Xi.Info:t=_(1026,"Info");break;case Xi.Hint:t=_(1027,"Hint");break}let i=_(1028,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}var r1;let yN=(r1=class extends uO{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new ne,this._onDidSelectRelatedInformation=new q,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=Xi.Warning,this._backgroundColor=se.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(pnt);let t=eU,i=unt;this._severity===Xi.Warning?(t=sM,i=fnt):this._severity===Xi.Info&&(t=tU,i=gnt);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(Hwe),secondaryHeadingColor:e.getColor(Vwe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=this._menuService.getMenuActions(J$.TitleMenu,this._contextKeyService),i=NKe(t);this._actionbarWidget.push(i,{label:!1,icon:!0,index:0})}_fillTitleIcon(e){this._icon=he(e,me(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new hnt(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,i){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const s=D.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?_(1029,"{0} of {1} problems",t,i):_(1030,"{0} of {1} problem",t,i);this.setTitle(ic(a.uri),l)}this._icon.className=`codicon ${Q$.className(Xi.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}},J$=r1,r1.TitleMenu=new Te("gotoErrorTitleMenu"),r1);yN=J$=dnt([SC(1,en),SC(2,jg),SC(3,lc),SC(4,Ae),SC(5,Xe),SC(6,lw)],yN);const Vae=xE(d3,l8e),zae=xE(Ig,LE),jae=xE(yu,kE),eU=F("editorMarkerNavigationError.background",{dark:Vae,light:Vae,hcDark:Tt,hcLight:Tt},_(1031,"Editor marker navigation widget error color.")),unt=F("editorMarkerNavigationError.headerBackground",{dark:ot(eU,.1),light:ot(eU,.1),hcDark:null,hcLight:null},_(1032,"Editor marker navigation widget error heading background.")),sM=F("editorMarkerNavigationWarning.background",{dark:zae,light:zae,hcDark:Tt,hcLight:Tt},_(1033,"Editor marker navigation widget warning color.")),fnt=F("editorMarkerNavigationWarning.headerBackground",{dark:ot(sM,.1),light:ot(sM,.1),hcDark:"#0C141F",hcLight:ot(sM,.2)},_(1034,"Editor marker navigation widget warning heading background.")),tU=F("editorMarkerNavigationInfo.background",{dark:jae,light:jae,hcDark:Tt,hcLight:Tt},_(1035,"Editor marker navigation widget info color.")),gnt=F("editorMarkerNavigationInfo.headerBackground",{dark:ot(tU,.1),light:ot(tU,.1),hcDark:null,hcLight:null},_(1036,"Editor marker navigation widget info heading background.")),pnt=F("editorMarkerNavigation.background",In,_(1037,"Editor marker navigation widget background."));var mnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},B2=function(n,e){return function(t,i){e(t,i,n)}},WL,a1;let Sw=(a1=class{static get(e){return e.getContribution(WL.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new ne,this._editor=e,this._widgetVisible=Qwe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(yN,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(i=>{var s,o,r;(!((s=this._model)!=null&&s.selected)||!D.containsPosition((o=this._model)==null?void 0:o.selected.marker,i.position))&&((r=this._model)==null||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:D.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._getOrCreateModel(t.uri);i.resetIndex(),i.move(!0,t,new U(e.startLineNumber,e.startColumn)),i.selected&&this._widget.showAtMarker(i.selected.marker,i.selected.index,i.selected.total)}async navigate(e,t){var o,r;if(!this._editor.hasModel())return;const i=this._editor.getModel(),s=this._getOrCreateModel(t?void 0:i.uri);if(s.move(e,i,this._editor.getPosition()),!!s.selected)if(s.selected.marker.resource.toString()!==i.uri.toString()){this._cleanUp();const a=await this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);a&&((o=WL.get(a))==null||o.close(),(r=WL.get(a))==null||r.navigate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}},WL=a1,a1.ID="editor.contrib.markerController",a1);Sw=WL=mnt([B2(1,Xwe),B2(2,Xe),B2(3,Bt),B2(4,Ae)],Sw);class e8 extends Ne{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}async run(e,t){var i;t.hasModel()&&await((i=Sw.get(t))==null?void 0:i.navigate(this._next,this._multiFile))}}const Gb=class Gb extends e8{constructor(){super(!0,!1,{id:Gb.ID,label:Gb.LABEL,precondition:void 0,kbOpts:{kbExpr:H.focus,primary:578,weight:100},menuOpts:{menuId:yN.TitleMenu,title:Gb.LABEL.value,icon:Ri("marker-navigation-next",de.arrowDown,_(1016,"Icon for goto next marker.")),group:"navigation",order:1}})}};Gb.ID="editor.action.marker.next",Gb.LABEL=ie(1020,"Go to Next Problem (Error, Warning, Info)");let bO=Gb;const Yb=class Yb extends e8{constructor(){super(!1,!1,{id:Yb.ID,label:Yb.LABEL,precondition:void 0,kbOpts:{kbExpr:H.focus,primary:1602,weight:100},menuOpts:{menuId:yN.TitleMenu,title:Yb.LABEL.value,icon:Ri("marker-navigation-previous",de.arrowUp,_(1017,"Icon for goto previous marker.")),group:"navigation",order:2}})}};Yb.ID="editor.action.marker.prev",Yb.LABEL=ie(1021,"Go to Previous Problem (Error, Warning, Info)");let iU=Yb;class _nt extends e8{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:ie(1022,"Go to Next Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:66,weight:100},menuOpts:{menuId:Te.MenubarGoMenu,title:_(1018,"Next &&Problem"),group:"6_problem_nav",order:1}})}}class bnt extends e8{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:ie(1023,"Go to Previous Problem in Files (Error, Warning, Info)"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:1090,weight:100},menuOpts:{menuId:Te.MenubarGoMenu,title:_(1019,"Previous &&Problem"),group:"6_problem_nav",order:2}})}}At(Sw.ID,Sw,4);we(bO);we(iU);we(_nt);we(bnt);const Qwe=new Se("markersNavigationVisible",!1),vnt=hs.bindToContribution(Sw.get);ye(new vnt({id:"closeMarkersNavigation",precondition:Qwe,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:H.focus,primary:9,secondary:[1033]}}));var wnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},t6=function(n,e){return function(t,i){e(t,i,n)}};const Cc=me;class Jwe{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const $ae={type:1,filter:{include:Oi.QuickFix},triggerAction:ka.QuickFixHover};let nU=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range;if(!i.isValidRange(e.range))return[];const o=s.startLineNumber,r=i.getLineMaxColumn(o),a=[];for(const l of t){const c=l.range.startLineNumber===o?l.range.startColumn:1,d=l.range.endLineNumber===o?l.range.endColumn:r,h=this._markerDecorationsService.getMarker(i.uri,l);if(!h)continue;const u=new D(e.range.startLineNumber,c,e.range.startLineNumber,d);a.push(new Jwe(this,u,h))}return a}renderHoverParts(e,t){if(!t.length)return new Cw([]);const i=[];t.forEach(r=>{const a=this._renderMarkerHover(r);e.fragment.appendChild(a.hoverElement),i.push(a)});const s=t.length===1?t[0]:t.sort((r,a)=>Xi.compare(r.marker.severity,a.marker.severity))[0],o=this._renderMarkerStatusbar(e,s);return new Cw(i,o)}getAccessibleContent(e){return e.marker.message}_renderMarkerHover(e){const t=new ne,i=Cc("div.hover-row"),s=he(i,Cc("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=he(s,Cc("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const h=Cc("span");if(o){const p=he(h,Cc("span"));p.innerText=o}const u=he(h,Cc("a.code-link"));u.setAttribute("href",a.target.toString(!0)),t.add(J(u,"click",p=>{this._openerService.open(a.target,{allowCommands:!0}),p.preventDefault(),p.stopPropagation()}));const f=he(u,Cc("span"));f.innerText=a.value;const g=he(s,h);g.style.opacity="0.6",g.style.paddingLeft="6px"}else{const h=he(s,Cc("span"));h.style.opacity="0.6",h.style.paddingLeft="6px",h.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Yo(l))for(const{message:h,resource:u,startLineNumber:f,startColumn:g}of l){const p=he(s,Cc("div"));p.style.marginTop="8px";const m=he(p,Cc("a"));m.innerText=`${ic(u)}(${f}, ${g}): `,m.style.cursor="pointer",t.add(J(m,"click",v=>{if(v.stopPropagation(),v.preventDefault(),this._openerService){const w={selection:{startLineNumber:f,startColumn:g}};this._openerService.open(u,{fromUserGesture:!0,editorOptions:w}).catch(Je)}}));const b=he(p,Cc("span"));b.innerText=h,this._editor.applyFontInfo(b)}return{hoverPart:e,hoverElement:i,dispose:()=>t.dispose()}}_renderMarkerStatusbar(e,t){const i=new ne;if(t.marker.severity===Xi.Error||t.marker.severity===Xi.Warning||t.marker.severity===Xi.Info){const s=Sw.get(this._editor);s&&e.statusBar.addAction({label:_(1139,"View Problem"),commandId:bO.ID,run:()=>{e.hide(),s.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(104)){const s=e.statusBar.append(Cc("div"));this.recentMarkerCodeActionsInfo&&(kP.makeKey(this.recentMarkerCodeActionsInfo.marker)===kP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=_(1140,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?G.None:kg(()=>s.textContent=_(1141,"Checking for quick fixes..."),200,i);s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Re(()=>r.cancel())),r.then(a=>{var d;if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=_(1142,"No quick fixes available");return}s.style.display="none";let l=!1;i.add(Re(()=>{l||a.dispose()})),e.statusBar.addAction({label:_(1143,"Quick Fix..."),commandId:yX,run:h=>{l=!0;const u=ww.get(this._editor),f=dn(h);e.hide(),u==null||u.showCodeActions($ae,a,{x:f.left,y:f.top,width:f.width,height:f.height})}});const c=a.validActions.find(h=>h.action.isAI);c&&e.statusBar.addAction({label:c.action.title,commandId:((d=c.action.command)==null?void 0:d.id)??"",iconClass:$e.asClassName(de.sparkle),run:()=>{const h=ww.get(this._editor);h==null||h.applyCodeAction(c,!1,!1,om.FromProblemsHover)}}),e.onContentsChanged()},Je)}return i}getCodeActions(e){return rs(t=>C0(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),$ae,Vd.None,t))}};nU=wnt([t6(1,mY),t6(2,jg),t6(3,De)],nU);var eCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sy=function(n,e){return function(t,i){e(t,i,n)}},sU,oU;let rU=sU=class extends G{constructor(e,t,i,s,o,r,a){super();const l=t.hoverParts;this._renderedHoverParts=this._register(new aU(e,i,l,s,o,r,a));const c=t.options,d=c.anchor,{showAtPosition:h,showAtSecondaryPosition:u}=sU.computeHoverPositions(e,d.range,l);this.shouldAppearBeforeContent=l.some(f=>f.isBeforeContent),this.showAtPosition=h,this.showAtSecondaryPosition=u,this.initialMousePosX=d.initialMousePosX,this.initialMousePosY=d.initialMousePosY,this.shouldFocus=c.shouldFocus,this.source=c.source}get domNode(){return this._renderedHoverParts.domNode}get domNodeHasChildren(){return this._renderedHoverParts.domNodeHasChildren}get focusedHoverPartIndex(){return this._renderedHoverParts.focusedHoverPartIndex}get hoverPartsCount(){return this._renderedHoverParts.hoverPartsCount}focusHoverPartWithIndex(e){this._renderedHoverParts.focusHoverPartWithIndex(e)}async updateHoverVerbosityLevel(e,t,i){this._renderedHoverParts.updateHoverVerbosityLevel(e,t,i)}isColorPickerVisible(){return this._renderedHoverParts.isColorPickerVisible()}static computeHoverPositions(e,t,i){let s=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,u=h.convertModelRangeToViewRange(t),f=d.getLineMinColumn(u.startLineNumber),g=new U(u.startLineNumber,f);s=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let r=t.startColumn,a;for(const d of i){const h=d.range,u=h.startLineNumber===o,f=h.endLineNumber===o;if(u&&f){const p=h.startColumn,m=Math.min(r,p);r=Math.max(m,s)}d.forceShowAtRange&&(a=h)}let l,c;if(a){const d=a.getStartPosition();l=d,c=d}else l=t.getStartPosition(),c=new U(o,r);return{showAtPosition:l,showAtSecondaryPosition:c}}};rU=sU=eCe([Sy(4,Vt),Sy(5,Sr),Sy(6,La)],rU);class Cnt{constructor(e,t){this._statusBar=t,e.appendChild(this._statusBar.hoverElement)}get hoverElement(){return this._statusBar.hoverElement}get actions(){return this._statusBar.actions}dispose(){this._statusBar.dispose()}}var l1;let aU=(l1=class extends G{constructor(e,t,i,s,o,r,a){super(),this._hoverService=r,this._clipboardService=a,this._renderedParts=[],this._focusedHoverPartIndex=-1,this._context=s,this._fragment=document.createDocumentFragment(),this._register(this._renderParts(t,i,s,o,this._hoverService)),this._register(this._registerListenersOnRenderedParts()),this._register(this._createEditorDecorations(e,i)),this._updateMarkdownAndColorParticipantInfo(t)}_createEditorDecorations(e,t){if(t.length===0)return G.None;let i=t[0].range;for(const o of t){const r=o.range;i=D.plusRange(i,r)}const s=e.createDecorationsCollection();return s.set([{range:i,options:oU._DECORATION_OPTIONS}]),Re(()=>{s.clear()})}_renderParts(e,t,i,s,o){const r=new aO(s,o),a={fragment:this._fragment,statusBar:r,...i},l=new ne;l.add(r);for(const d of e){const h=this._renderHoverPartsForParticipant(t,d,a);l.add(h);for(const u of h.renderedHoverParts)this._renderedParts.push({type:"hoverPart",participant:d,hoverPart:u.hoverPart,hoverElement:u.hoverElement})}const c=this._renderStatusBar(this._fragment,r);return c&&(l.add(c),this._renderedParts.push({type:"statusBar",hoverElement:c.hoverElement,actions:c.actions})),l}_renderHoverPartsForParticipant(e,t,i){const s=e.filter(r=>r.owner===t);return s.length>0?t.renderHoverParts(i,s):new Cw([])}_renderStatusBar(e,t){if(t.hasContent)return new Cnt(e,t)}_registerListenersOnRenderedParts(){const e=new ne;return this._renderedParts.forEach((t,i)=>{const s=t.hoverElement;s.tabIndex=0,e.add(J(s,_e.FOCUS_IN,o=>{o.stopPropagation(),this._focusedHoverPartIndex=i})),e.add(J(s,_e.FOCUS_OUT,o=>{o.stopPropagation(),this._focusedHoverPartIndex=-1})),t.type==="hoverPart"&&t.hoverPart instanceof Jwe&&e.add(new O$(s,()=>t.participant.getAccessibleContent(t.hoverPart),this._clipboardService,this._hoverService))}),e}_updateMarkdownAndColorParticipantInfo(e){const t=e.find(i=>i instanceof vN&&!(i instanceof mO));t&&(this._markdownHoverParticipant=t),this._colorHoverParticipant=e.find(i=>i instanceof cO)}focusHoverPartWithIndex(e){e<0||e>=this._renderedParts.length||this._renderedParts[e].hoverElement.focus()}async updateHoverVerbosityLevel(e,t,i){if(!this._markdownHoverParticipant)return;let s;t>=0?s={start:t,endExclusive:t+1}:s=this._findRangeOfMarkdownHoverParts(this._markdownHoverParticipant);for(let o=s.start;o=0?this.focusHoverPartWithIndex(t):this._context.focus()),this._context.onContentsChanged()}isColorPickerVisible(){var e;return((e=this._colorHoverParticipant)==null?void 0:e.isColorPickerVisible())??!1}_normalizedIndexToMarkdownHoverIndexRange(e,t){const i=this._renderedParts[t];if(!i||i.type!=="hoverPart"||!(i.participant===e))return;const o=this._renderedParts.findIndex(r=>r.type==="hoverPart"&&r.participant===e);if(o===-1)throw new Ve;return t-o}_findRangeOfMarkdownHoverParts(e){const t=this._renderedParts.slice(),i=t.findIndex(r=>r.type==="hoverPart"&&r.participant===e),s=t.reverse().findIndex(r=>r.type==="hoverPart"&&r.participant===e),o=s>=0?t.length-s:s;return{start:i,endExclusive:o+1}}get domNode(){return this._fragment}get domNodeHasChildren(){return this._fragment.hasChildNodes()}get focusedHoverPartIndex(){return this._focusedHoverPartIndex}get hoverPartsCount(){return this._renderedParts.length}},oU=l1,l1._DECORATION_OPTIONS=st.register({description:"content-hover-highlight",className:"hoverHighlight"}),l1);aU=oU=eCe([Sy(4,Vt),Sy(5,Sr),Sy(6,La)],aU);var ynt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W2=function(n,e){return function(t,i){e(t,i,n)}};let lU=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._hoverService=s,this._clipboardService=o,this._currentResult=null,this._renderedContentHover=this._register(new Gt),this._onContentsChanged=this._register(new q),this.onContentsChanged=this._onContentsChanged.event,this._contentHoverWidget=this._register(this._instantiationService.createInstance(T$,this._editor)),this._participants=this._initializeHoverParticipants(),this._hoverOperation=this._register(new wwe(this._editor,new rO(this._editor,this._participants))),this._registerListeners()}_initializeHoverParticipants(){const e=[];for(const t of Uw.getAll()){const i=this._instantiationService.createInstance(t,this._editor);e.push(i)}return e.sort((t,i)=>t.hoverOrdinal-i.hoverOrdinal),this._register(this._contentHoverWidget.onDidResize(()=>{this._participants.forEach(t=>{var i;return(i=t.handleResize)==null?void 0:i.call(t)})})),this._register(this._contentHoverWidget.onDidScroll(t=>{this._participants.forEach(i=>{var s;return(s=i.handleScroll)==null?void 0:s.call(i,t)})})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._participants.forEach(t=>{var i;return(i=t.handleContentsChanged)==null?void 0:i.call(t)})})),e}_registerListeners(){this._register(this._hoverOperation.onResult(t=>{const i=t.hasLoadingMessage?this._addLoadingMessage(t):t.value;this._withResult(new Cwe(i,t.isComplete,t.options))}));const e=this._contentHoverWidget.getDomNode();this._register(kn(e,"keydown",t=>{t.equals(9)&&this.hide()})),this._register(kn(e,"mouseleave",t=>{this._onMouseLeave(t)})),this._register(rn.onDidChange(()=>{this._contentHoverWidget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})),this._register(this._contentHoverWidget.onContentsChanged(()=>{this._onContentsChanged.fire()}))}_startShowingOrUpdateHover(e,t,i,s,o){if(!(this._contentHoverWidget.position&&this._currentResult))return e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1;const a=this._editor.getOption(69).sticky,l=o&&this._contentHoverWidget.isMouseGettingCloser(o.event.posx,o.event.posy);return a&&l?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?this._currentResult&&this._currentResult.options.anchor.equals(e)?!0:this._currentResult&&e.canAdoptVisibleHover(this._currentResult.options.anchor,this._contentHoverWidget.position)?(this._currentResult&&this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){if(this._hoverOperation.options&&this._hoverOperation.options.anchor.equals(e))return;this._hoverOperation.cancel();const a={anchor:e,source:i,shouldFocus:s,insistOnKeepingHoverVisible:o};this._hoverOperation.start(t,a)}_setCurrentResult(e){let t=e;if(this._currentResult===t)return;t&&t.hoverParts.length===0&&(t=null),this._currentResult=t,this._currentResult?this._showHover(this._currentResult):this._hideHover()}_addLoadingMessage(e){for(const t of this._participants){if(!t.createLoadingMessage)continue;const i=t.createLoadingMessage(e.options.anchor);if(i)return e.value.slice(0).concat([i])}return e.value}_withResult(e){if(this._contentHoverWidget.position&&this._currentResult&&this._currentResult.isComplete||this._setCurrentResult(e),!e.isComplete)return;const s=e.hoverParts.length===0,o=e.options.insistOnKeepingHoverVisible;s&&o||this._setCurrentResult(e)}_showHover(e){const t=this._getHoverContext();this._renderedContentHover.value=new rU(this._editor,e,this._participants,t,this._keybindingService,this._hoverService,this._clipboardService),this._renderedContentHover.value.domNodeHasChildren?this._contentHoverWidget.show(this._renderedContentHover.value):this._renderedContentHover.clear()}_hideHover(){this._contentHoverWidget.hide(),this._participants.forEach(e=>{var t;return(t=e.handleHide)==null?void 0:t.call(e)})}_getHoverContext(){return{hide:()=>{this.hide()},onContentsChanged:()=>{this._contentHoverWidget.handleContentsChanged()},setMinimumDimensions:o=>{this._contentHoverWidget.setMinimumDimensions(o)},focus:()=>this.focus()}}showsOrWillShow(e){if(this._contentHoverWidget.isResizing)return!0;const i=this._findHoverAnchorCandidates(e);if(!(i.length>0))return this._startShowingOrUpdateHover(null,0,0,!1,e);const o=i[0];return this._startShowingOrUpdateHover(o,0,0,!1,e)}_findHoverAnchorCandidates(e){const t=[];for(const s of this._participants){if(!s.suggestHoverAnchor)continue;const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;switch(i.type){case 6:{t.push(new Z9(0,i.range,e.event.posx,e.event.posy));break}case 7:{const s=this._editor.getOption(59).typicalHalfwidthCharacterWidth/2;if(!(!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),t}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!G3(t,e.x,e.y))&&this.hide()}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new Z9(0,e,void 0,void 0),t,i,s,null)}async updateHoverVerbosityLevel(e,t,i){var s;(s=this._renderedContentHover.value)==null||s.updateHoverVerbosityLevel(e,t,i)}focusedHoverPartIndex(){var e;return((e=this._renderedContentHover.value)==null?void 0:e.focusedHoverPartIndex)??-1}containsNode(e){return e?this._contentHoverWidget.getDomNode().contains(e):!1}focus(){var t;if(((t=this._renderedContentHover.value)==null?void 0:t.hoverPartsCount)===1){this.focusHoverPartWithIndex(0);return}this._contentHoverWidget.focus()}focusHoverPartWithIndex(e){var t;(t=this._renderedContentHover.value)==null||t.focusHoverPartWithIndex(e)}scrollUp(){this._contentHoverWidget.scrollUp()}scrollDown(){this._contentHoverWidget.scrollDown()}scrollLeft(){this._contentHoverWidget.scrollLeft()}scrollRight(){this._contentHoverWidget.scrollRight()}pageUp(){this._contentHoverWidget.pageUp()}pageDown(){this._contentHoverWidget.pageDown()}goToTop(){this._contentHoverWidget.goToTop()}goToBottom(){this._contentHoverWidget.goToBottom()}hide(){this._hoverOperation.cancel(),this._setCurrentResult(null)}getDomNode(){return this._contentHoverWidget.getDomNode()}get isColorPickerVisible(){var e;return((e=this._renderedContentHover.value)==null?void 0:e.isColorPickerVisible())??!1}get isVisibleFromKeyboard(){return this._contentHoverWidget.isVisibleFromKeyboard}get isVisible(){return this._contentHoverWidget.isVisible}get isFocused(){return this._contentHoverWidget.isFocused}get isResizing(){return this._contentHoverWidget.isResizing}get widget(){return this._contentHoverWidget}};lU=ynt([W2(1,Ae),W2(2,Vt),W2(3,Sr),W2(4,La)],lU);function tCe(n){var t;const e=n.target;return!!e&&e.type===6&&((t=e.detail.injectedText)==null?void 0:t.options.attachedData)===pwe}var Snt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},i6=function(n,e){return function(t,i){e(t,i,n)}},cU,c1;let Do=(c1=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._instantiationService=i,this._keybindingService=s,this._onHoverContentsChanged=this._register(new q),this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new ne,this._isMouseDown=!1,this._ignoreMouseEvents=!1,this._reactToEditorMouseMoveRunner=this._register(new ai(()=>{this._mouseMoveEvent&&this._reactToEditorMouseMove(this._mouseMoveEvent)},0)),this._register(t.onDidShowContextMenu(()=>{this.hideContentHover(),this._ignoreMouseEvents=!0})),this._register(t.onDidHideContextMenu(()=>{this._ignoreMouseEvents=!1})),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(o=>{o.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(cU.ID)}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled||this._cancelSchedulerAndHide(),this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>this._cancelSchedulerAndHide())),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelSchedulerAndHide(){this._cancelScheduler(),this.hideContentHover()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){this._ignoreMouseEvents||(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideContentHover()}_onEditorMouseDown(e){this._ignoreMouseEvents||(this._isMouseDown=!0,this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepHoverWidgetVisible(e){return this._isMouseOnContentHoverWidget(e)||this._isContentWidgetResizing()||tCe(e)}_isMouseOnContentHoverWidget(e){return this._contentWidget?G3(this._contentWidget.getDomNode(),e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._ignoreMouseEvents||(this._isMouseDown=!1)}_onEditorMouseLeave(e){this._ignoreMouseEvents||this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._shouldKeepHoverWidgetVisible(e))||this.hideContentHover()}_shouldKeepCurrentHover(e){const t=this._contentWidget;if(!t)return!1;const i=this._hoverSettings.sticky,s=(d,h)=>{const u=this._isMouseOnContentHoverWidget(d);return h&&u},o=d=>{const h=t.isColorPickerVisible,u=this._isMouseOnContentHoverWidget(d),f=h&&u,g=h&&this._isMouseDown;return f||g},r=(d,h)=>{var f;const u=d.event.browserEvent.view;return u?h&&t.containsNode(u.document.activeElement)&&!((f=u.getSelection())!=null&&f.isCollapsed):!1},a=t.isFocused,l=t.isResizing,c=this._hoverSettings.sticky&&t.isVisibleFromKeyboard;return this.shouldKeepOpenOnEditorMouseMoveOrLeave||a||l||c||s(e,i)||o(e)||r(e,i)}_onEditorMouseMove(e){if(this._ignoreMouseEvents)return;if(this._mouseMoveEvent=e,this._shouldKeepCurrentHover(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(this._shouldRescheduleHoverComputation()){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hoverSettings.hidingDelay);return}this._reactToEditorMouseMove(e)}_shouldRescheduleHoverComputation(){var i;const e=this._hoverSettings.hidingDelay;return(((i=this._contentWidget)==null?void 0:i.isVisible)??!1)&&this._hoverSettings.sticky&&e>0}_reactToEditorMouseMove(e){this._hoverSettings.enabled&&this._getOrCreateContentWidget().showsOrWillShow(e)||this.hideContentHover()}_onKeyDown(e){if(this._ignoreMouseEvents||!this._contentWidget)return;const t=this._isPotentialKeyboardShortcut(e),i=this._isModifierKeyPressed(e);t||i||this._contentWidget.isFocused&&e.keyCode===2||this.hideContentHover()}_isPotentialKeyboardShortcut(e){if(!this._editor.hasModel()||!this._contentWidget)return!1;const t=this._keybindingService.softDispatch(e,this._editor.getDomNode()),i=t.kind===1,s=t.kind===2&&(t.commandId===mwe||t.commandId===q3||t.commandId===K3)&&this._contentWidget.isVisible;return i||s}_isModifierKeyPressed(e){return e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4}hideContentHover(){var e;DS.dropDownVisible||(e=this._contentWidget)==null||e.hide()}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(lU,this._editor),this._listenersStore.add(this._contentWidget.onContentsChanged(()=>this._onHoverContentsChanged.fire()))),this._contentWidget}showContentHover(e,t,i,s){this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}_isContentWidgetResizing(){var e;return((e=this._contentWidget)==null?void 0:e.widget.isResizing)||!1}focusedHoverPartIndex(){return this._getOrCreateContentWidget().focusedHoverPartIndex()}updateHoverVerbosityLevel(e,t,i){this._getOrCreateContentWidget().updateHoverVerbosityLevel(e,t,i)}focus(){var e;(e=this._contentWidget)==null||e.focus()}scrollUp(){var e;(e=this._contentWidget)==null||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)==null||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)==null||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)==null||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)==null||e.pageUp()}pageDown(){var e;(e=this._contentWidget)==null||e.pageDown()}goToTop(){var e;(e=this._contentWidget)==null||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)==null||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)==null?void 0:e.isVisible}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._contentWidget)==null||e.dispose()}},cU=c1,c1.ID="editor.contrib.contentHover",c1);Do=cU=Snt([i6(1,gl),i6(2,Ae),i6(3,Vt)],Do);const yQ=class yQ extends G{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(168);if(t!=="click"&&t!=="clickAndHover"||!tCe(e))return;const i=this._editor.getContribution(Do.ID);if(!i||i.isColorPickerVisible)return;const s=e.target.range;if(!s)return;const o=new D(s.startLineNumber,s.startColumn+1,s.endLineNumber,s.endColumn+1);i.showContentHover(o,1,1,!1)}};yQ.ID="editor.contrib.colorContribution";let vO=yQ;var xnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Lnt=function(n,e){return function(t,i){e(t,i,n)}};class FX{constructor(e,t,i,s){this.owner=e,this.range=t,this.model=i,this.provider=s}static fromBaseColor(e,t){return new FX(e,t.range,t.model,t.provider)}}class knt extends G{constructor(e,t,i,s){super();const o=e.getModel(),r=i.model;this.color=i.model.color,this.colorPicker=this._register(new Rwe(t.fragment,r,e.getOption(163),s,"standalone")),this._register(r.onColorFlushed(a=>{this.color=a})),this._register(r.onDidChangeColor(a=>{wN(o,r,a,i.range,i)})),this._register(e.onDidChangeModelContent(a=>{t.hide(),e.focus()})),wN(o,r,this.color,i.range,i)}}let dU=class{constructor(e,t){this._editor=e,this._themeService=t}async createColorHover(e,t,i){if(!this._editor.hasModel()||!NS.get(this._editor))return null;const o=await uwe(i,this._editor.getModel(),wt.None);let r=null,a=null;for(const u of o){const f=u.colorInfo;D.containsRange(f.range,e.range)&&(r=f,a=u.provider)}const l=r??e,c=a??t,d=!!r;return{colorHover:FX.fromBaseColor(this,await Mwe(this._editor.getModel(),l,c)),foundInEditor:d}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let i=new D(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await wN(this._editor.getModel(),t,this._color,i,e),i=Awe(this._editor,i,t))}renderHoverParts(e,t){if(!(t.length===0||!this._editor.hasModel()))return this._setMinimumDimensions(e),this._renderedParts=new knt(this._editor,e,t[0],this._themeService),this._renderedParts}_setMinimumDimensions(e){const t=this._editor.getOption(75)+8;e.setMinimumDimensions(new Jt(302,t))}get _color(){var e;return(e=this._renderedParts)==null?void 0:e.color}};dU=xnt([Lnt(1,en)],dU);var Int=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},fL=function(n,e){return function(t,i){e(t,i,n)}},hU;class Ent{constructor(e,t){this.value=e,this.foundInEditor=t}}const Uae=8,Nnt=22;var d1;let uU=(d1=class extends G{constructor(e,t,i,s,o,r,a,l){var u;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._keybindingService=o,this._languageFeaturesService=r,this._editorWorkerService=a,this._hoverService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new q),this.onResult=this._onResult.event,this._renderedHoverParts=this._register(new Gt),this._renderedStatusBar=this._register(new Gt),this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=s.createInstance(dU,this._editor),this._position=(u=this._editor._getViewModel())==null?void 0:u.getPrimaryCursorState().modelState.position;const c=this._editor.getSelection(),d=c?{startLineNumber:c.startLineNumber,startColumn:c.startColumn,endLineNumber:c.endLineNumber,endColumn:c.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(tc(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var p;const g=(p=f.target.element)==null?void 0:p.classList;g&&g.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return hU.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(69).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Ent(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=await this._standaloneColorPickerParticipant.createColorHover(t,new _N(this._editorWorkerService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}_render(e,t){const i=document.createDocumentFragment();this._renderedStatusBar.value=this._register(new aO(this._keybindingService,this._hoverService));const s={fragment:i,statusBar:this._renderedStatusBar.value,onContentsChanged:()=>{},setMinimumDimensions:()=>{},hide:()=>this.hide(),focus:()=>this.focus()};if(this._colorHover=e,this._renderedHoverParts.value=this._standaloneColorPickerParticipant.renderHoverParts(s,[e]),!this._renderedHoverParts.value){this._renderedStatusBar.clear(),this._renderedHoverParts.clear();return}const o=this._renderedHoverParts.value.colorPicker;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),o.layout();const r=o.body,a=r.saturationBox.domNode.clientWidth,l=r.domNode.clientWidth-a-Nnt-Uae,c=o.body.enterButton;c==null||c.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=a+Uae+"px";const u=d.originalColorNode;u.style.width=l+"px";const f=o.header.closeButton;f==null||f.onClicked(()=>{this.hide()}),t&&(c&&(c.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}},hU=d1,d1.ID="editor.contrib.standaloneColorPickerWidget",d1);uU=hU=Int([fL(3,Ae),fL(4,Vt),fL(5,De),fL(6,Qr),fL(7,Sr)],uU);var Dnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qae=function(n,e){return function(t,i){e(t,i,n)}},fU,h1;let xw=(h1=class extends G{constructor(e,t,i){super(),this._editor=e,this._instantiationService=i,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=H.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=H.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)==null||e.focus():this._standaloneColorPickerWidget=this._instantiationService.createInstance(uU,this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)==null||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)==null||e.updateEditor(),this.hide()}static get(e){return e.getContribution(fU.ID)}},fU=h1,h1.ID="editor.contrib.standaloneColorPickerController",h1);xw=fU=Dnt([qae(1,Xe),qae(2,Ae)],xw);class Tnt extends Jc{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...ie(889,"Show or Focus Standalone Color Picker"),mnemonicTitle:_(888,"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:Te.CommandPalette}],metadata:{description:ie(890,"Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors.")}})}runEditorCommand(e,t){var i;(i=xw.get(t))==null||i.showOrFocus()}}class Rnt extends Ne{constructor(){super({id:"editor.action.hideColorPicker",label:ie(891,"Hide the Color Picker"),precondition:H.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100},metadata:{description:ie(892,"Hide the standalone color picker.")}})}run(e,t){var i;(i=xw.get(t))==null||i.hide()}}class Mnt extends Ne{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:ie(893,"Insert Color with Standalone Color Picker"),precondition:H.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100},metadata:{description:ie(894,"Insert hex/rgb/hsl colors with the focused standalone color picker.")}})}run(e,t){var i;(i=xw.get(t))==null||i.insertColor()}}we(Rnt);we(Mnt);ni(Tnt);At(vO.ID,vO,2);At(xw.ID,xw,1);At(NS.ID,NS,1);hx(k$);Uw.register(cO);Rt.registerCommand("_executeDocumentColorProvider",function(n,...e){const[t]=e;if(!(t instanceof He))throw ql();const{model:i,colorProviderRegistry:s,defaultColorDecoratorsEnablement:o}=gwe(n,t);return xX(new dtt,s,i,wt.None,o)});Rt.registerCommand("_executeColorPresentationProvider",function(n,...e){const[t,i]=e;if(!i)return;const{uri:s,range:o}=i;if(!(s instanceof He)||!Array.isArray(t)||t.length!==4||!D.isIRange(o))throw ql();const{model:r,colorProviderRegistry:a,defaultColorDecoratorsEnablement:l}=gwe(n,s),[c,d,h,u]=t;return xX(new htt({range:o,color:{red:c,green:d,blue:h,alpha:u}}),a,r,wt.None,l)});class am{constructor(e,t,i){this.languageConfigurationService=i,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,i){if(i<0)return!1;const s=t.length,o=e.length;if(i+s>o)return!1;for(let r=0;r=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,i,s,o,r){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,d=e.endColumn,h=o.getLineContent(a),u=o.getLineContent(c);let f=h.lastIndexOf(t,l-1+t.length),g=u.indexOf(i,d-1-i.length);if(f!==-1&&g!==-1)if(a===c)h.substring(f+t.length,g).indexOf(i)>=0&&(f=-1,g=-1);else{const m=h.substring(f+t.length),b=u.substring(0,g);(m.indexOf(i)>=0||b.indexOf(i)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(s&&f+t.length0&&u.charCodeAt(g-1)===32&&(i=" "+i,g-=1),p=am._createRemoveBlockCommentOperations(new D(a,f+t.length+1,c,g+1),t,i)):(p=am._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=p.length===1?i:null);for(const m of p)r.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,i){const s=[];return D.isEmpty(e)?s.push(ln.delete(new D(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(s.push(ln.delete(new D(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),s.push(ln.delete(new D(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),s}static _createAddBlockCommentOperations(e,t,i,s){const o=[];return D.isEmpty(e)?o.push(ln.replace(new D(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(o.push(ln.insert(new U(e.startLineNumber,e.startColumn),t+(s?" ":""))),o.push(ln.insert(new U(e.endLineNumber,e.endColumn),(s?" ":"")+i))),o}getEditOperations(e,t){const i=this._selection.startLineNumber,s=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const o=e.getLanguageIdAtPosition(i,s),r=this.languageConfigurationService.getLanguageConfiguration(o).comments;!r||!r.blockCommentStartToken||!r.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,r.blockCommentStartToken,r.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(i.length===2){const s=i[0],o=i[1];return new Ie(s.range.endLineNumber,s.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const s=i[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ie(s.endLineNumber,s.endColumn+o,s.endLineNumber,s.endColumn+o)}}}class mf{constructor(e,t,i,s,o,r,a){this.languageConfigurationService=e,this._selection=t,this._indentSize=i,this._type=s,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=r,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,i,s){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),r=s.getLanguageConfiguration(o).comments,a=r?r.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,d=i-t+1;co?t[l].commentStrOffset=r-1:t[l].commentStrOffset=r}}}class BX extends Ne{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(qi);if(!t.hasModel())return;const s=t.getModel(),o=[],r=s.getOptions(),a=t.getOption(29),l=t.getSelections().map((d,h)=>({selection:d,index:h,ignoreFirstLine:!1}));l.sort((d,h)=>D.compareRangesUsingStarts(d.selection,h.selection));let c=l[0];for(let d=1;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q_=function(n,e){return function(t,i){e(t,i,n)}},gU,u1;let SN=(u1=class{static get(e){return e.getContribution(gU.ID)}constructor(e,t,i,s,o,r,a,l){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=s,this._keybindingService=o,this._menuService=r,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new ne,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const d=this._contextViewService.getContextViewElement(),h=c.srcElement;h.shadowRoot&&e_(d)===h.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(30)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(30)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let i=!1;for(const s of this._editor.getSelections())if(s.containsPosition(e.target.position)){i=!0;break}i||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(30)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.contextMenuId);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],s=this._menuService.getMenuActions(t,this._contextKeyService,{arg:e.uri});for(const o of s){const[,r]=o;let a=0;for(const l of r)if(l instanceof kv){const c=this._getMenuActions(e,l.item.submenu);c.length>0&&(i.push(new cS(l.id,l.label,c)),a++)}else i.push(l),a++;a&&i.push(new Zn)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;let i=t;if(!i){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const o=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),r=dn(this._editor.getDomNode()),a=r.left+o.left,l=r.top+o.top+o.height;i={x:a,y:l}}const s=this._editor.getOption(144)&&!Jl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getOverflowWidgetsDomNode()??this._editor.getDomNode():void 0,getAnchor:()=>i,getActions:()=>e,getActionViewItem:o=>{const r=this._keybindingFor(o);if(r)return new xS(o,o,{label:!0,keybinding:r.getLabel(),isMenu:!0});const a=o;return typeof a.getActionViewItem=="function"?a.getActionViewItem():new xS(o,o,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:o=>this._keybindingFor(o),onHide:o=>{this._contextMenuIsBeingShownCount--}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||xqe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(81);let i=0;const s=c=>({id:`menu-action-${++i}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,d)=>new cS(`menu-action-${++i}`,c,d,void 0),r=(c,d,h,u,f)=>{if(!d)return s({label:c,enabled:d,run:()=>{}});const g=m=>()=>{this._configurationService.updateValue(h,m)},p=[];for(const m of f)p.push(s({label:m.label,checked:u===m.value,run:g(m.value)}));return o(c,p)},a=[];a.push(s({label:_(901,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new Zn),a.push(s({label:_(902,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(r(_(903,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:_(904,"Proportional"),value:"proportional"},{label:_(905,"Fill"),value:"fill"},{label:_(906,"Fit"),value:"fit"}])),a.push(r(_(907,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:_(908,"Mouse Over"),value:"mouseover"},{label:_(909,"Always"),value:"always"}]));const l=this._editor.getOption(144)&&!Jl;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}},gU=u1,u1.ID="editor.contrib.contextmenu",u1);SN=gU=Bnt([Q_(1,gl),Q_(2,zg),Q_(3,Xe),Q_(4,Vt),Q_(5,lc),Q_(6,lt),Q_(7,Rg)],SN);class Wnt extends Ne{constructor(){super({id:"editor.action.showContextMenu",label:ie(910,"Show Editor Context Menu"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;(i=SN.get(t))==null||i.showContextMenu()}}At(SN.ID,SN,2);we(Wnt);class n6{constructor(e){this.selections=e}equals(e){const t=this.selections.length,i=e.selections.length;if(t!==i)return!1;for(let s=0;s{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const i=new n6(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new s6(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new s6(new n6(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new s6(new n6(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}};_F.ID="editor.contrib.cursorUndoRedoController";let AS=_F;class Hnt extends Ne{constructor(){super({id:"cursorUndo",label:ie(911,"Cursor Undo"),precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var s;(s=AS.get(t))==null||s.cursorUndo()}}class Vnt extends Ne{constructor(){super({id:"cursorRedo",label:ie(912,"Cursor Redo"),precondition:void 0})}run(e,t,i){var s;(s=AS.get(t))==null||s.cursorRedo()}}At(AS.ID,AS,0);we(Hnt);we(Vnt);class znt{constructor(e,t,i){this.selection=e,this.targetPosition=t,this.copy=i,this.targetSelection=null}getEditOperations(e,t){const i=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new D(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),i),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new Ie(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new Ie(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(42)||this._editor.getOption(28)||(xC(e)&&(this._modifierPressed=!0),this._mouseDown&&xC(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(42)||this._editor.getOption(28)||(xC(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===Np.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const s=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(s.length===1)this._dragSelection=s[0];else return}xC(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new U(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let i=null;if(e.event.shiftKey){const s=this._editor.getSelection();if(s){const{selectionStartLineNumber:o,selectionStartColumn:r}=s;i=[new Ie(o,r,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map(s=>s.containsPosition(t)?new Ie(t.lineNumber,t.column,t.lineNumber,t.column):s);this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(xC(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(Np.ID,new znt(this._dragSelection,t,xC(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new D(e.lineNumber,e.column,e.lineNumber,e.column),options:Np._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}};Np.ID="editor.contrib.dragAndDrop",Np.TRIGGER_KEY_VALUE=yt?6:5,Np._DECORATION_OPTIONS=st.register({description:"dnd-target",className:"dnd-target"});let wO=Np;At(wO.ID,wO,2);const jnt="editor.action.pasteAs";At(Ag.ID,Ag,0);hx(u$);ye(new class extends hs{constructor(){super({id:J1e,precondition:wX,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e){var t;return(t=Ag.get(e))==null?void 0:t.changePasteType()}});ye(new class extends hs{constructor(){super({id:"editor.hidePasteWidget",precondition:wX,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e){var t;(t=Ag.get(e))==null||t.clearWidgets()}});var f1;we((f1=class extends Ne{constructor(){super({id:jnt,label:ie(915,"Paste As..."),precondition:H.writable,metadata:{description:"Paste as",args:[{name:"args",schema:f1.argsSchema}]},canTriggerInlineEdits:!0})}run(e,t,i){var o;let s;return i&&("kind"in i?s={only:new Qi(i.kind)}:"preferences"in i&&(s={preferences:i.preferences.map(r=>new Qi(r))})),(o=Ag.get(t))==null?void 0:o.pasteAs(s)}},f1.argsSchema={oneOf:[{type:"object",required:["kind"],properties:{kind:{type:"string",description:_(913,`The kind of the paste edit to try pasting with. If there are multiple edits for this kind, the editor will show a picker. If there are no edits of this kind, the editor will show an error message.`)}}},{type:"object",required:["preferences"],properties:{preferences:{type:"array",description:_(914,`List of preferred paste edit kind to try applying. -The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]},m1));we(class extends Ne{constructor(){super({id:"editor.action.pasteAsText",label:ie(916,"Paste as Text"),precondition:H.writable,canTriggerInlineEdits:!0})}run(n,e){var t;return(t=Ag.get(e))==null?void 0:t.pasteAs({providerId:bw.id})}});class qnt{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Yae{constructor(e){this.identifier=e}}const rCe=mt("treeViewsDndService");xt(rCe,qnt,1);var Knt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W2=function(n,e){return function(t,i){e(t,i,n)}},cf;const Gnt="editor.dropIntoEditor.preferences",aCe="editor.changeDropType",HX=new Se("dropWidgetVisible",!1,_(934,"Whether the drop widget is showing"));var _1;let FS=(_1=class extends G{static get(e){return e.getContribution(cf.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=d$.getInstance(),this._dropProgressManager=this._register(t.createInstance(tO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(oO,"dropIntoEditor",e,HX,{id:aCe,label:_(935,"Show drop options...")},()=>cf._configureDefaultAction?[cf._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var o;if(!i.dataTransfer||!e.hasModel())return;(o=cf._currentDropOperation)==null||o.cancel(),e.focus(),e.setPosition(t);const s=ss(async r=>{const a=new ne,l=a.add(new Mg(e,1,void 0,r));try{const c=await this.extractDataTransferData(i);if(c.size===0||l.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const h=this._languageFeaturesService.documentDropEditProvider.ordered(d).filter(f=>f.dropMimeTypes?f.dropMimeTypes.some(g=>c.matches(g)):!0),u=a.add(await this.getDropEdits(h,d,t,c,l.token));if(l.token.isCancellationRequested)return;if(u.edits.length){const f=this.getInitialActiveEditIndex(d,u.edits),g=e.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([D.fromPositions(t)],{activeEditIndex:f,allEdits:u.edits},g,async p=>p,r)}}finally{a.dispose(),cf._currentDropOperation===s&&(cf._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,_(936,"Running drop handlers. Click to cancel"),s,{cancel:()=>s.cancel()}),cf._currentDropOperation=s}async getDropEdits(e,t,i,s,o){const r=new ne,a=await lS(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,s,o);return d&&r.add(d),d==null?void 0:d.edits.map(h=>({...h,providerId:c.id}))}catch(d){fl(d)||console.error(d),console.error(d)}})),o),l=rh(a??[]).flat();return{edits:Q1e(l),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(Gnt,{resource:e.uri});for(const s of Array.isArray(i)?i:[]){const o=new Qi(s),r=t.findIndex(a=>a.kind&&o.contains(a.kind));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new j1e;const t=K1e(e.dataTransfer);if(this.treeItemsTransfer.hasData(Yae.prototype)){const i=this.treeItemsTransfer.getData(Yae.prototype);if(Array.isArray(i))for(const s of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},cf=_1,_1.ID="editor.contrib.dropIntoEditorController",_1);FS=cf=Knt([W2(1,Ae),W2(2,lt),W2(3,De),W2(4,rCe)],FS);At(FS.ID,FS,2);fx(u$);ye(new class extends cs{constructor(){super({id:aCe,precondition:HX,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=FS.get(e))==null||i.changeDropType()}});ye(new class extends cs{constructor(){super({id:"editor.hideDropWidget",precondition:HX,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e,t){var i;(i=FS.get(e))==null||i.clearWidgets()}});const bF=class bF extends Na{constructor(e,t,i){super(),this._hideSoon=this._register(new ai(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:pe(mD),inputActiveOptionForeground:pe(_D),inputActiveOptionBackground:pe(ox)},o={groupId:"find-options-widget"};this.caseSensitive=this._register(new bve({appendTitle:this._keybindingLabelFor(xi.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new vve({appendTitle:this._keybindingLabelFor(xi.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new wve({appendTitle:this._keybindingLabelFor(xi.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(J(this._domNode,_e.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(J(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return bF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};bF.ID="editor.contrib.findOptionsWidget";let mU=bF;function H2(n,e){return n===1?!0:n===2?!1:e}class Ynt extends G{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return H2(this._isRegexOverride,this._isRegex)}get wholeWord(){return H2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return H2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return H2(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new q),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(D.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var d;const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&((d=e.searchScope)!=null&&d.every(h=>{var u;return(u=this._searchScope)==null?void 0:u.some(f=>!D.equalsRange(f,h))})||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),l!==this.matchCase&&(o=!0,s.matchCase=!0),c!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=am}}var Znt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xnt=function(n,e){return function(t,i){e(t,i,n)}},bp,Vm;let _U=(Vm=class{static getOrCreate(e){return bp._instance||(bp._instance=new bp(e)),bp._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new q,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(bp.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(bp.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},bp=Vm,Vm.FIND_HISTORY_KEY="workbench.find.history",Vm._instance=null,Vm);_U=bp=Znt([Xnt(0,Qo)],_U);var Qnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jnt=function(n,e){return function(t,i){e(t,i,n)}},vp,zm;let bU=(zm=class{static getOrCreate(e){return vp._instance||(vp._instance=new vp(e)),vp._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new q,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(vp.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(vp.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},vp=zm,zm.FIND_HISTORY_KEY="workbench.replace.history",zm._instance=null,zm);bU=vp=Qnt([Jnt(0,Qo)],bU);var lCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Tc=function(n,e){return function(t,i){e(t,i,n)}},vU;const est=524288;function wU(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Y3.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=va(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=wU(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=va(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=wU(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new $k(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?(e=this._editor.getModel())!=null&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(_(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},vU=b1,b1.ID="editor.contrib.findController",b1);Gr=vU=lCe([Tc(1,Xe),Tc(2,Qo),Tc(3,xa),Tc(4,fn),Tc(5,Cr)],Gr);let CU=class extends Gr{constructor(e,t,i,s,o,r,a,l){super(e,i,r,a,o,l),this._contextViewService=t,this._keybindingService=s,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=_U.getOrCreate(r),this._replaceWidgetHistory=bU.getOrCreate(r)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new O$(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new mU(this._editor,this._state,this._keybindingService))}saveViewState(){var e;return(e=this._widget)==null?void 0:e.getViewState()}restoreViewState(e){var t;(t=this._widget)==null||t.setViewState(e)}};CU=lCe([Tc(1,zg),Tc(2,Xe),Tc(3,Ht),Tc(4,fn),Tc(5,Qo),Tc(6,xa),Tc(7,Cr)],CU);const tst=e3(new J5({id:xi.StartFindAction,label:ie(947,"Find"),precondition:le.or(H.focus,le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:_(941,"&&Find"),order:1}}));tst.addImplementation(0,(n,e,t)=>{const i=Gr.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}):!1});const ist={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class nst extends Ne{constructor(){super({id:xi.StartFindWithArgs,label:ie(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:ist})}async run(e,t,i){const s=Gr.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(50).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}}}class sst extends Ne{constructor(){super({id:xi.StartFindWithSelection,label:ie(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=Gr.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}async function cCe(n,e){const t=Gr.get(n);if(!t)return;const i=()=>(e?t.moveToNextMatch():t.moveToPrevMatch())?(t.editor.pushUndoStop(),!0):!1;i()||(await t.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getState().searchString.length===0&&n.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(50).loop}),i())}const ost=e3(new J5({id:xi.NextMatchFindAction,label:ie(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:H.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:le.and(H.focus,Y3),primary:3,weight:100}]}));ost.addImplementation(0,async(n,e,t)=>cCe(e,!0));const rst=e3(new J5({id:xi.PreviousMatchFindAction,label:ie(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:H.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:le.and(H.focus,Y3),primary:1027,weight:100}]}));rst.addImplementation(0,async(n,e,t)=>cCe(e,!1));class ast extends Ne{constructor(){super({id:xi.GoToMatchFindAction,label:ie(952,"Go to Match..."),precondition:Gg}),this._highlightDecorations=[]}run(e,t,i){const s=Gr.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(fn).notify({severity:lx.Warning,message:_(942,"No matches. Try searching for something else.")});return}const r=e.get(Do),a=new ne,l=a.add(r.createInputBox());l.placeholder=_(943,"Type a number to go to a specific match (between 1 and {0})",o);const c=h=>{const u=parseInt(h);if(isNaN(u))return;const f=s.getState().matchesCount;if(u>0&&u<=f)return u-1;if(u<0&&u>=-f)return f+u},d=h=>{const u=c(h);if(typeof u=="number"){l.validationMessage=void 0,s.goToMatch(u);const f=s.getState().currentMatch;f&&this.addDecorations(t,f)}else l.validationMessage=_(944,"Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(h=>{d(h)})),a.add(l.onDidAccept(()=>{const h=c(l.value);typeof h=="number"?(s.goToMatch(h),l.hide()):l.validationMessage=_(945,"Please type a number between 1 and {0}",s.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:an(Gme),position:ll.Full}}}])})}}class dCe extends Ne{async run(e,t){const i=Gr.get(t);if(!i)return;const s=wU(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}class lst extends dCe{constructor(){super({id:xi.NextSelectionMatchFindAction,label:ie(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class cst extends dCe{constructor(){super({id:xi.PreviousSelectionMatchFindAction,label:ie(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const dst=e3(new J5({id:xi.StartFindReplaceAction,label:ie(955,"Replace"),precondition:le.or(H.focus,le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:_(946,"&&Replace"),order:2}}));dst.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(104))return!1;const i=Gr.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(50).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop})});At(Gr.ID,CU,0);we(nst);we(sst);we(ast);we(lst);we(cst);const lh=cs.bindToContribution(Gr.get);ye(new lh({id:xi.CloseFindWidgetCommand,precondition:Gg,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:le.and(H.focus,le.not("isComposing")),primary:9,secondary:[1033]}}));ye(new lh({id:xi.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:H.focus,primary:I2.primary,mac:I2.mac,win:I2.win,linux:I2.linux}}));ye(new lh({id:xi.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:H.focus,primary:N2.primary,mac:N2.mac,win:N2.win,linux:N2.linux}}));ye(new lh({id:xi.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:H.focus,primary:D2.primary,mac:D2.mac,win:D2.win,linux:D2.linux}}));ye(new lh({id:xi.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:H.focus,primary:T2.primary,mac:T2.mac,win:T2.win,linux:T2.linux}}));ye(new lh({id:xi.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:H.focus,primary:R2.primary,mac:R2.mac,win:R2.win,linux:R2.linux}}));ye(new lh({id:xi.ReplaceOneAction,precondition:Gg,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:H.focus,primary:3094}}));ye(new lh({id:xi.ReplaceOneAction,precondition:Gg,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:le.and(H.focus,IX),primary:3}}));ye(new lh({id:xi.ReplaceAllAction,precondition:Gg,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:H.focus,primary:2563}}));ye(new lh({id:xi.ReplaceAllAction,precondition:Gg,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:le.and(H.focus,IX),primary:void 0,mac:{primary:2051}}}));ye(new lh({id:xi.SelectAllMatchesAction,precondition:Gg,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:H.focus,primary:515}}));const hst={0:" ",1:"u",2:"r"},Zae=65535,Ld=16777215,Xae=4278190080;class o6{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<Zae)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new o6(e.length),this._userDefinedStates=new o6(e.length),this._recoveredStates=new o6(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iLd||r>Ld)throw new Error("startLineNumber or endLineNumber must not exceed "+Ld);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Ld}getEndLineNumber(e){return this._endIndexes[e]&Ld}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&Xae)>>>16);return t===Zae?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?v=>vv=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?m=h:(m=d,m.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!(s!=null&&s.startsInside(d.startLineNumber+1,d.endLineNumber+1))),m.source=0),d=r(++l)):(m=h,h.isCollapsed&&h.source===0&&(m.source=2)),h=a(++c);else{let b=c,v=h;for(;;){if(!v||v.startLineNumber>d.endLineNumber){m=d;break}if(v.source===1&&v.endLineNumber>d.endLineNumber)break;v=a(++b)}d=r(++l)}if(m){for(;f&&f.endLineNumberm.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!f||f.endLineNumber>=m.endLineNumber)&&(p.push(m),g=m.startLineNumber,f&&u.push(f),f=m)}}return p}}class ust{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class fst{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new q,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ga(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,s=this._regions.length;i=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??0})}const s=Ga.sanitizeAndMerge(this._regions,t,i);this.updatePost(Ga.fromFoldRanges(s))}_getLinesChecksum(e,t){return dD(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==r&&c0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function gst(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function pst(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function uCe(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function zX(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function jX(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function mst(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function _st(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function bst(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||r_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return Qae(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!wst(r,s))&&(s=Qae(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function wst(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function Qae(n,e){const t=bI(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const Cst=5e3,yst="indent";class $X{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=yst}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Lst(this.editorModel,i,s,this.foldingRangesLimit))}}let Sst=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Ld||t>Ld)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new Ga(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=y3(h,o);(u{}};function Lst(n,e,t,i=xst){const s=n.getOptions().tabSize,o=new Sst(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),h=y3(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,u=a[g],o.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const g=u.endAbove-1;g-c>=1&&o.insertFirst(c,g,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return o.toIndentRanges(n)}const kst=F("editor.foldBackground",{light:st(Xp,.3),dark:st(Xp,.3),hcDark:null,hcLight:null},_(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},_(1003,"Color of the collapsed text after the first line of a folded range."));F("editorGutter.foldingControlForeground",PA,_(1004,"Color of the folding control in the editor gutter."));const CO=Ai("folding-expanded",de.chevronDown,_(1005,"Icon for expanded ranges in the editor glyph margin.")),yO=Ai("folding-collapsed",de.chevronRight,_(1006,"Icon for collapsed ranges in the editor glyph margin.")),Jae=Ai("folding-manual-collapsed",yO,_(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),ele=Ai("folding-manual-expanded",CO,_(1008,"Icon for manually expanded ranges in the editor glyph margin.")),r6={color:an(kst),position:1},DC=_(1009,"Click to expand the range."),V2=_(1010,"Click to collapse the range."),zn=class zn{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?zn.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?zn.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:zn.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:zn.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?zn.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:zn.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?zn.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:zn.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?zn.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:zn.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?zn.MANUALLY_EXPANDED_VISUAL_DECORATION:zn.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};zn.COLLAPSED_VISUAL_DECORATION=nt.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:DC,firstLineDecorationClassName:Ue.asClassName(yO)}),zn.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=nt.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:DC,firstLineDecorationClassName:Ue.asClassName(yO)}),zn.MANUALLY_COLLAPSED_VISUAL_DECORATION=nt.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:DC,firstLineDecorationClassName:Ue.asClassName(Jae)}),zn.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=nt.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:DC,firstLineDecorationClassName:Ue.asClassName(Jae)}),zn.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=nt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:DC}),zn.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=nt.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:DC}),zn.EXPANDED_VISUAL_DECORATION=nt.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(CO),linesDecorationsTooltip:V2}),zn.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=nt.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(CO),linesDecorationsTooltip:V2}),zn.MANUALLY_EXPANDED_VISUAL_DECORATION=nt.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Ue.asClassName(ele),linesDecorationsTooltip:V2}),zn.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=nt.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Ue.asClassName(ele),linesDecorationsTooltip:V2}),zn.NO_CONTROLS_EXPANDED_RANGE_DECORATION=nt.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),zn.HIDDEN_RANGE_DECORATION=nt.register({description:"folding-hidden-range-decoration",stickiness:1});let yU=zn;const Est={},Ist="syntax";class UX{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=Ist,this.disposables=new ne,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return Nst(this.providers,this.editorModel,e).then(t=>{var i;return this.editorModel.isDisposed()?null:t?Tst(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function Nst(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,Est,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},Bn));return Promise.all(s).then(o=>i)}class Dst{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Ld||t>Ld)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new Dst(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var Rst=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gL=function(n,e){return function(t,i){e(t,i,n)}},wb;const qs=new Se("foldingEnabled",!1);var v1;let u_=(v1=class extends G{static get(e){return e.getContribution(wb.ID)}static getFoldingRangeProviders(e,t){var s;const i=e.foldingRangeProvider.ordered(t);return((s=wb._foldingRangeSelector)==null?void 0:s.call(wb,i,t))??i}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new ne),this.editor=e,this._foldingLimitReporter=this._register(new fCe(e));const a=this.editor.getOptions();this._isEnabled=a.get(52),this._useFoldingProviders=a.get(53)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(55),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new yU(e),this.foldingDecorationProvider.showFoldingControls=a.get(126),this.foldingDecorationProvider.showFoldingHighlights=a.get(54),this.foldingEnabled=qs.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(56)&&this.onModelChanged(),l.hasChanged(126)||l.hasChanged(54)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(126),this.foldingDecorationProvider.showFoldingHighlights=c.get(54),this.triggerFoldingModelChanged()}l.hasChanged(53)&&(this._useFoldingProviders=this.editor.getOptions().get(53)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),l.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new fst(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new vst(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new sc(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new ai(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)==null||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new $X(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=wb.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new UX(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new xs,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=ss(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=o.setCollapsedAllOfType(yg.Imports.value,!0);c&&(r=nh.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(o,Mst(a)),r==null||r.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Je(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,Je)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},wb=v1,v1.ID="editor.contrib.folding",v1);u_=wb=Rst([gL(1,Xe),gL(2,Ki),gL(3,fn),gL(4,pc),gL(5,De)],u_);class fCe extends G{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new q),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class fo extends Ne{runEditorCommand(e,t,i){const s=e.get(Ki),o=u_.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Mst(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const s=i.startLineNumber;if(s>=e&&s<=t)return!0}return!1}}}function gCe(n){if(!ko(n)){if(!ns(n))return!1;const e=n;if(!ko(e.levels)&&!wg(e.levels)||!ko(e.direction)&&!ws(e.direction)||!ko(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(wg)))return!1}return!0}class Ast extends fo{constructor(){super({id:"editor.unfold",label:ie(982,"Unfold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: +The first edit matching the preferences will be applied.`),items:{type:"string"}}}}]},f1));we(class extends Ne{constructor(){super({id:"editor.action.pasteAsText",label:ie(916,"Paste as Text"),precondition:H.writable,canTriggerInlineEdits:!0})}run(n,e){var t;return(t=Ag.get(e))==null?void 0:t.pasteAs({providerId:pw.id})}});class $nt{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Kae{constructor(e){this.identifier=e}}const iCe=mt("treeViewsDndService");Lt(iCe,$nt,1);var Unt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},H2=function(n,e){return function(t,i){e(t,i,n)}},cf;const qnt="editor.dropIntoEditor.preferences",nCe="editor.changeDropType",WX=new Se("dropWidgetVisible",!1,_(934,"Whether the drop widget is showing"));var g1;let PS=(g1=class extends G{static get(e){return e.getContribution(cf.ID)}constructor(e,t,i,s,o){super(),this._configService=i,this._languageFeaturesService=s,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=c$.getInstance(),this._dropProgressManager=this._register(t.createInstance(tO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(oO,"dropIntoEditor",e,WX,{id:nCe,label:_(935,"Show drop options...")},()=>cf._configureDefaultAction?[cf._configureDefaultAction]:[])),this._register(e.onDropIntoEditor(r=>this.onDropIntoEditor(e,r.position,r.event)))}clearWidgets(){this._postDropWidgetManager.clear()}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,i){var o;if(!i.dataTransfer||!e.hasModel())return;(o=cf._currentDropOperation)==null||o.cancel(),e.focus(),e.setPosition(t);const s=rs(async r=>{const a=new ne,l=a.add(new Mg(e,1,void 0,r));try{const c=await this.extractDataTransferData(i);if(c.size===0||l.token.isCancellationRequested)return;const d=e.getModel();if(!d)return;const h=this._languageFeaturesService.documentDropEditProvider.ordered(d).filter(f=>f.dropMimeTypes?f.dropMimeTypes.some(g=>c.matches(g)):!0),u=a.add(await this.getDropEdits(h,d,t,c,l.token));if(l.token.isCancellationRequested)return;if(u.edits.length){const f=this.getInitialActiveEditIndex(d,u.edits),g=e.getOption(43).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([D.fromPositions(t)],{activeEditIndex:f,allEdits:u.edits},g,async p=>p,r)}}finally{a.dispose(),cf._currentDropOperation===s&&(cf._currentDropOperation=void 0)}});this._dropProgressManager.showWhile(t,_(936,"Running drop handlers. Click to cancel"),s,{cancel:()=>s.cancel()}),cf._currentDropOperation=s}async getDropEdits(e,t,i,s,o){const r=new ne,a=await rS(Promise.all(e.map(async c=>{try{const d=await c.provideDocumentDropEdits(t,i,s,o);return d&&r.add(d),d==null?void 0:d.edits.map(h=>({...h,providerId:c.id}))}catch(d){fl(d)||console.error(d),console.error(d)}})),o),l=lh(a??[]).flat();return{edits:G1e(l),dispose:()=>r.dispose()}}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(qnt,{resource:e.uri});for(const s of Array.isArray(i)?i:[]){const o=new Qi(s),r=t.findIndex(a=>a.kind&&o.contains(a.kind));if(r>=0)return r}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new W1e;const t=j1e(e.dataTransfer);if(this.treeItemsTransfer.hasData(Kae.prototype)){const i=this.treeItemsTransfer.getData(Kae.prototype);if(Array.isArray(i))for(const s of i){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(s.identifier);if(o)for(const[r,a]of o)t.replace(r,a)}}return t}},cf=g1,g1.ID="editor.contrib.dropIntoEditorController",g1);PS=cf=Unt([H2(1,Ae),H2(2,lt),H2(3,De),H2(4,iCe)],PS);At(PS.ID,PS,2);hx(h$);ye(new class extends hs{constructor(){super({id:nCe,precondition:WX,kbOpts:{weight:100,primary:2137}})}runEditorCommand(n,e,t){var i;(i=PS.get(e))==null||i.changeDropType()}});ye(new class extends hs{constructor(){super({id:"editor.hideDropWidget",precondition:WX,kbOpts:{weight:100,primary:9}})}runEditorCommand(n,e,t){var i;(i=PS.get(e))==null||i.clearWidgets()}});const bF=class bF extends Da{constructor(e,t,i){super(),this._hideSoon=this._register(new ai(()=>this._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:ge(mD),inputActiveOptionForeground:ge(_D),inputActiveOptionBackground:ge(nx)},o={groupId:"find-options-widget"};this.caseSensitive=this._register(new gve({appendTitle:this._keybindingLabelFor(Si.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new pve({appendTitle:this._keybindingLabelFor(Si.ToggleWholeWordCommand),isChecked:this._state.wholeWord,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new mve({appendTitle:this._keybindingLabelFor(Si.ToggleRegexCommand),isChecked:this._state.isRegex,hoverLifecycleOptions:o,...s})),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(r=>{let a=!1;r.isRegex&&(this.regex.checked=this._state.isRegex,a=!0),r.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,a=!0),r.matchCase&&(this.caseSensitive.checked=this._state.matchCase,a=!0),!this._state.isRevealed&&a&&this._revealTemporarily()})),this._register(J(this._domNode,_e.MOUSE_LEAVE,r=>this._onMouseLeave())),this._register(J(this._domNode,"mouseover",r=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return bF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}highlightFindOptions(){this._revealTemporarily()}_revealTemporarily(){this._show(),this._hideSoon.schedule()}_onMouseLeave(){this._hideSoon.schedule()}_onMouseOver(){this._hideSoon.cancel()}_show(){this._isVisible||(this._isVisible=!0,this._domNode.style.display="block")}_hide(){this._isVisible&&(this._isVisible=!1,this._domNode.style.display="none")}};bF.ID="editor.contrib.findOptionsWidget";let pU=bF;function V2(n,e){return n===1?!0:n===2?!1:e}class Knt extends G{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return V2(this._isRegexOverride,this._isRegex)}get wholeWord(){return V2(this._wholeWordOverride,this._wholeWord)}get matchCase(){return V2(this._matchCaseOverride,this._matchCase)}get preserveCase(){return V2(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new q),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={moveCursor:!1,updateHistory:!1,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;t===0&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(D.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var d;const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,c=this.preserveCase;typeof e.searchString<"u"&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&((d=e.searchScope)!=null&&d.every(h=>{var u;return(u=this._searchScope)==null?void 0:u.some(f=>!D.equalsRange(f,h))})||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),l!==this.matchCase&&(o=!0,s.matchCase=!0),c!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=rm}}var Gnt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ynt=function(n,e){return function(t,i){e(t,i,n)}},bp,Hm;let mU=(Hm=class{static getOrCreate(e){return bp._instance||(bp._instance=new bp(e)),bp._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new q,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(bp.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(bp.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},bp=Hm,Hm.FIND_HISTORY_KEY="workbench.find.history",Hm._instance=null,Hm);mU=bp=Gnt([Ynt(0,Jo)],mU);var Znt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xnt=function(n,e){return function(t,i){e(t,i,n)}},vp,Vm;let _U=(Vm=class{static getOrCreate(e){return vp._instance||(vp._instance=new vp(e)),vp._instance}constructor(e){this.storageService=e,this.inMemoryValues=new Set,this._onDidChangeEmitter=new q,this.onDidChange=this._onDidChangeEmitter.event,this.load()}delete(e){const t=this.inMemoryValues.delete(e);return this.save(),t}add(e){return this.inMemoryValues.add(e),this.save(),this}has(e){return this.inMemoryValues.has(e)}forEach(e,t){return this.load(),this.inMemoryValues.forEach(e)}replace(e){this.inMemoryValues=new Set(e),this.save()}load(){let e;const t=this.storageService.get(vp.FIND_HISTORY_KEY,1);if(t)try{e=JSON.parse(t)}catch{}this.inMemoryValues=new Set(e||[])}save(){const e=[];return this.inMemoryValues.forEach(t=>e.push(t)),new Promise(t=>{this.storageService.store(vp.FIND_HISTORY_KEY,JSON.stringify(e),1,0),this._onDidChangeEmitter.fire(e),t()})}},vp=Vm,Vm.FIND_HISTORY_KEY="workbench.replace.history",Vm._instance=null,Vm);_U=vp=Znt([Xnt(0,Jo)],_U);var sCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Rc=function(n,e){return function(t,i){e(t,i,n)}},bU;const Qnt=524288;function vU(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(a))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const a=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),a&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(50).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!Y3.getValue(this._contextKeyService)}getState(){return this._state}closeFindWidget(){this._state.change({isRevealed:!1,searchScope:null},!1),this._editor.focus()}toggleCaseSensitive(){this._state.change({matchCase:!this._state.matchCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleWholeWords(){this._state.change({wholeWord:!this._state.wholeWord},!1),this._state.isRevealed||this.highlightFindOptions()}toggleRegex(){this._state.change({isRegex:!this._state.isRegex},!1),this._state.isRevealed||this.highlightFindOptions()}togglePreserveCase(){this._state.change({preserveCase:!this._state.preserveCase},!1),this._state.isRevealed||this.highlightFindOptions()}toggleSearchScope(){if(this._state.searchScope)this._state.change({searchScope:null},!0);else if(this._editor.hasModel()){let e=this._editor.getSelections();e=e.map(t=>(t.endColumn===1&&t.endLineNumber>t.startLineNumber&&(t=t.setEndPosition(t.endLineNumber-1,this._editor.getModel().getLineMaxColumn(t.endLineNumber-1))),t.isEmpty()?null:t)).filter(t=>!!t),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=wa(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}async _start(e,t){if(this.disposeModel(),!this._editor.hasModel())return;const i={...t,isRevealed:!0};if(e.seedSearchStringFromSelection==="single"){const s=vU(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=wa(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=vU(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=await this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new $k(this._editor,this._state))}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?(e=this._editor.getModel())!=null&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(_(940,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}async getGlobalBufferTerm(){return this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}setGlobalBufferTerm(e){this._editor.getOption(50).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}},bU=p1,p1.ID="editor.contrib.findController",p1);Zr=bU=sCe([Rc(1,Xe),Rc(2,Jo),Rc(3,La),Rc(4,fn),Rc(5,Sr)],Zr);let wU=class extends Zr{constructor(e,t,i,s,o,r,a,l){super(e,i,r,a,o,l),this._contextViewService=t,this._keybindingService=s,this._widget=null,this._findOptionsWidget=null,this._findWidgetSearchHistory=mU.getOrCreate(r),this._replaceWidgetHistory=_U.getOrCreate(r)}async _start(e,t){this._widget||this._createFindWidget();const i=this._editor.getSelection();let s=!1;switch(this._editor.getOption(50).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":{s=!!i&&i.startLineNumber!==i.endLineNumber;break}}e.updateSearchScope=e.updateSearchScope||s,await super._start(e,t),this._widget&&(e.shouldFocus===2?this._widget.focusReplaceInput():e.shouldFocus===1&&this._widget.focusFindInput())}highlightFindOptions(e=!1){this._widget||this._createFindWidget(),this._state.isRevealed&&!e?this._widget.highlightFindOptions():this._findOptionsWidget.highlightFindOptions()}_createFindWidget(){this._widget=this._register(new P$(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._hoverService,this._findWidgetSearchHistory,this._replaceWidgetHistory)),this._findOptionsWidget=this._register(new pU(this._editor,this._state,this._keybindingService))}saveViewState(){var e;return(e=this._widget)==null?void 0:e.getViewState()}restoreViewState(e){var t;(t=this._widget)==null||t.setViewState(e)}};wU=sCe([Rc(1,zg),Rc(2,Xe),Rc(3,Vt),Rc(4,fn),Rc(5,Jo),Rc(6,La),Rc(7,Sr)],wU);const Jnt=e3(new J5({id:Si.StartFindAction,label:ie(947,"Find"),precondition:le.or(H.focus,le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:_(941,"&&Find"),order:1}}));Jnt.addImplementation(0,(n,e,t)=>{const i=Zr.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop}):!1});const est={description:"Open a new In-Editor Find Widget.",args:[{name:"Open a new In-Editor Find Widget args",schema:{properties:{searchString:{type:"string"},replaceString:{type:"string"},isRegex:{type:"boolean"},matchWholeWord:{type:"boolean"},isCaseSensitive:{type:"boolean"},preserveCase:{type:"boolean"},findInSelection:{type:"boolean"}}}}]};class tst extends Ne{constructor(){super({id:Si.StartFindWithArgs,label:ie(948,"Find with Arguments"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},metadata:est})}async run(e,t,i){const s=Zr.get(t);if(s){const o=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:i.replaceString!==void 0,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};await s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(50).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}}}class ist extends Ne{constructor(){super({id:Si.StartFindWithSelection,label:ie(949,"Find with Selection"),precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}async run(e,t){const i=Zr.get(t);i&&(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),i.setGlobalBufferTerm(i.getState().searchString))}}async function oCe(n,e){const t=Zr.get(n);if(!t)return;const i=()=>(e?t.moveToNextMatch():t.moveToPrevMatch())?(t.editor.pushUndoStop(),!0):!1;i()||(await t.start({forceRevealReplace:!1,seedSearchStringFromSelection:t.getState().searchString.length===0&&n.getOption(50).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:n.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:n.getOption(50).loop}),i())}const nst=e3(new J5({id:Si.NextMatchFindAction,label:ie(950,"Find Next"),precondition:void 0,kbOpts:[{kbExpr:H.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:le.and(H.focus,Y3),primary:3,weight:100}]}));nst.addImplementation(0,async(n,e,t)=>oCe(e,!0));const sst=e3(new J5({id:Si.PreviousMatchFindAction,label:ie(951,"Find Previous"),precondition:void 0,kbOpts:[{kbExpr:H.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:le.and(H.focus,Y3),primary:1027,weight:100}]}));sst.addImplementation(0,async(n,e,t)=>oCe(e,!1));class ost extends Ne{constructor(){super({id:Si.GoToMatchFindAction,label:ie(952,"Go to Match..."),precondition:Gg}),this._highlightDecorations=[]}run(e,t,i){const s=Zr.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(fn).notify({severity:rx.Warning,message:_(942,"No matches. Try searching for something else.")});return}const r=e.get(No),a=new ne,l=a.add(r.createInputBox());l.placeholder=_(943,"Type a number to go to a specific match (between 1 and {0})",o);const c=h=>{const u=parseInt(h);if(isNaN(u))return;const f=s.getState().matchesCount;if(u>0&&u<=f)return u-1;if(u<0&&u>=-f)return f+u},d=h=>{const u=c(h);if(typeof u=="number"){l.validationMessage=void 0,s.goToMatch(u);const f=s.getState().currentMatch;f&&this.addDecorations(t,f)}else l.validationMessage=_(944,"Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.add(l.onDidChangeValue(h=>{d(h)})),a.add(l.onDidAccept(()=>{const h=c(l.value);typeof h=="number"?(s.goToMatch(h),l.hide()):l.validationMessage=_(945,"Please type a number between 1 and {0}",s.getState().matchesCount)})),a.add(l.onDidHide(()=>{this.clearDecorations(t),a.dispose()})),l.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:an($me),position:ll.Full}}}])})}}class rCe extends Ne{async run(e,t){const i=Zr.get(t);if(!i)return;const s=vU(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(await i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(50).loop}),this._run(i))}}class rst extends rCe{constructor(){super({id:Si.NextSelectionMatchFindAction,label:ie(953,"Find Next Selection"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class ast extends rCe{constructor(){super({id:Si.PreviousSelectionMatchFindAction,label:ie(954,"Find Previous Selection"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const lst=e3(new J5({id:Si.StartFindReplaceAction,label:ie(955,"Replace"),precondition:le.or(H.focus,le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:Te.MenubarEditMenu,group:"3_find",title:_(946,"&&Replace"),order:2}}));lst.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(104))return!1;const i=Zr.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(50).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(50).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(50).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(50).loop})});At(Zr.ID,wU,0);we(tst);we(ist);we(ost);we(rst);we(ast);const dh=hs.bindToContribution(Zr.get);ye(new dh({id:Si.CloseFindWidgetCommand,precondition:Gg,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:le.and(H.focus,le.not("isComposing")),primary:9,secondary:[1033]}}));ye(new dh({id:Si.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:H.focus,primary:N2.primary,mac:N2.mac,win:N2.win,linux:N2.linux}}));ye(new dh({id:Si.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:H.focus,primary:D2.primary,mac:D2.mac,win:D2.win,linux:D2.linux}}));ye(new dh({id:Si.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:H.focus,primary:T2.primary,mac:T2.mac,win:T2.win,linux:T2.linux}}));ye(new dh({id:Si.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:H.focus,primary:R2.primary,mac:R2.mac,win:R2.win,linux:R2.linux}}));ye(new dh({id:Si.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:H.focus,primary:M2.primary,mac:M2.mac,win:M2.win,linux:M2.linux}}));ye(new dh({id:Si.ReplaceOneAction,precondition:Gg,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:H.focus,primary:3094}}));ye(new dh({id:Si.ReplaceOneAction,precondition:Gg,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:le.and(H.focus,IX),primary:3}}));ye(new dh({id:Si.ReplaceAllAction,precondition:Gg,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:H.focus,primary:2563}}));ye(new dh({id:Si.ReplaceAllAction,precondition:Gg,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:le.and(H.focus,IX),primary:void 0,mac:{primary:2051}}}));ye(new dh({id:Si.SelectAllMatchesAction,precondition:Gg,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:H.focus,primary:515}}));const cst={0:" ",1:"u",2:"r"},Gae=65535,Id=16777215,Yae=4278190080;class o6{constructor(e){const t=Math.ceil(e/32);this._states=new Uint32Array(t)}get(e){const t=e/32|0,i=e%32;return(this._states[t]&1<Gae)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new o6(e.length),this._userDefinedStates=new o6(e.length),this._recoveredStates=new o6(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iId||r>Id)throw new Error("startLineNumber or endLineNumber must not exceed "+Id);for(;e.length>0&&!t(o,r);)e.pop();const a=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=o+((a&255)<<24),this._endIndexes[i]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&Id}getEndLineNumber(e){return this._endIndexes[e]&Id}getType(e){return this._types?this._types[e]:void 0}hasTypes(){return!!this._types}isCollapsed(e){return this._collapseStates.get(e)}setCollapsed(e,t){this._collapseStates.set(e,t)}isUserDefined(e){return this._userDefinedStates.get(e)}setUserDefined(e,t){return this._userDefinedStates.set(e,t)}isRecovered(e){return this._recoveredStates.get(e)}setRecovered(e,t){return this._recoveredStates.set(e,t)}getSource(e){return this.isUserDefined(e)?1:this.isRecovered(e)?2:0}setSource(e,t){t===1?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):t===2?(this.setUserDefined(e,!1),this.setRecovered(e,!0)):(this.setUserDefined(e,!1),this.setRecovered(e,!1))}setCollapsedAllOfType(e,t){let i=!1;if(this._types)for(let s=0;s>>24)+((this._endIndexes[e]&Yae)>>>16);return t===Gae?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(i===0)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(m)?v=>vv=h.startLineNumber))d&&d.startLineNumber===h.startLineNumber?(h.source===1?m=h:(m=d,m.isCollapsed=h.isCollapsed&&(d.endLineNumber===h.endLineNumber||!(s!=null&&s.startsInside(d.startLineNumber+1,d.endLineNumber+1))),m.source=0),d=r(++l)):(m=h,h.isCollapsed&&h.source===0&&(m.source=2)),h=a(++c);else{let b=c,v=h;for(;;){if(!v||v.startLineNumber>d.endLineNumber){m=d;break}if(v.source===1&&v.endLineNumber>d.endLineNumber)break;v=a(++b)}d=r(++l)}if(m){for(;f&&f.endLineNumberm.startLineNumber&&m.startLineNumber>g&&m.endLineNumber<=i&&(!f||f.endLineNumber>=m.endLineNumber)&&(p.push(m),g=m.startLineNumber,f&&u.push(f),f=m)}}return p}}class dst{constructor(e,t){this.ranges=e,this.index=t}get startLineNumber(){return this.ranges.getStartLineNumber(this.index)}get endLineNumber(){return this.ranges.getEndLineNumber(this.index)}get regionIndex(){return this.index}get parentIndex(){return this.ranges.getParentIndex(this.index)}get isCollapsed(){return this.ranges.isCollapsed(this.index)}containedBy(e){return e.startLineNumber<=this.startLineNumber&&e.endLineNumber>=this.endLineNumber}containsLine(e){return this.startLineNumber<=e&&e<=this.endLineNumber}}class hst{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new q,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new Ga(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};for(const l of e){const c=l.regionIndex,d=this._editorDecorationIds[c];if(d&&!t[d]){t[d]=!0,a(c);const h=!this._regions.isCollapsed(c);this._regions.setCollapsed(c,h),o=Math.max(o,this._regions.getEndLineNumber(c))}}a(this._regions.length)}),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e){const t=[];for(let i=0,s=this._regions.length;i=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){if(!Array.isArray(e))return;const t=[],i=this._textModel.getLineCount();for(const o of e){if(o.startLineNumber>=o.endLineNumber||o.startLineNumber<1||o.endLineNumber>i)continue;const r=this._getLinesChecksum(o.startLineNumber+1,o.endLineNumber);(!o.checksum||r===o.checksum)&&t.push({startLineNumber:o.startLineNumber,endLineNumber:o.endLineNumber,type:void 0,isCollapsed:o.isCollapsed??!0,source:o.source??0})}const s=Ga.sanitizeAndMerge(this._regions,t,i);this.updatePost(Ga.fromFoldRanges(s))}_getLinesChecksum(e,t){return dD(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.parentIndex}}return i}getRegionAtLine(e){if(this._regions){const t=this._regions.findRange(e);if(t>=0)return this._regions.toRegion(t)}return null}getRegionsInside(e,t){const i=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r1){const a=n.getRegionsInside(o,(l,c)=>l.isCollapsed!==r&&c0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function ust(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function fst(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function lCe(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function VX(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function zX(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function gst(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function pst(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}}else if(e.regions.length>0)for(t=e.regions.toRegion(e.regions.length-1);t!==null;){if(t.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function mst(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)return null;if(t.parentIndex===i)return t.startLineNumber}else return null}else if(e.regions.length>0)for(t=e.regions.toRegion(0);t!==null;){if(t.startLineNumber>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||o_(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return Zae(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!bst(r,s))&&(s=Zae(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function bst(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function Zae(n,e){const t=bE(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const vst=5e3,wst="indent";class jX{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=wst}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(Sst(this.editorModel,i,s,this.foldingRangesLimit))}}let Cst=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>Id||t>Id)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new Ga(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],h=e.getLineContent(d),u=y3(h,o);(u{}};function Sst(n,e,t,i=yst){const s=n.getOptions().tabSize,o=new Cst(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),h=y3(d,s);let u=a[a.length-1];if(h===-1){e&&(u.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,u=a[g],o.insertFirst(c,u.line,h),u.line=c,u.indent=h,u.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(u.indent>h){do a.pop(),u=a[a.length-1];while(u.indent>h);const g=u.endAbove-1;g-c>=1&&o.insertFirst(c,g,h)}u.indent===h?u.endAbove=c:a.push({indent:h,endAbove:c,line:c})}return o.toIndentRanges(n)}const xst=F("editor.foldBackground",{light:ot(Zp,.3),dark:ot(Zp,.3),hcDark:null,hcLight:null},_(1002,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.foldPlaceholderForeground",{light:"#808080",dark:"#808080",hcDark:null,hcLight:null},_(1003,"Color of the collapsed text after the first line of a folded range."));F("editorGutter.foldingControlForeground",PA,_(1004,"Color of the folding control in the editor gutter."));const CO=Ri("folding-expanded",de.chevronDown,_(1005,"Icon for expanded ranges in the editor glyph margin.")),yO=Ri("folding-collapsed",de.chevronRight,_(1006,"Icon for collapsed ranges in the editor glyph margin.")),Xae=Ri("folding-manual-collapsed",yO,_(1007,"Icon for manually collapsed ranges in the editor glyph margin.")),Qae=Ri("folding-manual-expanded",CO,_(1008,"Icon for manually expanded ranges in the editor glyph margin.")),r6={color:an(xst),position:1},LC=_(1009,"Click to expand the range."),z2=_(1010,"Click to collapse the range."),Hn=class Hn{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Hn.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Hn.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Hn.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Hn.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Hn.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Hn.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Hn.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Hn.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Hn.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Hn.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Hn.MANUALLY_EXPANDED_VISUAL_DECORATION:Hn.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}};Hn.COLLAPSED_VISUAL_DECORATION=st.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:LC,firstLineDecorationClassName:$e.asClassName(yO)}),Hn.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=st.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:LC,firstLineDecorationClassName:$e.asClassName(yO)}),Hn.MANUALLY_COLLAPSED_VISUAL_DECORATION=st.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:LC,firstLineDecorationClassName:$e.asClassName(Xae)}),Hn.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=st.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:LC,firstLineDecorationClassName:$e.asClassName(Xae)}),Hn.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=st.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,linesDecorationsTooltip:LC}),Hn.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=st.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:r6,isWholeLine:!0,linesDecorationsTooltip:LC}),Hn.EXPANDED_VISUAL_DECORATION=st.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(CO),linesDecorationsTooltip:z2}),Hn.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=st.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(CO),linesDecorationsTooltip:z2}),Hn.MANUALLY_EXPANDED_VISUAL_DECORATION=st.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+$e.asClassName(Qae),linesDecorationsTooltip:z2}),Hn.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=st.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:$e.asClassName(Qae),linesDecorationsTooltip:z2}),Hn.NO_CONTROLS_EXPANDED_RANGE_DECORATION=st.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),Hn.HIDDEN_RANGE_DECORATION=st.register({description:"folding-hidden-range-decoration",stickiness:1});let CU=Hn;const Lst={},kst="syntax";class $X{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=kst,this.disposables=new ne,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return Ist(this.providers,this.editorModel,e).then(t=>{var i;return this.editorModel.isDisposed()?null:t?Nst(t,this.foldingRangesLimit):((i=this.fallbackRangeProvider)==null?void 0:i.compute(e))??null})}dispose(){this.disposables.dispose()}}function Ist(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,Lst,t)).then(a=>{if(!t.isCancellationRequested&&Array.isArray(a)){Array.isArray(i)||(i=[]);const l=e.getLineCount();for(const c of a)c.start>0&&c.end>c.start&&c.end<=l&&i.push({start:c.start,end:c.end,rank:r,kind:c.kind})}},On));return Promise.all(s).then(o=>i)}class Est{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>Id||t>Id)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new Est(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var Dst=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gL=function(n,e){return function(t,i){e(t,i,n)}},vb;const qs=new Se("foldingEnabled",!1);var m1;let h_=(m1=class extends G{static get(e){return e.getContribution(vb.ID)}static getFoldingRangeProviders(e,t){var s;const i=e.foldingRangeProvider.ordered(t);return((s=vb._foldingRangeSelector)==null?void 0:s.call(vb,i,t))??i}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new ne),this.editor=e,this._foldingLimitReporter=this._register(new cCe(e));const a=this.editor.getOptions();this._isEnabled=a.get(52),this._useFoldingProviders=a.get(53)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(57),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(55),this.updateDebounceInfo=o.for(r.foldingRangeProvider,"Folding",{min:200}),this.foldingModel=null,this.hiddenRangeModel=null,this.rangeProvider=null,this.foldingRegionPromise=null,this.foldingModelPromise=null,this.updateScheduler=null,this.cursorChangedScheduler=null,this.mouseDownInfo=null,this.foldingDecorationProvider=new CU(e),this.foldingDecorationProvider.showFoldingControls=a.get(126),this.foldingDecorationProvider.showFoldingHighlights=a.get(54),this.foldingEnabled=qs.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(52)&&(this._isEnabled=this.editor.getOptions().get(52),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(56)&&this.onModelChanged(),l.hasChanged(126)||l.hasChanged(54)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(126),this.foldingDecorationProvider.showFoldingHighlights=c.get(54),this.triggerFoldingModelChanged()}l.hasChanged(53)&&(this._useFoldingProviders=this.editor.getOptions().get(53)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(57)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(57)),l.hasChanged(55)&&(this._foldingImportsByDefault=this.editor.getOptions().get(55))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new hst(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new _st(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new ec(this.updateDebounceInfo.get(e)),this.localToDispose.add(this.updateScheduler),this.cursorChangedScheduler=new ai(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)==null||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)==null||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)==null||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new jX(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=vb.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new $X(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)==null||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Ls,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=rs(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const c=o.setCollapsedAllOfType(yg.Imports.value,!0);c&&(r=oh.capture(this.editor),this._currentModelHasFoldedImports=c)}const a=this.editor.getSelections();e.update(o,Tst(a)),r==null||r.restore(this.editor);const l=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=l)}return e})}).then(void 0,e=>(Je(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,Je)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range||!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.getLineMaxColumn(t.startLineNumber))break}return}default:return}this.mouseDownInfo={lineNumber:t.startLineNumber,iconClicked:i}}onEditorMouseUp(e){const t=this.foldingModel;if(!t||!this.mouseDownInfo||!e.target)return;const i=this.mouseDownInfo.lineNumber,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=u=>!u.containedBy(r)&&!r.containedBy(u),h=t.getRegionsInside(null,d);for(const u of h)u.isCollapsed&&c.push(u);c.length===0&&(c=h)}else{const d=e.event.middleButton||e.event.shiftKey;if(d)for(const h of t.getRegionsInside(r))h.isCollapsed===a&&c.push(h);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}},vb=m1,m1.ID="editor.contrib.folding",m1);h_=vb=Dst([gL(1,Xe),gL(2,qi),gL(3,fn),gL(4,hc),gL(5,De)],h_);class cCe extends G{constructor(e){super(),this.editor=e,this._onDidChange=this._register(new q),this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(56)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class go extends Ne{runEditorCommand(e,t,i){const s=e.get(qi),o=h_.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);const l=t.getSelection();l&&o.reveal(l.getStartPosition())}})}getSelectedLines(e){const t=e.getSelections();return t?t.map(i=>i.startLineNumber):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map(i=>i+1):this.getSelectedLines(t)}run(e,t){}}function Tst(n){return!n||n.length===0?{startsInside:()=>!1}:{startsInside(e,t){for(const i of n){const s=i.startLineNumber;if(s>=e&&s<=t)return!0}return!1}}}function dCe(n){if(!Lo(n)){if(!os(n))return!1;const e=n;if(!Lo(e.levels)&&!wg(e.levels)||!Lo(e.direction)&&!Cs(e.direction)||!Lo(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(wg)))return!1}return!0}class Rst extends go{constructor(){super({id:"editor.unfold",label:ie(982,"Unfold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},metadata:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to unfold. If not set, defaults to 1. * 'direction': If 'up', unfold given number of levels up otherwise unfolds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the unfold action to. If not set, the active selection(s) will be used. - `,constraint:gCe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?hCe(t,!1,o,r):mx(t,!1,o,r)}}class Pst extends fo{constructor(){super({id:"editor.unfoldRecursively",label:ie(983,"Unfold Recursively"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2142),weight:100}})}invoke(e,t,i,s){mx(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Ost extends fo{constructor(){super({id:"editor.fold",label:ie(984,"Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: + `,constraint:dCe,schema:{type:"object",properties:{levels:{type:"number",default:1},direction:{type:"string",enum:["up","down"],default:"down"},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?aCe(t,!1,o,r):gx(t,!1,o,r)}}class Mst extends go{constructor(){super({id:"editor.unfoldRecursively",label:ie(983,"Unfold Recursively"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2142),weight:100}})}invoke(e,t,i,s){gx(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class Ast extends go{constructor(){super({id:"editor.fold",label:ie(984,"Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},metadata:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:`Property-value pairs that can be passed through this argument: * 'levels': Number of levels to fold. * 'direction': If 'up', folds given number of levels up otherwise folds down. * 'selectionLines': Array of the start lines (0-based) of the editor selections to apply the fold action to. If not set, the active selection(s) will be used. If no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead. - `,constraint:gCe,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?gst(t,!0,o):a==="up"?hCe(t,!0,r||1,o):mx(t,!0,r||1,o)}}class Fst extends fo{constructor(){super({id:"editor.toggleFold",label:ie(985,"Toggle Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);VX(t,1,s)}}class Bst extends fo{constructor(){super({id:"editor.foldRecursively",label:ie(986,"Fold Recursively"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);mx(t,!0,Number.MAX_VALUE,s)}}class Wst extends fo{constructor(){super({id:"editor.toggleFoldRecursively",label:ie(987,"Toggle Fold Recursively"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,3114),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);VX(t,Number.MAX_VALUE,s)}}class Hst extends fo{constructor(){super({id:"editor.foldAllBlockComments",label:ie(988,"Fold All Block Comments"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())jX(t,yg.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+va(a.blockCommentStartToken));zX(t,l,!0)}}}}class Vst extends fo{constructor(){super({id:"editor.foldAllMarkerRegions",label:ie(989,"Fold All Regions"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())jX(t,yg.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);zX(t,l,!0)}}}}class zst extends fo{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:ie(990,"Unfold All Regions"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())jX(t,yg.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);zX(t,l,!1)}}}}class jst extends fo{constructor(){super({id:"editor.foldAllExcept",label:ie(991,"Fold All Except Selected"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);uCe(t,!0,s)}}class $st extends fo{constructor(){super({id:"editor.unfoldAllExcept",label:ie(992,"Unfold All Except Selected"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);uCe(t,!1,s)}}class Ust extends fo{constructor(){super({id:"editor.foldAll",label:ie(993,"Fold All"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2069),weight:100}})}invoke(e,t,i){mx(t,!0)}}class qst extends fo{constructor(){super({id:"editor.unfoldAll",label:ie(994,"Unfold All"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2088),weight:100}})}invoke(e,t,i){mx(t,!1)}}const j0=class j0 extends fo{getFoldingLevel(){return parseInt(this.id.substr(j0.ID_PREFIX.length))}invoke(e,t,i){pst(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}};j0.ID_PREFIX="editor.foldLevel",j0.ID=e=>j0.ID_PREFIX+e;let SO=j0;class Kst extends fo{constructor(){super({id:"editor.gotoParentFold",label:ie(995,"Go to Parent Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=mst(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Gst extends fo{constructor(){super({id:"editor.gotoPreviousFold",label:ie(996,"Go to Previous Folding Range"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=_st(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Yst extends fo{constructor(){super({id:"editor.gotoNextFold",label:ie(997,"Go to Next Folding Range"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=bst(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Zst extends fo{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:ie(998,"Create Folding Range from Selection"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2135),weight:100}})}invoke(e,t,i){var r;const s=[],o=i.getSelections();if(o){for(const a of o){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(s.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ga.sanitizeAndMerge(t.regions,s,(r=i.getModel())==null?void 0:r.getLineCount());t.updatePost(Ga.fromFoldRanges(a))}}}}class Xst extends fo{constructor(){super({id:"editor.removeManualFoldingRanges",label:ie(999,"Remove Manual Folding Ranges"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}class Qst extends fo{constructor(){super({id:"editor.toggleImportFold",label:ie(1e3,"Toggle Import Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],s=t.regions;for(let o=s.length-1;o>=0;o--)s.getType(o)===yg.Imports.value&&i.push(s.toRegion(o));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}}At(u_.ID,u_,0);we(Ast);we(Pst);we(Ost);we(Bst);we(Wst);we(Ust);we(qst);we(Hst);we(Vst);we(zst);we(jst);we($st);we(Fst);we(Kst);we(Gst);we(Yst);we(Zst);we(Xst);we(Qst);for(let n=1;n<=7;n++)nFe(new SO({id:SO.ID(n),label:ie(1001,"Fold Level {0}",n),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2048|21+n),weight:100}}));Rt.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof He))throw Zl();const i=n.get(De),s=n.get(qi).getModel(t);if(!s)throw Zl();const o=n.get(lt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(Ki),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new $X(s,r,l);let d=c;if(a!=="indentation"){const f=u_.getFoldingRangeProviders(i,s);f.length&&(d=new UX(s,f,()=>{},l,c))}const h=await d.compute(vt.None),u=[];try{if(h)for(let f=0;f=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Uk=function(n,e){return function(t,i){e(t,i,n)}},Ry;let xO=(Ry=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new ne,this._sessionDisposables=new ne,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new CA;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new Wi,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,l=r.changes.length;a{s.token.isCancellationRequested||Go(r)&&(this._accessibilitySignalService.playSignal(dr.format,{userGesture:!1}),NS.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},Ry.ID="editor.contrib.autoFormat",Ry);xO=pCe([Uk(1,De),Uk(2,Zr),Uk(3,Kg)],xO);var My;let LO=(My=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new ne,this._callOnModel=new ne,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(k1e,this.editor,e,2,Wd.None,vt.None,!1).catch(Je))}},My.ID="editor.contrib.formatOnPaste",My);LO=pCe([Uk(1,De),Uk(2,Ae)],LO);class iot extends Ne{constructor(){super({id:"editor.action.formatDocument",label:ie(1014,"Format Document"),precondition:le.and(H.notInCompositeEditor,H.writable,H.hasDocumentFormattingProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(Ae);await e.get(Tg).showWhile(i.invokeFunction(TJe,t,1,Wd.None,vt.None,!0),250)}}}class not extends Ne{constructor(){super({id:"editor.action.formatSelection",label:ie(1015,"Format Selection"),precondition:le.and(H.writable,H.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2084),weight:100},contextMenuOpts:{when:H.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ae),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new D(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(Tg).showWhile(i.invokeFunction(k1e,t,o,1,Wd.None,vt.None,!0),250)}}At(xO.ID,xO,2);At(LO.ID,LO,2);we(iot);we(not);Rt.registerCommand("editor.action.format",async n=>{const e=n.get(Ft).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(Ei);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var sot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},a6=function(n,e){return function(t,i){e(t,i,n)}};class x0{remove(){var e;(e=this.parent)==null||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class SU extends x0{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class mCe extends x0{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class If extends x0{static create(e,t,i){const s=new Wi(i),o=new If(t.uri),r=e.ordered(t),a=r.map((c,d)=>{const h=x0.findId(`provider_${d}`,o),u=new mCe(h,o,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(f=>{for(const g of f||[])If._makeOutlineElement(g,u);return u},f=>(Bn(f),u)).then(f=>{x0.empty(f)?f.remove():o._groups.set(h,f)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Bi(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?If.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=x0.findId(e,t),s=new SU(i,t,e);if(e.children)for(const o of e.children)If._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Nt.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof SU?e.push(t.symbol):e.push(...Nt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>D.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return If._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>U.compare(D.getStartPosition(i.range),D.getStartPosition(s.range))||U.compare(D.getEndPosition(s.range),D.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&If._flattenDocumentSymbols(e,s.children,s.name)}}const jD=mt("IOutlineModelService");let xU=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new ne,this._cache=new Xc(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Bi(o.provider,s)){const a=new Wi;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:If.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}};xU=sot([a6(0,De),a6(1,pc),a6(2,qi)],xU);xt(jD,xU,1);Rt.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;Ot(He.isUri(t));const i=n.get(jD),o=await n.get(Xo).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,vt.None)).getTopLevelSymbols()}finally{o.dispose()}});const t8=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};var oot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rot=function(n,e){return function(t,i){e(t,i,n)}};function aot(n){return n instanceof _Ce?n._instance:n}let _Ce=class{constructor(e){this.instantiationService=e}init(...e){}};function lot(n){return n.get()}let tle=class extends _Ce{constructor(e,t){super(t),this.init(e)}};tle=oot([rot(1,Ae)],tle);class $D{validateOrThrow(e){const t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}}class i8 extends $D{constructor(e){super(),this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}}const cot=new i8("string");function dot(){return cot}new i8("number");const hot=new i8("boolean");function ile(){return hot}new i8("object");class bCe extends $D{validate(e){return e!==void 0?{content:void 0,error:{message:`Expected undefined, but got ${typeof e}`}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}}function uot(){return new bCe}class LU{constructor(e){this.validator=e}}function l6(n){return new LU(n)}class fot extends $D{constructor(e){super(),this.properties=e}validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};const t={};for(const i in this.properties){const s=this.properties[i],o=e[i],r=s instanceof LU,a=r?s.validator:s;if(r&&o===void 0)continue;const{content:l,error:c}=a.validate(o);if(c)return{content:void 0,error:{message:`Error in property '${i}': ${c.message}`}};t[i]=l}return{content:t,error:void 0}}getJSONSchema(){const e=[],t={};for(const[s,o]of Object.entries(this.properties)){const r=o instanceof LU,a=r?o.validator:o;t[s]=a.getJSONSchema(),r||e.push(s)}return{type:"object",properties:t,...e.length>0?{required:e}:{}}}}function got(n){return new fot(n)}class pot extends $D{constructor(e){super(),this.validators=e}validate(e){let t;for(const i of this.validators){const{content:s,error:o}=i.validate(e);if(!o)return{content:s,error:void 0};t=o}return{content:void 0,error:t}}getJSONSchema(){return{oneOf:LMe(this.validators,e=>{if(!(e instanceof bCe))return e.getJSONSchema()})}}}function mot(...n){return new pot(n)}class _ot extends $D{constructor(e,t){super(),this._ref=e,this._validator=t}validate(e){return this._validator.validate(e)}getJSONSchema(){return{$ref:this._ref}}}function bot(n,e){return new _ot(n,e)}const _t={Visible:NX,HasFocusedSuggestion:new Se("suggestWidgetHasFocusedSuggestion",!1,_(1455,"Whether any suggestion is focused")),DetailsVisible:new Se("suggestWidgetDetailsVisible",!1,_(1456,"Whether suggestion details are visible")),MultipleSuggestions:new Se("suggestWidgetMultipleSuggestions",!1,_(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Se("suggestionMakesTextEdit",!0,_(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Se("acceptSuggestionOnEnter",!0,_(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Se("suggestionHasInsertAndReplaceRange",!1,_(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Se("suggestionInsertMode",void 0,{type:"string",description:_(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new Se("suggestionCanResolve",!1,_(1462,"Whether the current suggestion supports to resolve further details"))},Nm=new Te("suggestWidgetStatusBar");class vot{constructor(e,t,i,s){var o;this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=jc.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)==null?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,D.isIRange(t.range)?(this.editStart=new U(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new U(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new U(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new U(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new U(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new U(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range.insert)||D.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new xs(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{fl(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const vF=class vF{constructor(e=2,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}};vF.default=new vF;let xN=vF;class wot{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function qX(n,e,t,i=xN.default,s={triggerKind:0},o=vt.None){const r=new xs;t=t.clone();const a=e.getWordAtPosition(t),l=a?new D(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):D.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],h=new ne,u=[];let f=!1;const g=(m,b,v)=>{var C;let w=!1;if(!b)return w;for(const S of b.suggestions)if(!i.kindFilter.has(S.kind)){if(!i.showDeprecated&&((C=S==null?void 0:S.tags)!=null&&C.includes(1)))continue;S.range||(S.range=c),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!f&&S.insertTextRules&&S.insertTextRules&4&&(f=vw.guessNeedsClipboard(S.insertText)),d.push(new vot(t,S,b,m)),w=!0}return Rw(b)&&h.add(b),u.push({providerName:m._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:v.elapsed()}),w},p=(async()=>{})();for(const m of n.orderedGroups(e)){let b=!1;if(await Promise.all(m.map(async v=>{if(i.providerItemsToReuse.has(v)){const w=i.providerItemsToReuse.get(v);w.forEach(C=>d.push(C)),b=b||w.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(v)))try{const w=new xs,C=await v.provideCompletionItems(e,t,s,o);b=g(v,C,w)||b}catch(w){Bn(w)}})),b||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(h.dispose(),Promise.reject(new ic)):new wot(d.sort(Sot(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function KX(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function Cot(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===28)return-1;if(e.completion.kind===28)return 1}return KX(n,e)}function yot(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===28)return 1;if(e.completion.kind===28)return-1}return KX(n,e)}const n8=new Map;n8.set(0,Cot);n8.set(2,yot);n8.set(1,KX);function Sot(n){return n8.get(n)}Rt.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,o]=e;Ot(He.isUri(t)),Ot(U.isIPosition(i)),Ot(typeof s=="string"||!s),Ot(typeof o=="number"||!o);const{completionProvider:r}=n.get(De),a=await n.get(Xo).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),h=await qX(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?1:0});for(const u of h.items)c.length<(o??0)&&c.push(u.resolve(vt.None)),l.incomplete=l.incomplete||u.container.incomplete,l.suggestions.push(u.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function xot(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class L0{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}const Ha=class Ha{};Ha.inlineSuggestionVisible=new Se("inlineSuggestionVisible",!1,_(1192,"Whether an inline suggestion is visible")),Ha.inlineSuggestionHasIndentation=new Se("inlineSuggestionHasIndentation",!1,_(1193,"Whether the inline suggestion starts with whitespace")),Ha.inlineSuggestionHasIndentationLessThanTabSize=new Se("inlineSuggestionHasIndentationLessThanTabSize",!0,_(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),Ha.suppressSuggestions=new Se("inlineSuggestionSuppressSuggestions",void 0,_(1195,"Whether suggestions should be suppressed for the current suggestion")),Ha.cursorBeforeGhostText=new Se("cursorBeforeGhostText",!1,_(1196,"Whether the cursor is at ghost text")),Ha.cursorInIndentation=new Se("cursorInIndentation",!1,_(1197,"Whether the cursor is in indentation")),Ha.hasSelection=new Se("editor.hasSelection",!1,_(1198,"Whether the editor has a selection")),Ha.cursorAtInlineEdit=new Se("cursorAtInlineEdit",!1,_(1199,"Whether the cursor is at an inline edit")),Ha.inlineEditVisible=new Se("inlineEditIsVisible",!1,_(1200,"Whether an inline edit is visible")),Ha.tabShouldJumpToInlineEdit=new Se("tabShouldJumpToInlineEdit",!1,_(1201,"Whether tab should jump to an inline edit.")),Ha.tabShouldAcceptInlineEdit=new Se("tabShouldAcceptInlineEdit",!1,_(1202,"Whether tab should accept the inline edit.")),Ha.inInlineEditsPreviewEditor=new Se("inInlineEditsPreviewEditor",!0,_(1203,"Whether the current code editor is showing an inline edits preview"));let hi=Ha;class Lot{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=kot(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,o=i.length;sa.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,o=0;const r=e.length;for(let a=1,l=n.getLineCount();a<=l;a++){const c=n.getLineContent(a),d=c.length+1;let h=0;if(oV0.ID_PREFIX+e;let SO=V0;class Ust extends go{constructor(){super({id:"editor.gotoParentFold",label:ie(995,"Go to Parent Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=gst(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class qst extends go{constructor(){super({id:"editor.gotoPreviousFold",label:ie(996,"Go to Previous Folding Range"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=pst(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Kst extends go{constructor(){super({id:"editor.gotoNextFold",label:ie(997,"Go to Next Folding Range"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=mst(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class Gst extends go{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:ie(998,"Create Folding Range from Selection"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2135),weight:100}})}invoke(e,t,i){var r;const s=[],o=i.getSelections();if(o){for(const a of o){let l=a.endLineNumber;a.endColumn===1&&--l,l>a.startLineNumber&&(s.push({startLineNumber:a.startLineNumber,endLineNumber:l,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:a.startLineNumber,startColumn:1,endLineNumber:a.startLineNumber,endColumn:1}))}if(s.length>0){s.sort((l,c)=>l.startLineNumber-c.startLineNumber);const a=Ga.sanitizeAndMerge(t.regions,s,(r=i.getModel())==null?void 0:r.getLineCount());t.updatePost(Ga.fromFoldRanges(a))}}}}class Yst extends go{constructor(){super({id:"editor.removeManualFoldingRanges",label:ie(999,"Remove Manual Folding Ranges"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}class Zst extends go{constructor(){super({id:"editor.toggleImportFold",label:ie(1e3,"Toggle Import Fold"),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,weight:100}})}async invoke(e,t){const i=[],s=t.regions;for(let o=s.length-1;o>=0;o--)s.getType(o)===yg.Imports.value&&i.push(s.toRegion(o));t.toggleCollapseState(i),e.triggerFoldingModelChanged()}}At(h_.ID,h_,0);we(Rst);we(Mst);we(Ast);we(Ost);we(Fst);we(jst);we($st);we(Bst);we(Wst);we(Hst);we(Vst);we(zst);we(Pst);we(Ust);we(qst);we(Kst);we(Gst);we(Yst);we(Zst);for(let n=1;n<=7;n++)tFe(new SO({id:SO.ID(n),label:ie(1001,"Fold Level {0}",n),precondition:qs,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2048|21+n),weight:100}}));Rt.registerCommand("_executeFoldingRangeProvider",async function(n,...e){const[t]=e;if(!(t instanceof He))throw ql();const i=n.get(De),s=n.get(Ui).getModel(t);if(!s)throw ql();const o=n.get(lt);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(qi),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new jX(s,r,l);let d=c;if(a!=="indentation"){const f=h_.getFoldingRangeProviders(i,s);f.length&&(d=new $X(s,f,()=>{},l,c))}const h=await d.compute(wt.None),u=[];try{if(h)for(let f=0;f=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Uk=function(n,e){return function(t,i){e(t,i,n)}},Dy;let xO=(Dy=class{constructor(e,t,i,s){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._accessibilitySignalService=s,this._disposables=new ne,this._sessionDisposables=new ne,this._disposables.add(t.onTypeFormattingEditProvider.onDidChange(this._update,this)),this._disposables.add(e.onDidChangeModel(()=>this._update())),this._disposables.add(e.onDidChangeModelLanguage(()=>this._update())),this._disposables.add(e.onDidChangeConfiguration(o=>{o.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(65)||!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new CA;for(const s of t.autoFormatTriggerCharacters)i.add(s.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType(s=>{const o=s.charCodeAt(s.length-1);i.has(o)&&this._trigger(String.fromCharCode(o))}))}_trigger(e){if(!this._editor.hasModel()||this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=new Bi,o=this._editor.onDidChangeModelContent(r=>{if(r.isFlush){s.cancel(),o.dispose();return}for(let a=0,l=r.changes.length;a{s.token.isCancellationRequested||Yo(r)&&(this._accessibilitySignalService.playSignal(ur.format,{userGesture:!1}),IS.execute(this._editor,r,!0))}).finally(()=>{o.dispose()})}},Dy.ID="editor.contrib.autoFormat",Dy);xO=hCe([Uk(1,De),Uk(2,Qr),Uk(3,Kg)],xO);var Ty;let LO=(Ty=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new ne,this._callOnModel=new ne,this._callOnDispose.add(e.onDidChangeConfiguration(()=>this._update())),this._callOnDispose.add(e.onDidChangeModel(()=>this._update())),this._callOnDispose.add(e.onDidChangeModelLanguage(()=>this._update())),this._callOnDispose.add(t.documentRangeFormattingEditProvider.onDidChange(this._update,this))}dispose(){this._callOnDispose.dispose(),this._callOnModel.dispose()}_update(){this._callOnModel.clear(),this.editor.getOption(64)&&this.editor.hasModel()&&this._languageFeaturesService.documentRangeFormattingEditProvider.has(this.editor.getModel())&&this._callOnModel.add(this.editor.onDidPaste(({range:e})=>this._trigger(e)))}_trigger(e){this.editor.hasModel()&&(this.editor.getSelections().length>1||this._instantiationService.invokeFunction(y1e,this.editor,e,2,Vd.None,wt.None,!1).catch(Je))}},Ty.ID="editor.contrib.formatOnPaste",Ty);LO=hCe([Uk(1,De),Uk(2,Ae)],LO);class eot extends Ne{constructor(){super({id:"editor.action.formatDocument",label:ie(1014,"Format Document"),precondition:le.and(H.notInCompositeEditor,H.writable,H.hasDocumentFormattingProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}async run(e,t){if(t.hasModel()){const i=e.get(Ae);await e.get(Tg).showWhile(i.invokeFunction(NJe,t,1,Vd.None,wt.None,!0),250)}}}class tot extends Ne{constructor(){super({id:"editor.action.formatSelection",label:ie(1015,"Format Selection"),precondition:le.and(H.writable,H.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2084),weight:100},contextMenuOpts:{when:H.hasNonEmptySelection,group:"1_modification",order:1.31}})}async run(e,t){if(!t.hasModel())return;const i=e.get(Ae),s=t.getModel(),o=t.getSelections().map(a=>a.isEmpty()?new D(a.startLineNumber,1,a.startLineNumber,s.getLineMaxColumn(a.startLineNumber)):a);await e.get(Tg).showWhile(i.invokeFunction(y1e,t,o,1,Vd.None,wt.None,!0),250)}}At(xO.ID,xO,2);At(LO.ID,LO,2);we(eot);we(tot);Rt.registerCommand("editor.action.format",async n=>{const e=n.get(Bt).getFocusedCodeEditor();if(!e||!e.hasModel())return;const t=n.get(ki);e.getSelection().isEmpty()?await t.executeCommand("editor.action.formatDocument"):await t.executeCommand("editor.action.formatSelection")});var iot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},a6=function(n,e){return function(t,i){e(t,i,n)}};class y0{remove(){var e;(e=this.parent)==null||e.children.delete(this.id)}static findId(e,t){let i;typeof e=="string"?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,t.children.get(i)!==void 0&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class yU extends y0{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class uCe extends y0{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class Nf extends y0{static create(e,t,i){const s=new Bi(i),o=new Nf(t.uri),r=e.ordered(t),a=r.map((c,d)=>{const h=y0.findId(`provider_${d}`,o),u=new uCe(h,o,c.displayName??"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(f=>{for(const g of f||[])Nf._makeOutlineElement(g,u);return u},f=>(On(f),u)).then(f=>{y0.empty(f)?f.remove():o._groups.set(h,f)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Fi(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?Nf.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose(),s.dispose()})}static _makeOutlineElement(e,t){const i=y0.findId(e,t),s=new yU(i,t,e);if(e.children)for(const o of e.children)Nf._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=Dt.first(this._groups.values());for(const[,i]of t.children)i.parent=this,this.children.set(i.id,i)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof yU?e.push(t.symbol):e.push(...Dt.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>D.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Nf._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>U.compare(D.getStartPosition(i.range),D.getStartPosition(s.range))||U.compare(D.getEndPosition(s.range),D.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&Nf._flattenDocumentSymbols(e,s.children,s.name)}}const jD=mt("IOutlineModelService");let SU=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new ne,this._cache=new Qc(15,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved(s=>{this._cache.delete(s.id)}))}dispose(){this._disposables.dispose()}async getOrCreate(e,t){const i=this._languageFeaturesService.documentSymbolProvider,s=i.ordered(e);let o=this._cache.get(e.id);if(!o||o.versionId!==e.getVersionId()||!Fi(o.provider,s)){const a=new Bi;o={versionId:e.getVersionId(),provider:s,promiseCnt:0,source:a,promise:Nf.create(i,e,a.token),model:void 0},this._cache.set(e.id,o);const l=Date.now();o.promise.then(c=>{o.model=c,this._debounceInformation.update(e,Date.now()-l)}).catch(c=>{this._cache.delete(e.id)})}if(o.model)return o.model;o.promiseCnt+=1;const r=t.onCancellationRequested(()=>{--o.promiseCnt===0&&(o.source.cancel(),this._cache.delete(e.id))});try{return await o.promise}finally{r.dispose()}}};SU=iot([a6(0,De),a6(1,hc),a6(2,Ui)],SU);Lt(jD,SU,1);Rt.registerCommand("_executeDocumentSymbolProvider",async function(n,...e){const[t]=e;Ft(He.isUri(t));const i=n.get(jD),o=await n.get(Qo).createModelReference(t);try{return(await i.getOrCreate(o.object.textEditorModel,wt.None)).getTopLevelSymbols()}finally{o.dispose()}});const t8=new class{constructor(){this._implementations=[]}register(e){return this._implementations.push(e),{dispose:()=>{const t=this._implementations.indexOf(e);t!==-1&&this._implementations.splice(t,1)}}}getImplementations(){return this._implementations}};var not=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sot=function(n,e){return function(t,i){e(t,i,n)}};function oot(n){return n instanceof fCe?n._instance:n}let fCe=class{constructor(e){this.instantiationService=e}init(...e){}};function rot(n){return n.get()}let Jae=class extends fCe{constructor(e,t){super(t),this.init(e)}};Jae=not([sot(1,Ae)],Jae);class $D{validateOrThrow(e){const t=this.validate(e);if(t.error)throw new Error(t.error.message);return t.content}}class i8 extends $D{constructor(e){super(),this.type=e}validate(e){return typeof e!==this.type?{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}:{content:e,error:void 0}}getJSONSchema(){return{type:this.type}}}const aot=new i8("string");function lot(){return aot}new i8("number");const cot=new i8("boolean");function ele(){return cot}new i8("object");class gCe extends $D{validate(e){return e!==void 0?{content:void 0,error:{message:`Expected undefined, but got ${typeof e}`}}:{content:void 0,error:void 0}}getJSONSchema(){return{}}}function dot(){return new gCe}class xU{constructor(e){this.validator=e}}function l6(n){return new xU(n)}class hot extends $D{constructor(e){super(),this.properties=e}validate(e){if(typeof e!="object"||e===null)return{content:void 0,error:{message:"Expected object"}};const t={};for(const i in this.properties){const s=this.properties[i],o=e[i],r=s instanceof xU,a=r?s.validator:s;if(r&&o===void 0)continue;const{content:l,error:c}=a.validate(o);if(c)return{content:void 0,error:{message:`Error in property '${i}': ${c.message}`}};t[i]=l}return{content:t,error:void 0}}getJSONSchema(){const e=[],t={};for(const[s,o]of Object.entries(this.properties)){const r=o instanceof xU,a=r?o.validator:o;t[s]=a.getJSONSchema(),r||e.push(s)}return{type:"object",properties:t,...e.length>0?{required:e}:{}}}}function uot(n){return new hot(n)}class fot extends $D{constructor(e){super(),this.validators=e}validate(e){let t;for(const i of this.validators){const{content:s,error:o}=i.validate(e);if(!o)return{content:s,error:void 0};t=o}return{content:void 0,error:t}}getJSONSchema(){return{oneOf:SMe(this.validators,e=>{if(!(e instanceof gCe))return e.getJSONSchema()})}}}function got(...n){return new fot(n)}class pot extends $D{constructor(e,t){super(),this._ref=e,this._validator=t}validate(e){return this._validator.validate(e)}getJSONSchema(){return{$ref:this._ref}}}function mot(n,e){return new pot(n,e)}const bt={Visible:EX,HasFocusedSuggestion:new Se("suggestWidgetHasFocusedSuggestion",!1,_(1455,"Whether any suggestion is focused")),DetailsVisible:new Se("suggestWidgetDetailsVisible",!1,_(1456,"Whether suggestion details are visible")),MultipleSuggestions:new Se("suggestWidgetMultipleSuggestions",!1,_(1457,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Se("suggestionMakesTextEdit",!0,_(1458,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Se("acceptSuggestionOnEnter",!0,_(1459,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Se("suggestionHasInsertAndReplaceRange",!1,_(1460,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Se("suggestionInsertMode",void 0,{type:"string",description:_(1461,"Whether the default behaviour is to insert or replace")}),CanResolve:new Se("suggestionCanResolve",!1,_(1462,"Whether the current suggestion supports to resolve further details"))},Em=new Te("suggestWidgetStatusBar");class _ot{constructor(e,t,i,s){var o;this.position=e,this.completion=t,this.container=i,this.provider=s,this.isInvalid=!1,this.score=$c.Default,this.distance=0,this.textLabel=typeof t.label=="string"?t.label:(o=t.label)==null?void 0:o.label,this.labelLow=this.textLabel.toLowerCase(),this.isInvalid=!this.textLabel,this.sortTextLow=t.sortText&&t.sortText.toLowerCase(),this.filterTextLow=t.filterText&&t.filterText.toLowerCase(),this.extensionId=t.extensionId,D.isIRange(t.range)?(this.editStart=new U(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new U(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new U(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new U(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new U(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new U(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||D.spansMultipleLines(t.range.insert)||D.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),typeof s.resolveCompletionItem!="function"&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return this._resolveDuration!==void 0}get resolveDuration(){return this._resolveDuration!==void 0?this._resolveDuration:-1}async resolve(e){if(!this._resolveCache){const t=e.onCancellationRequested(()=>{this._resolveCache=void 0,this._resolveDuration=void 0}),i=new Ls(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then(s=>{Object.assign(this.completion,s),this._resolveDuration=i.elapsed()},s=>{fl(s)&&(this._resolveCache=void 0,this._resolveDuration=void 0)}).finally(()=>{t.dispose()})}return this._resolveCache}}const vF=class vF{constructor(e=2,t=new Set,i=new Set,s=new Map,o=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=s,this.showDeprecated=o}};vF.default=new vF;let xN=vF;class bot{constructor(e,t,i,s){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=s}}async function UX(n,e,t,i=xN.default,s={triggerKind:0},o=wt.None){const r=new Ls;t=t.clone();const a=e.getWordAtPosition(t),l=a?new D(t.lineNumber,a.startColumn,t.lineNumber,a.endColumn):D.fromPositions(t),c={replace:l,insert:l.setEndPosition(t.lineNumber,t.column)},d=[],h=new ne,u=[];let f=!1;const g=(m,b,v)=>{var C;let w=!1;if(!b)return w;for(const S of b.suggestions)if(!i.kindFilter.has(S.kind)){if(!i.showDeprecated&&((C=S==null?void 0:S.tags)!=null&&C.includes(1)))continue;S.range||(S.range=c),S.sortText||(S.sortText=typeof S.label=="string"?S.label:S.label.label),!f&&S.insertTextRules&&S.insertTextRules&4&&(f=mw.guessNeedsClipboard(S.insertText)),d.push(new _ot(t,S,b,m)),w=!0}return Nw(b)&&h.add(b),u.push({providerName:m._debugDisplayName??"unknown_provider",elapsedProvider:b.duration??-1,elapsedOverall:v.elapsed()}),w},p=(async()=>{})();for(const m of n.orderedGroups(e)){let b=!1;if(await Promise.all(m.map(async v=>{if(i.providerItemsToReuse.has(v)){const w=i.providerItemsToReuse.get(v);w.forEach(C=>d.push(C)),b=b||w.length>0;return}if(!(i.providerFilter.size>0&&!i.providerFilter.has(v)))try{const w=new Ls,C=await v.provideCompletionItems(e,t,s,o);b=g(v,C,w)||b}catch(w){On(w)}})),b||o.isCancellationRequested)break}return await p,o.isCancellationRequested?(h.dispose(),Promise.reject(new Ql)):new bot(d.sort(Cot(i.snippetSortOrder)),f,{entries:u,elapsed:r.elapsed()},h)}function qX(n,e){if(n.sortTextLow&&e.sortTextLow){if(n.sortTextLowe.sortTextLow)return 1}return n.textLabele.textLabel?1:n.completion.kind-e.completion.kind}function vot(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===28)return-1;if(e.completion.kind===28)return 1}return qX(n,e)}function wot(n,e){if(n.completion.kind!==e.completion.kind){if(n.completion.kind===28)return 1;if(e.completion.kind===28)return-1}return qX(n,e)}const n8=new Map;n8.set(0,vot);n8.set(2,wot);n8.set(1,qX);function Cot(n){return n8.get(n)}Rt.registerCommand("_executeCompletionItemProvider",async(n,...e)=>{const[t,i,s,o]=e;Ft(He.isUri(t)),Ft(U.isIPosition(i)),Ft(typeof s=="string"||!s),Ft(typeof o=="number"||!o);const{completionProvider:r}=n.get(De),a=await n.get(Qo).createModelReference(t);try{const l={incomplete:!1,suggestions:[]},c=[],d=a.object.textEditorModel.validatePosition(i),h=await UX(r,a.object.textEditorModel,d,void 0,{triggerCharacter:s??void 0,triggerKind:s?1:0});for(const u of h.items)c.length<(o??0)&&c.push(u.resolve(wt.None)),l.incomplete=l.incomplete||u.container.incomplete,l.suggestions.push(u.completion);try{return await Promise.all(c),l}finally{setTimeout(()=>h.disposable.dispose(),100)}}finally{a.dispose()}});function yot(n,e){var t;(t=n.getContribution("editor.contrib.suggestController"))==null||t.triggerSuggest(new Set().add(e),void 0,!0)}class S0{static isAllOff(e){return e.other==="off"&&e.comments==="off"&&e.strings==="off"}static isAllOn(e){return e.other==="on"&&e.comments==="on"&&e.strings==="on"}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}const Ha=class Ha{};Ha.inlineSuggestionVisible=new Se("inlineSuggestionVisible",!1,_(1192,"Whether an inline suggestion is visible")),Ha.inlineSuggestionHasIndentation=new Se("inlineSuggestionHasIndentation",!1,_(1193,"Whether the inline suggestion starts with whitespace")),Ha.inlineSuggestionHasIndentationLessThanTabSize=new Se("inlineSuggestionHasIndentationLessThanTabSize",!0,_(1194,"Whether the inline suggestion starts with whitespace that is less than what would be inserted by tab")),Ha.suppressSuggestions=new Se("inlineSuggestionSuppressSuggestions",void 0,_(1195,"Whether suggestions should be suppressed for the current suggestion")),Ha.cursorBeforeGhostText=new Se("cursorBeforeGhostText",!1,_(1196,"Whether the cursor is at ghost text")),Ha.cursorInIndentation=new Se("cursorInIndentation",!1,_(1197,"Whether the cursor is in indentation")),Ha.hasSelection=new Se("editor.hasSelection",!1,_(1198,"Whether the editor has a selection")),Ha.cursorAtInlineEdit=new Se("cursorAtInlineEdit",!1,_(1199,"Whether the cursor is at an inline edit")),Ha.inlineEditVisible=new Se("inlineEditIsVisible",!1,_(1200,"Whether an inline edit is visible")),Ha.tabShouldJumpToInlineEdit=new Se("tabShouldJumpToInlineEdit",!1,_(1201,"Whether tab should jump to an inline edit.")),Ha.tabShouldAcceptInlineEdit=new Se("tabShouldAcceptInlineEdit",!1,_(1202,"Whether tab should accept the inline edit.")),Ha.inInlineEditsPreviewEditor=new Se("inInlineEditsPreviewEditor",!0,_(1203,"Whether the current code editor is showing an inline edits preview"));let hi=Ha;class Sot{constructor(e,t,i){this._selection=e,this._cursors=t,this._selectionId=null,this._trimInRegexesAndStrings=i}getEditOperations(e,t){const i=xot(e,this._cursors,this._trimInRegexesAndStrings);for(let s=0,o=i.length;sa.lineNumber===l.lineNumber?a.column-l.column:a.lineNumber-l.lineNumber);for(let a=e.length-2;a>=0;a--)e[a].lineNumber===e[a+1].lineNumber&&e.splice(a,1);const i=[];let s=0,o=0;const r=e.length;for(let a=1,l=n.getLineCount();a<=l;a++){const c=n.getLineContent(a),d=c.length+1;let h=0;if(o=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Iot=function(n,e){return function(t,i){e(t,i,n)}};let kU=class{constructor(e,t,i,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),s=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberv===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(v),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:v=>v===r.startLineNumber?e.getLineContent(h):e.getLineContent(v)},b=pk(this._autoIndent,m,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const v=mi(e.getLineContent(h)),w=sa(b,a),C=sa(v,a);w!==C&&(f=qk(w,a,c)+this.trimStart(u))}}t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),f+` -`);const p=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,p);else{const m={tokenization:{getLineTokens:v=>v===r.startLineNumber?e.tokenization.getLineTokens(h):v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.tokenization.getLineTokens(v-1):e.tokenization.getLineTokens(v),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:v=>v===r.startLineNumber?f:v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v)},b=pk(this._autoIndent,m,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const v=mi(e.getLineContent(r.startLineNumber)),w=sa(b,a),C=sa(v,a);if(w!==C){const S=w-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),f+` +`+o),this._selectionId=t.trackSelection(i),this._selectionDirection=this._selection.getDirection()}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);if(this._startLineNumberDelta!==0||this._endLineNumberDelta!==0){let s=i.startLineNumber,o=i.startColumn,r=i.endLineNumber,a=i.endColumn;this._startLineNumberDelta!==0&&(s=s+this._startLineNumberDelta,o=1),this._endLineNumberDelta!==0&&(r=r+this._endLineNumberDelta,a=1),i=Ie.createWithDirection(s,o,r,a,this._selectionDirection)}return i}}function oa(n,e){let t=0;for(let i=0;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kot=function(n,e){return function(t,i){e(t,i,n)}};let LU=class{constructor(e,t,i,s){this._languageConfigurationService=s,this._selection=e,this._isMovingDown=t,this._autoIndent=i,this._selectionId=null,this._moveEndLineSelectionShrink=!1}getEditOperations(e,t){const i=()=>e.getLanguageId(),s=(h,u)=>e.getLanguageIdAtPosition(h,u),o=e.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===o){this._selectionId=t.trackSelection(this._selection);return}if(!this._isMovingDown&&this._selection.startLineNumber===1){this._selectionId=t.trackSelection(this._selection);return}this._moveEndPositionDown=!1;let r=this._selection;r.startLineNumberv===r.startLineNumber?e.tokenization.getLineTokens(h):e.tokenization.getLineTokens(v),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:v=>v===r.startLineNumber?e.getLineContent(h):e.getLineContent(v)},b=pk(this._autoIndent,m,e.getLanguageIdAtPosition(h,1),r.startLineNumber,d,this._languageConfigurationService);if(b!==null){const v=pi(e.getLineContent(h)),w=oa(b,a),C=oa(v,a);w!==C&&(f=qk(w,a,c)+this.trimStart(u))}}t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),f+` +`);const p=this.matchEnterRuleMovingDown(e,d,a,r.startLineNumber,h,f);if(p!==null)p!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,p);else{const m={tokenization:{getLineTokens:v=>v===r.startLineNumber?e.tokenization.getLineTokens(h):v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.tokenization.getLineTokens(v-1):e.tokenization.getLineTokens(v),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:v=>v===r.startLineNumber?f:v>=r.startLineNumber+1&&v<=r.endLineNumber+1?e.getLineContent(v-1):e.getLineContent(v)},b=pk(this._autoIndent,m,e.getLanguageIdAtPosition(h,1),r.startLineNumber+1,d,this._languageConfigurationService);if(b!==null){const v=pi(e.getLineContent(r.startLineNumber)),w=oa(b,a),C=oa(v,a);if(w!==C){const S=w-C;this.getIndentEditsOfMovingBlock(e,t,r,a,c,S)}}}}else t.addEditOperation(new D(r.startLineNumber,1,r.startLineNumber,1),f+` `)}else if(h=r.startLineNumber-1,u=e.getLineContent(h),t.addEditOperation(new D(h,1,h+1,1),null),t.addEditOperation(new D(r.endLineNumber,e.getLineMaxColumn(r.endLineNumber),r.endLineNumber,e.getLineMaxColumn(r.endLineNumber)),` -`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:p=>p===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(p),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:p=>p===h?e.getLineContent(r.startLineNumber):e.getLineContent(p)},g=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,g);else{const p=pk(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(p!==null){const m=mi(e.getLineContent(r.startLineNumber)),b=sa(p,a),v=sa(m,a);if(b!==v){const w=b-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:s=>cc.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>cc.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===Un.None||o.indentAction===Un.Indent?r=o.indentation+o.appendText:o.indentAction===Un.IndentOutdent?r=o.indentation:o.indentAction===Un.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=mi(e.getLineContent(s));let c=mi(r);const d=Fme(e,s,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=sa(c,i),u=sa(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(zc(r)>=0){const a=e.getLineMaxColumn(o),l=ly(this._autoIndent,e,new D(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(zc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=ly(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),zc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=ly(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,s,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=mi(l),h=sa(c,s)+r,u=qk(h,s,o);u!==c&&(t.addEditOperation(new D(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(LN._COLLATOR.value.compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function Not(n,e,t){const i=wCe(n,e,t);return i?ln.replace(new D(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` -`)):null}class CCe extends Ne{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>D.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;r=u.startLineNumber;b--)f.push(i.getLineContent(b));const g=ln.replace(u,f.join(` -`));r.push(g);const p=function(b){return b<=u.endLineNumber?u.endLineNumber-b+u.startLineNumber:b},m=function(b){if(b.isEmpty())return new Ie(p(b.positionLineNumber),b.positionColumn,p(b.positionLineNumber),b.positionColumn);{const v=p(b.selectionStartLineNumber),w=p(b.positionLineNumber),C=b.selectionStartColumn,S=b.positionColumn;return new Ie(v,C,w,S)}};a.push(m(d))}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}}const wF=class wF extends Ne{constructor(){super({id:wF.ID,label:ie(1258,"Trim Trailing Whitespace"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2102),weight:100}})}run(e,t,i){let s=[];i.reason==="auto-save"&&(s=(t.getSelections()||[]).map(d=>new U(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(lt),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),c=new Lot(o,s,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};wF.ID="editor.action.trimTrailingWhitespace";let EU=wF;class Wot extends Ne{constructor(){super({id:"editor.action.deleteLines",label:ie(1259,"Delete Line"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(h-=1,f=s.getLineMaxColumn(h)),r.push(ln.replace(new Ie(h,f,u,g),"")),a.push(new Ie(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class Hot extends Ne{constructor(){super({id:"editor.action.indentLines",label:ie(1260,"Indent Line"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Hp.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Vot extends Ne{constructor(){super({id:"editor.action.outdentLines",label:ie(1261,"Outdent Line"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(e,t){cy.Outdent.runEditorCommand(e,t,null)}}const CF=class CF extends Ne{constructor(){super({id:CF.ID,label:ie(1262,"Insert Line Above"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,b3.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}};CF.ID="editor.action.insertLineBefore";let kO=CF;const yF=class yF extends Ne{constructor(){super({id:yF.ID,label:ie(1263,"Insert Line Below"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,b3.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}};yF.ID="editor.action.insertLineAfter";let EO=yF;class xCe extends Ne{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let l=0,c=s.length-1;lln.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class zot extends xCe{constructor(){super({id:"deleteAllLeft",label:ie(1264,"Delete All Left"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const l=r.startLineNumber-o;a=new Ie(l,r.startColumn,l,r.startColumn)}else a=new Ie(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(D.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new D(r,a,o.startLineNumber,1)}else return new D(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new D(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class jot extends xCe{constructor(){super({id:"deleteAllRight",label:ie(1265,"Delete All Right"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new D(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new D(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(D.compareRangesUsingStarts),s}}class $ot extends Ne{constructor(){super({id:"editor.action.joinLines",label:ie(1266,"Join Lines"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(D.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(s.equalsSelection(u)&&(s=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new Ie(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new Ie(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=s,h=0;for(let u=0,f=o.length;u=1){let R=!0;S===""&&(R=!1),R&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(R=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const M=E.substr(I-1);S+=(R?" ":"")+M,R?b=M.length+1:b=M.length}else b=0}const L=new D(p,m,v,w);if(!L.isEmpty()){let x;g.isEmpty()?(l.push(ln.replace(L,S)),x=new Ie(L.startLineNumber-h,S.length-b+1,p-h,S.length-b+1)):g.startLineNumber===g.endLineNumber?(l.push(ln.replace(L,S)),x=new Ie(g.startLineNumber-h,g.startColumn,g.endLineNumber-h,g.endColumn)):(l.push(ln.replace(L,S)),x=new Ie(g.startLineNumber-h,g.startColumn,g.startLineNumber-h,S.length-C)),D.intersectRanges(L,s)!==null?d=x:c.push(x)}h+=L.endLineNumber-L.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class Uot extends Ne{constructor(){super({id:"editor.action.transpose",label:ie(1267,"Transpose Characters around the Cursor"),precondition:H.writable,canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===s.getLineCount())continue;const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new ro(new Ie(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u))}else{const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new AY(h,u,new Ie(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Xw extends Ne{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(148),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new D(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),h=s.getValueInRange(d);r.push(ln.replace(d,this._modifyText(h,o)))}else{const l=s.getValueInRange(a);r.push(ln.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class qot extends Xw{constructor(){super({id:"editor.action.transformToUppercase",label:ie(1268,"Transform to Uppercase"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleUpperCase()}}class Kot extends Xw{constructor(){super({id:"editor.action.transformToLowercase",label:ie(1269,"Transform to Lowercase"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleLowerCase()}}class $c{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const SF=class SF extends Xw{constructor(){super({id:"editor.action.transformToTitlecase",label:ie(1270,"Transform to Title Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=SF.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};SF.titleBoundary=new $c("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let IO=SF;const $0=class $0 extends Xw{constructor(){super({id:"editor.action.transformToSnakecase",label:ie(1271,"Transform to Snake Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=$0.caseBoundary.get(),s=$0.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};$0.caseBoundary=new $c("(\\p{Ll})(\\p{Lu})","gmu"),$0.singleLetters=new $c("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let Kk=$0;const Tp=class Tp extends Xw{constructor(){super({id:"editor.action.transformToCamelcase",label:ie(1272,"Transform to Camel Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){var a;const i=/\r\n|\r|\n/.test(e)?Tp.multiLineWordBoundary.get():Tp.singleLineWordBoundary.get(),s=Tp.validWordStart.get();if(!i||!s)return e;const o=e.split(i);return((a=o.shift())==null?void 0:a.replace(s,l=>l.toLocaleLowerCase()))+o.map(l=>l.substring(0,1).toLocaleUpperCase()+l.substring(1)).join("")}};Tp.singleLineWordBoundary=new $c("[_\\s-]+","gm"),Tp.multiLineWordBoundary=new $c("[_-]+","gm"),Tp.validWordStart=new $c("^(\\p{Lu}[^\\p{Lu}])","gmu");let Gk=Tp;const Rp=class Rp extends Xw{constructor(){super({id:"editor.action.transformToPascalcase",label:ie(1273,"Transform to Pascal Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Rp.wordBoundary.get(),s=Rp.wordBoundaryToMaintain.get(),o=Rp.upperCaseWordMatcher.get();return!i||!s||!o?e:e.split(s).map(l=>l.split(i)).flat().map(l=>{const c=l.charAt(0).toLocaleUpperCase()+l.slice(1);return c.length>1&&o.test(c)?c.charAt(0)+c.slice(1).toLocaleLowerCase():c}).join("")}};Rp.wordBoundary=new $c("[_ \\t-]","gm"),Rp.wordBoundaryToMaintain=new $c("(?<=\\.)","gm"),Rp.upperCaseWordMatcher=new $c("^\\p{Lu}+$","mu");let NO=Rp;const Mp=class Mp extends Xw{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:ie(1274,"Transform to Kebab Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Mp.caseBoundary.get(),s=Mp.singleLetters.get(),o=Mp.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};Mp.caseBoundary=new $c("(\\p{Ll})(\\p{Lu})","gmu"),Mp.singleLetters=new $c("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),Mp.underscoreBoundary=new $c("(\\S)(_)(\\S)","gm");let DO=Mp;we(Dot);we(Tot);we(Rot);we(Mot);we(Aot);we(Pot);we(Oot);we(Fot);we(EU);we(Wot);we(Hot);we(Vot);we(kO);we(EO);we(zot);we(jot);we($ot);we(Uot);we(qot);we(Kot);we(Bot);Kk.caseBoundary.isSupported()&&Kk.singleLetters.isSupported()&&we(Kk);Gk.singleLineWordBoundary.isSupported()&&Gk.multiLineWordBoundary.isSupported()&&we(Gk);NO.wordBoundary.isSupported()&&we(NO);IO.titleBoundary.isSupported()&&we(IO);DO.isSupported()&&we(DO);var Got=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nle=function(n,e){return function(t,i){e(t,i,n)}};function Yot(n){var e;return n.sourceId+" @@ "+JSON.stringify({...n,modelUri:(e=n.modelUri)==null?void 0:e.toString(),sourceId:void 0})}let TO=class extends G{static cast(){return this}constructor(e,t,i){super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=Zot("structuredLogger.enabled:"+this._key,this._contextKeyService).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(s=>s!==void 0)}log(e){return this._isEnabledContextKeyValue.get()?(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0):!1}};TO=Got([nle(1,Xe),nle(2,oX)],TO);function Zot(n,e){return Ut(e.onDidChangeContext,()=>e.getContextKeyValue(n))}var Xot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sle=function(n,e){return function(t,i){e(t,i,n)}};let IU=class extends G{constructor(e,t,i){var r;super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(TO.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const s=(r=this._loggerService)==null?void 0:r.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),o=Ut(this,s.onDidChangeLogLevel,()=>s.getLevel());this._register(qe(a=>{Cpe(o.read(a),_s.Trace)&&a.store.add(this._editor.onDidChangeModelContent(l=>{var c;((c=this._editor.getModel())==null?void 0:c.uri.scheme)!=="output"&&s.trace("onDidChangeModelContent: "+l.detailedReasons.map(d=>d.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(qe(a=>{this._editor instanceof lw&&this._structuredLogger.isEnabled.read(a)&&a.store.add(this._editor.onDidChangeModelContent(l=>{const c=this._editor.getModel();if(!c)return;const d=l.detailedReasons[0],h={...d.metadata,sourceId:"TextModel.setChangeReason",source:d.metadata.source,time:Date.now(),modelUri:c.uri,modelVersion:c.getVersionId()};setTimeout(()=>{this._structuredLogger.log(h)},0)}))}))}};IU=Xot([sle(1,Ae),sle(2,vpe)],IU);function ole(n,e=$s){return U4e(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var Qot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jot=function(n,e){return function(t,i){e(t,i,n)}};class rle{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class ale{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=mi(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof ur&&(a=mi(wa(c.value).pop())),!0));const l=Kc(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,h)=>`${d}${a.substr(l)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class lle{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return sg(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=sg(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return kR(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(X5(this._model.uri));if(t==="TM_DIRECTORY_BASE")return kR(this._model.uri.fsPath)==="."?"":sg(kR(this._model.uri.fsPath));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class cle{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!Tge(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let RO=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};RO=Qot([Jot(2,Ki)],RO);const Bh=class Bh{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Bh.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Bh.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Bh.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Bh.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return s+r+":"+l}}};Bh.dayNames=[_(1406,"Sunday"),_(1407,"Monday"),_(1408,"Tuesday"),_(1409,"Wednesday"),_(1410,"Thursday"),_(1411,"Friday"),_(1412,"Saturday")],Bh.dayNamesShort=[_(1413,"Sun"),_(1414,"Mon"),_(1415,"Tue"),_(1416,"Wed"),_(1417,"Thu"),_(1418,"Fri"),_(1419,"Sat")],Bh.monthNames=[_(1420,"January"),_(1421,"February"),_(1422,"March"),_(1423,"April"),_(1424,"May"),_(1425,"June"),_(1426,"July"),_(1427,"August"),_(1428,"September"),_(1429,"October"),_(1430,"November"),_(1431,"December")],Bh.monthNamesShort=[_(1432,"Jan"),_(1433,"Feb"),_(1434,"Mar"),_(1435,"Apr"),_(1436,"May"),_(1437,"Jun"),_(1438,"Jul"),_(1439,"Aug"),_(1440,"Sep"),_(1441,"Oct"),_(1442,"Nov"),_(1443,"Dec")];let MO=Bh;class dle{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Sqe(this._workspaceService.getWorkspace());if(!Cqe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(yz(e))return sg(e.uri.path);let t=sg(e.configPath.path);return t.endsWith(Sz)&&(t=t.substr(0,t.length-Sz.length-1)),t}_resoveWorkspacePath(e){if(yz(e))return ole(e.uri.fsPath);const t=sg(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?ole(i):"/"}}class hle{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Ww()}}var ert=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},trt=function(n,e){return function(t,i){e(t,i,n)}},fd;const Nc=class Nc{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Fte(t.placeholders,Bl.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=D.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?Nc._decor.inactiveFinal:Nc._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new Ie(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(l,a.isFinalTabstop?Nc._decor.activeFinal:Nc._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?Nc._decor.activeFinal:Nc._decor.active),o.add(d)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(l,a.isFinalTabstop?Nc._decor.inactiveFinal:Nc._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Bl){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof px,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=s.index+(r+1)/this._nestingLevel:l.index=s.index+l.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),d=o._snippet.fullLen(l),h=D.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+d)),u=i.addDecoration(h,Nc._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=Fte(this._snippet.placeholders,Bl.compareByIndex)})}};Nc._decor={active:nt.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:nt.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:nt.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:nt.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let AO=Nc;const ule={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let PO=fd=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=mi(r,0,t.column-1);let l;return s.walk(c=>{if(!(c instanceof ur)||c.parent instanceof px||o&&!o.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const u=s.offset(c);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??s.toString();const f=l.charCodeAt(u-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fC.get(Rg)),g=e.invokeWithinContext(C=>new lle(C.get(hw),u)),p=()=>a,m=u.getValueInRange(fd.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(fd.adjustSelection(u,e.getSelection(),0,s)),v=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((C,S)=>({selection:C,idx:S})).sort((C,S)=>D.compareRangesUsingStarts(C.selection,S.selection));for(const{selection:C,idx:S}of w){let L=fd.adjustSelection(u,C,i,0),x=fd.adjustSelection(u,C,0,s);m!==u.getValueInRange(L)&&(L=C),b!==u.getValueInRange(x)&&(x=C);const E=C.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(x.endLineNumber,x.endColumn),I=new vw().parse(t,!0,o),R=E.getStartPosition(),M=fd.adjustWhitespace(u,R,r||S>0&&v!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),I);I.resolveVariables(new rle([g,new cle(p,S,w.length,e.getOption(88)==="spread"),new ale(u,C,S,l),new RO(u,C,c),new MO,new dle(f),new hle])),d[S]=ln.replace(E,I.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new AO(e,I,M)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new vw,h=new OD,u=new rle([e.invokeWithinContext(g=>new lle(g.get(hw),c)),new cle(()=>o,0,e.getSelections().length,e.getOption(88)==="spread"),new ale(c,e.getSelection(),0,r),new RO(c,e.getSelection(),a),new MO,new dle(e.invokeWithinContext(g=>g.get(Rg))),new hle]);t=t.sort((g,p)=>D.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,x=D.fromPositions(L.getEndPosition(),p.getStartPosition()),E=new ur(c.getValueInRange(x));h.appendChild(E),f+=E.value.length}const v=d.parseFragment(m,h);fd.adjustWhitespace(c,p.getStartPosition(),b!==void 0?!b:s,h,new Set(v)),h.resolveVariables(u);const w=h.toString(),C=w.slice(f);f=w.length;const S=ln.replace(p,C);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return d.ensureFinalTabstop(h,i,!0),{edits:l,snippets:[new AO(e,h,"")]}}constructor(e,t,i=ule,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){Jt(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}=typeof this._template=="string"?fd.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):fd.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??wo.snippet(),t,s=>{const o=s.filter(r=>!!r.identifier);for(let r=0;rIe.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=ule){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=fd.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(l=>!!l.identifier);for(let l=0;lIe.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(D.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(D.compareRangesUsingStarts);for(let o=0;o0}};PO=fd=ert([trt(3,Ki)],PO);var irt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},z2=function(n,e){return function(t,i){e(t,i,n)}},zC;const fle={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var iu;let Zo=(iu=class{static get(e){return e.getContribution(zC.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._inSnippetObservable=Ze(this,!1),this._snippetListener=new ne,this._modelVersionId=-1,this._inSnippet=zC.InSnippetMode.bindTo(s),this._hasNextTabstop=zC.HasNextTabstop.bindTo(s),this._hasPrevTabstop=zC.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?fle:{...fle,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Ot(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new PO(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,h)=>{if(!this._session||d!==this._editor.getModel()||!U.equals(this._editor.getPosition(),h))return;const{activeChoice:u}=this._session;if(!u||u.choice.options.length===0)return;const f=d.getValueInRange(u.range),g=!!u.choice.options.find(m=>m.value===f),p=[];for(let m=0;m{r==null||r.dispose(),a=!1},c=()=>{a||(r=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},s),this._snippetListener.add(r),a=!0)};this._choiceCompletions={provider:s,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{xot(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)==null||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}get isInSnippetObservable(){return this._inSnippetObservable}},zC=iu,iu.ID="snippetController2",iu.InSnippetMode=new Se("inSnippetMode",!1,_(1402,"Whether the editor in current in snippet mode")),iu.HasNextTabstop=new Se("hasNextTabstop",!1,_(1403,"Whether there is a next tab stop when in snippet mode")),iu.HasPrevTabstop=new Se("hasPrevTabstop",!1,_(1404,"Whether there is a previous tab stop when in snippet mode")),iu);Zo=zC=irt([z2(1,ki),z2(2,De),z2(3,Xe),z2(4,Ki)],Zo);At(Zo.ID,Zo,4);const s8=cs.bindToContribution(Zo.get);ye(new s8({id:"jumpToNextSnippetPlaceholder",precondition:le.and(Zo.InSnippetMode,Zo.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:2}}));ye(new s8({id:"jumpToPrevSnippetPlaceholder",precondition:le.and(Zo.InSnippetMode,Zo.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:1026}}));ye(new s8({id:"leaveSnippet",precondition:Zo.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:9,secondary:[1033]}}));ye(new s8({id:"acceptSnippet",precondition:Zo.InSnippetMode,handler:n=>n.finish()}));function kN(n){return new nrt(n)}class nrt extends $pe{constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}}const srt=[];function ort(){return srt}function gle(n){return rrt(n).map(t=>t.getEndPosition())}function rrt(n){const e=YM.createSortPermutation(n,lo(s=>s.range,D.compareRangesUsingStarts)),i=new fa(e.apply(n)).getNewRanges();return e.inverse().apply(i)}function art(n,e){const t=kN(e),i=e.getValue();return n.map(r=>t.getStringReplacement(r)).map(r=>r.removeCommonSuffixPrefix(i)).map(r=>t.getTextReplacement(r))}function lrt(n,e){const t=Ze("result",[]),i=[];return e.add(qe(s=>{const o=n.read(s);wi(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[l],r))})})),t}class crt{constructor(e){this._contextKeyService=e}bind(e,t){return Nh(e,this._contextKeyService,t instanceof Function?t:i=>t.read(i))}}function ple(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class drt{constructor(e,t,i,s=hrt){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=s,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}}function hrt(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}function urt(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}class frt{constructor(e){this._value=Ze(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||OO.instance.invalidateOnNextAnimationFrame(e),t.getValue()}}const xF=class xF{constructor(){this._counter=Ul(this),this._isScheduled=!1}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,ii().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}};xF.instance=new xF;let OO=xF;class EN{constructor(e,t){this.lineNumber=e,this.parts=t,Qm(()=>nD(t,(i,s)=>i.column<=s.column))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new fa([...this.parts.map(o=>new On(D.fromPositions(new U(1,o.column)),o.lines.map(r=>r.line).join(` -`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class FO{constructor(e,t,i,s=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=s,this.lines=wa(this.text).map((o,r)=>({line:o,lineDecorations:qo.filter(this._inlineDecorations,r+1,1,o.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&qo.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}}class NU{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=s,this.parts=[new FO(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=wa(this.text)}renderForScreenReader(e){return this.newLines.join(` -`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function mle(n,e){return Bi(n,e,LCe)}function LCe(n,e){return n===e?!0:!n||!e?!1:n instanceof EN&&e instanceof EN||n instanceof NU&&e instanceof NU?n.equals(e):!1}function Gf(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=n.text.replaceAll(`\r +`+u),this.shouldAutoIndent(e,r)){const f={tokenization:{getLineTokens:p=>p===h?e.tokenization.getLineTokens(r.startLineNumber):e.tokenization.getLineTokens(p),getLanguageId:i,getLanguageIdAtPosition:s},getLineContent:p=>p===h?e.getLineContent(r.startLineNumber):e.getLineContent(p)},g=this.matchEnterRule(e,d,a,r.startLineNumber,r.startLineNumber-2);if(g!==null)g!==0&&this.getIndentEditsOfMovingBlock(e,t,r,a,c,g);else{const p=pk(this._autoIndent,f,e.getLanguageIdAtPosition(r.startLineNumber,1),h,d,this._languageConfigurationService);if(p!==null){const m=pi(e.getLineContent(r.startLineNumber)),b=oa(p,a),v=oa(m,a);if(b!==v){const w=b-v;this.getIndentEditsOfMovingBlock(e,t,r,a,c,w)}}}}}this._selectionId=t.trackSelection(r)}buildIndentConverter(e,t,i){return{shiftIndent:s=>oc.shiftIndent(s,s.length+1,e,t,i),unshiftIndent:s=>oc.unshiftIndent(s,s.length+1,e,t,i)}}parseEnterResult(e,t,i,s,o){if(o){let r=o.indentation;o.indentAction===jn.None||o.indentAction===jn.Indent?r=o.indentation+o.appendText:o.indentAction===jn.IndentOutdent?r=o.indentation:o.indentAction===jn.Outdent&&(r=t.unshiftIndent(o.indentation)+o.appendText);const a=e.getLineContent(s);if(this.trimStart(a).indexOf(this.trimStart(r))>=0){const l=pi(e.getLineContent(s));let c=pi(r);const d=Mme(e,s,this._languageConfigurationService);d!==null&&d&2&&(c=t.unshiftIndent(c));const h=oa(c,i),u=oa(l,i);return h-u}}return null}matchEnterRuleMovingDown(e,t,i,s,o,r){if(jc(r)>=0){const a=e.getLineMaxColumn(o),l=ry(this._autoIndent,e,new D(o,a,o,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,l)}else{let a=s-1;for(;a>=1;){const d=e.getLineContent(a);if(jc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=ry(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}}matchEnterRule(e,t,i,s,o,r){let a=o;for(;a>=1;){let d;if(a===o&&r!==void 0?d=r:d=e.getLineContent(a),jc(d)>=0)break;a--}if(a<1||s>e.getLineCount())return null;const l=e.getLineMaxColumn(a),c=ry(this._autoIndent,e,new D(a,l,a,l),this._languageConfigurationService);return this.parseEnterResult(e,t,i,s,c)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4||!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1),s=e.getLanguageIdAtPosition(t.endLineNumber,1);return!(i!==s||this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport===null)}getIndentEditsOfMovingBlock(e,t,i,s,o,r){for(let a=i.startLineNumber;a<=i.endLineNumber;a++){const l=e.getLineContent(a),c=pi(l),h=oa(c,s)+r,u=qk(h,s,o);u!==c&&(t.addEditOperation(new D(a,1,a,c.length+1),u),a===i.endLineNumber&&i.endColumn<=c.length+1&&u===""&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=i;a<=s;a++)o.push(n.getLineContent(a));let r=o.slice(0);return r.sort(LN._COLLATOR.value.compare),t===!0&&(r=r.reverse()),{startLineNumber:i,endLineNumber:s,before:o,after:r}}function Iot(n,e,t){const i=mCe(n,e,t);return i?ln.replace(new D(i.startLineNumber,1,i.endLineNumber,n.getLineMaxColumn(i.endLineNumber)),i.after.join(` +`)):null}class _Ce extends Ne{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map((r,a)=>({selection:r,index:a,ignore:!1}));i.sort((r,a)=>D.compareRangesUsingStarts(r.selection,a.selection));let s=i[0];for(let r=1;r=u.startLineNumber;b--)f.push(i.getLineContent(b));const g=ln.replace(u,f.join(` +`));r.push(g);const p=function(b){return b<=u.endLineNumber?u.endLineNumber-b+u.startLineNumber:b},m=function(b){if(b.isEmpty())return new Ie(p(b.positionLineNumber),b.positionColumn,p(b.positionLineNumber),b.positionColumn);{const v=p(b.selectionStartLineNumber),w=p(b.positionLineNumber),C=b.selectionStartColumn,S=b.positionColumn;return new Ie(v,C,w,S)}};a.push(m(d))}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}}const wF=class wF extends Ne{constructor(){super({id:wF.ID,label:ie(1258,"Trim Trailing Whitespace"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2102),weight:100}})}run(e,t,i){let s=[];i.reason==="auto-save"&&(s=(t.getSelections()||[]).map(d=>new U(d.positionLineNumber,d.positionColumn)));const o=t.getSelection();if(o===null)return;const r=e.get(lt),a=t.getModel(),l=r.getValue("files.trimTrailingWhitespaceInRegexAndStrings",{overrideIdentifier:a==null?void 0:a.getLanguageId(),resource:a==null?void 0:a.uri}),c=new Sot(o,s,l);t.pushUndoStop(),t.executeCommands(this.id,[c]),t.pushUndoStop()}};wF.ID="editor.action.trimTrailingWhitespace";let kU=wF;class Fot extends Ne{constructor(){super({id:"editor.action.deleteLines",label:ie(1259,"Delete Line"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:3113,weight:100},canTriggerInlineEdits:!0})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),s=t.getModel();if(s.getLineCount()===1&&s.getLineMaxColumn(1)===1)return;let o=0;const r=[],a=[];for(let l=0,c=i.length;l1&&(h-=1,f=s.getLineMaxColumn(h)),r.push(ln.replace(new Ie(h,f,u,g),"")),a.push(new Ie(h-o,d.positionColumn,h-o,d.positionColumn)),o+=d.endLineNumber-d.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,r,a),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map(o=>{let r=o.endLineNumber;return o.startLineNumbero.startLineNumber===r.startLineNumber?o.endLineNumber-r.endLineNumber:o.startLineNumber-r.startLineNumber);const i=[];let s=t[0];for(let o=1;o=t[o].startLineNumber?s.endLineNumber=t[o].endLineNumber:(i.push(s),s=t[o]);return i.push(s),i}}class Bot extends Ne{constructor(){super({id:"editor.action.indentLines",label:ie(1260,"Indent Line"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2142,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Wp.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}class Wot extends Ne{constructor(){super({id:"editor.action.outdentLines",label:ie(1261,"Outdent Line"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2140,weight:100},canTriggerInlineEdits:!0})}run(e,t){ay.Outdent.runEditorCommand(e,t,null)}}const CF=class CF extends Ne{constructor(){super({id:CF.ID,label:ie(1262,"Insert Line Above"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3075,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,b3.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}};CF.ID="editor.action.insertLineBefore";let kO=CF;const yF=class yF extends Ne{constructor(){super({id:yF.ID,label:ie(1263,"Insert Line Below"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:2051,weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,b3.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}};yF.ID="editor.action.insertLineAfter";let IO=yF;class wCe extends Ne{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),s=this._getRangesToDelete(t),o=[];for(let l=0,c=s.length-1;lln.replace(l,""));t.pushUndoStop(),t.executeEdits(this.id,a,r),t.pushUndoStop()}}class Hot extends wCe{constructor(){super({id:"deleteAllLeft",label:ie(1264,"Delete All Left"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:2049},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const s=[];let o=0;return t.forEach(r=>{let a;if(r.endColumn===1&&o>0){const l=r.startLineNumber-o;a=new Ie(l,r.startColumn,l,r.startColumn)}else a=new Ie(r.startLineNumber,r.startColumn,r.startLineNumber,r.startColumn);o+=r.endLineNumber-r.startLineNumber,r.intersectRanges(e)?i=a:s.push(a)}),i&&s.unshift(i),s}_getRangesToDelete(e){const t=e.getSelections();if(t===null)return[];let i=t;const s=e.getModel();return s===null?[]:(i.sort(D.compareRangesUsingStarts),i=i.map(o=>{if(o.isEmpty())if(o.startColumn===1){const r=Math.max(1,o.startLineNumber-1),a=o.startLineNumber===1?1:s.getLineLength(r)+1;return new D(r,a,o.startLineNumber,1)}else return new D(o.startLineNumber,1,o.startLineNumber,o.startColumn);else return new D(o.startLineNumber,1,o.endLineNumber,o.endColumn)}),i)}}class Vot extends wCe{constructor(){super({id:"deleteAllRight",label:ie(1265,"Delete All Right"),precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100},canTriggerInlineEdits:!0})}_getEndCursorState(e,t){let i=null;const s=[];for(let o=0,r=t.length,a=0;o{if(o.isEmpty()){const r=t.getLineMaxColumn(o.startLineNumber);return o.startColumn===r?new D(o.startLineNumber,o.startColumn,o.startLineNumber+1,1):new D(o.startLineNumber,o.startColumn,o.startLineNumber,r)}return o});return s.sort(D.compareRangesUsingStarts),s}}class zot extends Ne{constructor(){super({id:"editor.action.joinLines",label:ie(1266,"Join Lines"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:0,mac:{primary:296},weight:100},canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;let s=t.getSelection();if(s===null)return;i.sort(D.compareRangesUsingStarts);const o=[],r=i.reduce((u,f)=>u.isEmpty()?u.endLineNumber===f.startLineNumber?(s.equalsSelection(u)&&(s=f),f):f.startLineNumber>u.endLineNumber+1?(o.push(u),f):new Ie(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn):f.startLineNumber>u.endLineNumber?(o.push(u),f):new Ie(u.startLineNumber,u.startColumn,f.endLineNumber,f.endColumn));o.push(r);const a=t.getModel();if(a===null)return;const l=[],c=[];let d=s,h=0;for(let u=0,f=o.length;u=1){let R=!0;S===""&&(R=!1),R&&(S.charAt(S.length-1)===" "||S.charAt(S.length-1)===" ")&&(R=!1,S=S.replace(/[\s\uFEFF\xA0]+$/g," "));const M=I.substr(E-1);S+=(R?" ":"")+M,R?b=M.length+1:b=M.length}else b=0}const L=new D(p,m,v,w);if(!L.isEmpty()){let x;g.isEmpty()?(l.push(ln.replace(L,S)),x=new Ie(L.startLineNumber-h,S.length-b+1,p-h,S.length-b+1)):g.startLineNumber===g.endLineNumber?(l.push(ln.replace(L,S)),x=new Ie(g.startLineNumber-h,g.startColumn,g.endLineNumber-h,g.endColumn)):(l.push(ln.replace(L,S)),x=new Ie(g.startLineNumber-h,g.startColumn,g.startLineNumber-h,S.length-C)),D.intersectRanges(L,s)!==null?d=x:c.push(x)}h+=L.endLineNumber-L.startLineNumber}c.unshift(d),t.pushUndoStop(),t.executeEdits(this.id,l,c),t.pushUndoStop()}}class jot extends Ne{constructor(){super({id:"editor.action.transpose",label:ie(1267,"Transpose Characters around the Cursor"),precondition:H.writable,canTriggerInlineEdits:!0})}run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=[];for(let r=0,a=i.length;r=d){if(c.lineNumber===s.getLineCount())continue;const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new ao(new Ie(c.lineNumber,Math.max(1,c.column-1),c.lineNumber+1,1),u))}else{const h=new D(c.lineNumber,Math.max(1,c.column-1),c.lineNumber,c.column+1),u=s.getValueInRange(h).split("").reverse().join("");o.push(new MY(h,u,new Ie(c.lineNumber,c.column+1,c.lineNumber,c.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}}class Gw extends Ne{run(e,t){const i=t.getSelections();if(i===null)return;const s=t.getModel();if(s===null)return;const o=t.getOption(148),r=[];for(const a of i)if(a.isEmpty()){const l=a.getStartPosition(),c=t.getConfiguredWordAtPosition(l);if(!c)continue;const d=new D(l.lineNumber,c.startColumn,l.lineNumber,c.endColumn),h=s.getValueInRange(d);r.push(ln.replace(d,this._modifyText(h,o)))}else{const l=s.getValueInRange(a);r.push(ln.replace(a,this._modifyText(l,o)))}t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop()}}class $ot extends Gw{constructor(){super({id:"editor.action.transformToUppercase",label:ie(1268,"Transform to Uppercase"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleUpperCase()}}class Uot extends Gw{constructor(){super({id:"editor.action.transformToLowercase",label:ie(1269,"Transform to Lowercase"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){return e.toLocaleLowerCase()}}class Uc{constructor(e,t){this._pattern=e,this._flags=t,this._actual=null,this._evaluated=!1}get(){if(!this._evaluated){this._evaluated=!0;try{this._actual=new RegExp(this._pattern,this._flags)}catch{}}return this._actual}isSupported(){return this.get()!==null}}const SF=class SF extends Gw{constructor(){super({id:"editor.action.transformToTitlecase",label:ie(1270,"Transform to Title Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=SF.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,s=>s.toLocaleUpperCase()):e}};SF.titleBoundary=new Uc("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");let EO=SF;const z0=class z0 extends Gw{constructor(){super({id:"editor.action.transformToSnakecase",label:ie(1271,"Transform to Snake Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=z0.caseBoundary.get(),s=z0.singleLetters.get();return!i||!s?e:e.replace(i,"$1_$2").replace(s,"$1_$2$3").toLocaleLowerCase()}};z0.caseBoundary=new Uc("(\\p{Ll})(\\p{Lu})","gmu"),z0.singleLetters=new Uc("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");let Kk=z0;const Dp=class Dp extends Gw{constructor(){super({id:"editor.action.transformToCamelcase",label:ie(1272,"Transform to Camel Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){var a;const i=/\r\n|\r|\n/.test(e)?Dp.multiLineWordBoundary.get():Dp.singleLineWordBoundary.get(),s=Dp.validWordStart.get();if(!i||!s)return e;const o=e.split(i);return((a=o.shift())==null?void 0:a.replace(s,l=>l.toLocaleLowerCase()))+o.map(l=>l.substring(0,1).toLocaleUpperCase()+l.substring(1)).join("")}};Dp.singleLineWordBoundary=new Uc("[_\\s-]+","gm"),Dp.multiLineWordBoundary=new Uc("[_-]+","gm"),Dp.validWordStart=new Uc("^(\\p{Lu}[^\\p{Lu}])","gmu");let Gk=Dp;const Tp=class Tp extends Gw{constructor(){super({id:"editor.action.transformToPascalcase",label:ie(1273,"Transform to Pascal Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Tp.wordBoundary.get(),s=Tp.wordBoundaryToMaintain.get(),o=Tp.upperCaseWordMatcher.get();return!i||!s||!o?e:e.split(s).map(l=>l.split(i)).flat().map(l=>{const c=l.charAt(0).toLocaleUpperCase()+l.slice(1);return c.length>1&&o.test(c)?c.charAt(0)+c.slice(1).toLocaleLowerCase():c}).join("")}};Tp.wordBoundary=new Uc("[_ \\t-]","gm"),Tp.wordBoundaryToMaintain=new Uc("(?<=\\.)","gm"),Tp.upperCaseWordMatcher=new Uc("^\\p{Lu}+$","mu");let NO=Tp;const Rp=class Rp extends Gw{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every(t=>t.isSupported())}constructor(){super({id:"editor.action.transformToKebabcase",label:ie(1274,"Transform to Kebab Case"),precondition:H.writable,canTriggerInlineEdits:!0})}_modifyText(e,t){const i=Rp.caseBoundary.get(),s=Rp.singleLetters.get(),o=Rp.underscoreBoundary.get();return!i||!s||!o?e:e.replace(o,"$1-$3").replace(i,"$1-$2").replace(s,"$1-$2").toLocaleLowerCase()}};Rp.caseBoundary=new Uc("(\\p{Ll})(\\p{Lu})","gmu"),Rp.singleLetters=new Uc("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),Rp.underscoreBoundary=new Uc("(\\S)(_)(\\S)","gm");let DO=Rp;we(Eot);we(Not);we(Dot);we(Tot);we(Rot);we(Mot);we(Aot);we(Pot);we(kU);we(Fot);we(Bot);we(Wot);we(kO);we(IO);we(Hot);we(Vot);we(zot);we(jot);we($ot);we(Uot);we(Oot);Kk.caseBoundary.isSupported()&&Kk.singleLetters.isSupported()&&we(Kk);Gk.singleLineWordBoundary.isSupported()&&Gk.multiLineWordBoundary.isSupported()&&we(Gk);NO.wordBoundary.isSupported()&&we(NO);EO.titleBoundary.isSupported()&&we(EO);DO.isSupported()&&we(DO);var qot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tle=function(n,e){return function(t,i){e(t,i,n)}};function Kot(n){var e;return n.sourceId+" @@ "+JSON.stringify({...n,modelUri:(e=n.modelUri)==null?void 0:e.toString(),sourceId:void 0})}let TO=class extends G{static cast(){return this}constructor(e,t,i){super(),this._key=e,this._contextKeyService=t,this._dataChannelService=i,this._isEnabledContextKeyValue=Got("structuredLogger.enabled:"+this._key,this._contextKeyService).recomputeInitiallyAndOnChange(this._store),this.isEnabled=this._isEnabledContextKeyValue.map(s=>s!==void 0)}log(e){return this._isEnabledContextKeyValue.get()?(this._dataChannelService.getDataChannel("structuredLogger:"+this._key).sendData(e),!0):!1}};TO=qot([tle(1,Xe),tle(2,sX)],TO);function Got(n,e){return qt(e.onDidChangeContext,()=>e.getContextKeyValue(n))}var Yot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ile=function(n,e){return function(t,i){e(t,i,n)}};let IU=class extends G{constructor(e,t,i){var r;super(),this._editor=e,this._instantiationService=t,this._loggerService=i,this._structuredLogger=this._register(this._instantiationService.createInstance(TO.cast(),"editor.inlineSuggest.logChangeReason.commandId"));const s=(r=this._loggerService)==null?void 0:r.createLogger("textModelChanges",{hidden:!1,name:"Text Model Changes Reason"}),o=qt(this,s.onDidChangeLogLevel,()=>s.getLevel());this._register(qe(a=>{_pe(o.read(a),bs.Trace)&&a.store.add(this._editor.onDidChangeModelContent(l=>{var c;((c=this._editor.getModel())==null?void 0:c.uri.scheme)!=="output"&&s.trace("onDidChangeModelContent: "+l.detailedReasons.map(d=>d.toKey(Number.MAX_VALUE)).join(", "))}))})),this._register(qe(a=>{this._editor instanceof ow&&this._structuredLogger.isEnabled.read(a)&&a.store.add(this._editor.onDidChangeModelContent(l=>{const c=this._editor.getModel();if(!c)return;const d=l.detailedReasons[0],h={...d.metadata,sourceId:"TextModel.setChangeReason",source:d.metadata.source,time:Date.now(),modelUri:c.uri,modelVersion:c.getVersionId()};setTimeout(()=>{this._structuredLogger.log(h)},0)}))}))}};IU=Yot([ile(1,Ae),ile(2,ppe)],IU);function nle(n,e=$s){return j4e(n,e)?n.charAt(0).toUpperCase()+n.slice(1):n}var Zot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xot=function(n,e){return function(t,i){e(t,i,n)}};class sle{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(i!==void 0)return i}}}class ole{constructor(e,t,i,s){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=s}resolve(e){const{name:t}=e;if(t==="SELECTION"||t==="TM_SELECTED_TEXT"){let i=this._model.getValueInRange(this._selection)||void 0,s=this._selection.startLineNumber!==this._selection.endLineNumber;if(!i&&this._overtypingCapturer){const o=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);o&&(i=o.value,s=o.multiline)}if(i&&s&&e.snippet){const o=this._model.getLineContent(this._selection.startLineNumber),r=pi(o,0,this._selection.startColumn-1);let a=r;e.snippet.walk(c=>c===e?!1:(c instanceof gr&&(a=pi(Ca(c.value).pop())),!0));const l=Gc(a,r);i=i.replace(/(\r\n|\r|\n)(.*)/g,(c,d,h)=>`${d}${a.substr(l)}${h}`)}return i}else{if(t==="TM_CURRENT_LINE")return this._model.getLineContent(this._selection.positionLineNumber);if(t==="TM_CURRENT_WORD"){const i=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return i&&i.word||void 0}else{if(t==="TM_LINE_INDEX")return String(this._selection.positionLineNumber-1);if(t==="TM_LINE_NUMBER")return String(this._selection.positionLineNumber);if(t==="CURSOR_INDEX")return String(this._selectionIdx);if(t==="CURSOR_NUMBER")return String(this._selectionIdx+1)}}}}class rle{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if(t==="TM_FILENAME")return sg(this._model.uri.fsPath);if(t==="TM_FILENAME_BASE"){const i=sg(this._model.uri.fsPath),s=i.lastIndexOf(".");return s<=0?i:i.slice(0,s)}else{if(t==="TM_DIRECTORY")return IR(this._model.uri.fsPath)==="."?"":this._labelService.getUriLabel(X5(this._model.uri));if(t==="TM_DIRECTORY_BASE")return IR(this._model.uri.fsPath)==="."?"":sg(IR(this._model.uri.fsPath));if(t==="TM_FILEPATH")return this._labelService.getUriLabel(this._model.uri);if(t==="RELATIVE_FILEPATH")return this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0})}}}class ale{constructor(e,t,i,s){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=s}resolve(e){if(e.name!=="CLIPBOARD")return;const t=this._readClipboardText();if(t){if(this._spread){const i=t.split(/\r\n|\n|\r/).filter(s=>!Ige(s));if(i.length===this._selectionCount)return i[this._selectionIdx]}return t}}}let RO=class{constructor(e,t,i){this._model=e,this._selection=t,this._languageConfigurationService=i}resolve(e){const{name:t}=e,i=this._model.getLanguageIdAtPosition(this._selection.selectionStartLineNumber,this._selection.selectionStartColumn),s=this._languageConfigurationService.getLanguageConfiguration(i).comments;if(s){if(t==="LINE_COMMENT")return s.lineCommentToken||void 0;if(t==="BLOCK_COMMENT_START")return s.blockCommentStartToken||void 0;if(t==="BLOCK_COMMENT_END")return s.blockCommentEndToken||void 0}}};RO=Zot([Xot(2,qi)],RO);const Wh=class Wh{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if(t==="CURRENT_YEAR")return String(this._date.getFullYear());if(t==="CURRENT_YEAR_SHORT")return String(this._date.getFullYear()).slice(-2);if(t==="CURRENT_MONTH")return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if(t==="CURRENT_DATE")return String(this._date.getDate().valueOf()).padStart(2,"0");if(t==="CURRENT_HOUR")return String(this._date.getHours().valueOf()).padStart(2,"0");if(t==="CURRENT_MINUTE")return String(this._date.getMinutes().valueOf()).padStart(2,"0");if(t==="CURRENT_SECOND")return String(this._date.getSeconds().valueOf()).padStart(2,"0");if(t==="CURRENT_DAY_NAME")return Wh.dayNames[this._date.getDay()];if(t==="CURRENT_DAY_NAME_SHORT")return Wh.dayNamesShort[this._date.getDay()];if(t==="CURRENT_MONTH_NAME")return Wh.monthNames[this._date.getMonth()];if(t==="CURRENT_MONTH_NAME_SHORT")return Wh.monthNamesShort[this._date.getMonth()];if(t==="CURRENT_SECONDS_UNIX")return String(Math.floor(this._date.getTime()/1e3));if(t==="CURRENT_TIMEZONE_OFFSET"){const i=this._date.getTimezoneOffset(),s=i>0?"-":"+",o=Math.trunc(Math.abs(i/60)),r=o<10?"0"+o:o,a=Math.abs(i)-o*60,l=a<10?"0"+a:a;return s+r+":"+l}}};Wh.dayNames=[_(1406,"Sunday"),_(1407,"Monday"),_(1408,"Tuesday"),_(1409,"Wednesday"),_(1410,"Thursday"),_(1411,"Friday"),_(1412,"Saturday")],Wh.dayNamesShort=[_(1413,"Sun"),_(1414,"Mon"),_(1415,"Tue"),_(1416,"Wed"),_(1417,"Thu"),_(1418,"Fri"),_(1419,"Sat")],Wh.monthNames=[_(1420,"January"),_(1421,"February"),_(1422,"March"),_(1423,"April"),_(1424,"May"),_(1425,"June"),_(1426,"July"),_(1427,"August"),_(1428,"September"),_(1429,"October"),_(1430,"November"),_(1431,"December")],Wh.monthNamesShort=[_(1432,"Jan"),_(1433,"Feb"),_(1434,"Mar"),_(1435,"Apr"),_(1436,"May"),_(1437,"Jun"),_(1438,"Jul"),_(1439,"Aug"),_(1440,"Sep"),_(1441,"Oct"),_(1442,"Nov"),_(1443,"Dec")];let MO=Wh;class lle{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=Cqe(this._workspaceService.getWorkspace());if(!vqe(t)){if(e.name==="WORKSPACE_NAME")return this._resolveWorkspaceName(t);if(e.name==="WORKSPACE_FOLDER")return this._resoveWorkspacePath(t)}}_resolveWorkspaceName(e){if(Cz(e))return sg(e.uri.path);let t=sg(e.configPath.path);return t.endsWith(yz)&&(t=t.substr(0,t.length-yz.length-1)),t}_resoveWorkspacePath(e){if(Cz(e))return nle(e.uri.fsPath);const t=sg(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?nle(i):"/"}}class cle{resolve(e){const{name:t}=e;if(t==="RANDOM")return Math.random().toString().slice(-6);if(t==="RANDOM_HEX")return Math.random().toString(16).slice(-6);if(t==="UUID")return Ow()}}var Qot=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jot=function(n,e){return function(t,i){e(t,i,n)}},pd;const Dc=class Dc{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Pte(t.placeholders,Al.compareByIndex),this._placeholderGroupsIdx=-1}initialize(e){this._offset=e.newPosition}dispose(){this._placeholderDecorations&&this._editor.removeDecorations([...this._placeholderDecorations.values()]),this._placeholderGroups.length=0}_initDecorations(){if(this._offset===-1)throw new Error("Snippet not initialized!");if(this._placeholderDecorations)return;this._placeholderDecorations=new Map;const e=this._editor.getModel();this._editor.changeDecorations(t=>{for(const i of this._snippet.placeholders){const s=this._snippet.offset(i),o=this._snippet.fullLen(i),r=D.fromPositions(e.getPositionAt(this._offset+s),e.getPositionAt(this._offset+s+o)),a=i.isFinalTabstop?Dc._decor.inactiveFinal:Dc._decor.inactive,l=t.addDecoration(r,a);this._placeholderDecorations.set(i,l)}})}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const s=[];for(const o of this._placeholderGroups[this._placeholderGroupsIdx])if(o.transform){const r=this._placeholderDecorations.get(o),a=this._editor.getModel().getDecorationRange(r),l=this._editor.getModel().getValueInRange(a),c=o.transform.resolve(l).split(/\r\n|\r|\n/);for(let d=1;d0&&this._editor.executeEdits("snippet.placeholderTransform",s)}let t=!1;e===!0&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations(s=>{const o=new Set,r=[];for(const a of this._placeholderGroups[this._placeholderGroupsIdx]){const l=this._placeholderDecorations.get(a),c=this._editor.getModel().getDecorationRange(l);r.push(new Ie(c.startLineNumber,c.startColumn,c.endLineNumber,c.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(a),s.changeDecorationOptions(l,a.isFinalTabstop?Dc._decor.activeFinal:Dc._decor.active),o.add(a);for(const d of this._snippet.enclosingPlaceholders(a)){const h=this._placeholderDecorations.get(d);s.changeDecorationOptions(h,d.isFinalTabstop?Dc._decor.activeFinal:Dc._decor.active),o.add(d)}}for(const[a,l]of this._placeholderDecorations)o.has(a)||s.changeDecorationOptions(l,a.isFinalTabstop?Dc._decor.inactiveFinal:Dc._decor.inactive);return r});return t?this.move(e):i??[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof Al){const i=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(i).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||this._placeholderGroups.length===0}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(this._snippet.placeholders.length===0)return!0;if(this._snippet.placeholders.length===1){const[e]=this._snippet.placeholders;if(e.isFinalTabstop&&this._snippet.rightMostDescendant===e)return!0}return!1}computePossibleSelections(){const e=new Map;for(const t of this._placeholderGroups){let i;for(const s of t){if(s.isFinalTabstop)break;i||(i=[],e.set(s.index,i));const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);if(!r){e.delete(s.index);break}i.push(r)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(e!=null&&e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);if(i)return{range:i,choice:e.choice}}get hasChoice(){let e=!1;return this._snippet.walk(t=>(e=t instanceof fx,!e)),e}merge(e){const t=this._editor.getModel();this._nestingLevel*=10,this._editor.changeDecorations(i=>{for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=e.shift();console.assert(o._offset!==-1),console.assert(!o._placeholderDecorations);const r=o._snippet.placeholderInfo.last.index;for(const l of o._snippet.placeholderInfo.all)l.isFinalTabstop?l.index=s.index+(r+1)/this._nestingLevel:l.index=s.index+l.index/this._nestingLevel;this._snippet.replace(s,o._snippet.children);const a=this._placeholderDecorations.get(s);i.removeDecoration(a),this._placeholderDecorations.delete(s);for(const l of o._snippet.placeholders){const c=o._snippet.offset(l),d=o._snippet.fullLen(l),h=D.fromPositions(t.getPositionAt(o._offset+c),t.getPositionAt(o._offset+c+d)),u=i.addDecoration(h,Dc._decor.inactive);this._placeholderDecorations.set(l,u)}}this._placeholderGroups=Pte(this._snippet.placeholders,Al.compareByIndex)})}};Dc._decor={active:st.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:st.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:st.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:st.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};let AO=Dc;const dle={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let PO=pd=class{static adjustWhitespace(e,t,i,s,o){const r=e.getLineContent(t.lineNumber),a=pi(r,0,t.column-1);let l;return s.walk(c=>{if(!(c instanceof gr)||c.parent instanceof fx||o&&!o.has(c))return!0;const d=c.value.split(/\r\n|\r|\n/);if(i){const u=s.offset(c);if(u===0)d[0]=e.normalizeIndentation(d[0]);else{l=l??s.toString();const f=l.charCodeAt(u-1);(f===10||f===13)&&(d[0]=e.normalizeIndentation(a+d[0]))}for(let f=1;fC.get(Rg)),g=e.invokeWithinContext(C=>new rle(C.get(lw),u)),p=()=>a,m=u.getValueInRange(pd.adjustSelection(u,e.getSelection(),i,0)),b=u.getValueInRange(pd.adjustSelection(u,e.getSelection(),0,s)),v=u.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),w=e.getSelections().map((C,S)=>({selection:C,idx:S})).sort((C,S)=>D.compareRangesUsingStarts(C.selection,S.selection));for(const{selection:C,idx:S}of w){let L=pd.adjustSelection(u,C,i,0),x=pd.adjustSelection(u,C,0,s);m!==u.getValueInRange(L)&&(L=C),b!==u.getValueInRange(x)&&(x=C);const I=C.setStartPosition(L.startLineNumber,L.startColumn).setEndPosition(x.endLineNumber,x.endColumn),E=new mw().parse(t,!0,o),R=I.getStartPosition(),M=pd.adjustWhitespace(u,R,r||S>0&&v!==u.getLineFirstNonWhitespaceColumn(C.positionLineNumber),E);E.resolveVariables(new sle([g,new ale(p,S,w.length,e.getOption(88)==="spread"),new ole(u,C,S,l),new RO(u,C,c),new MO,new lle(f),new cle])),d[S]=ln.replace(I,E.toString()),d[S].identifier={major:S,minor:0},d[S]._isTracked=!0,h[S]=new AO(e,E,M)}return{edits:d,snippets:h}}static createEditsAndSnippetsFromEdits(e,t,i,s,o,r,a){if(!e.hasModel()||t.length===0)return{edits:[],snippets:[]};const l=[],c=e.getModel(),d=new mw,h=new OD,u=new sle([e.invokeWithinContext(g=>new rle(g.get(lw),c)),new ale(()=>o,0,e.getSelections().length,e.getOption(88)==="spread"),new ole(c,e.getSelection(),0,r),new RO(c,e.getSelection(),a),new MO,new lle(e.invokeWithinContext(g=>g.get(Rg))),new cle]);t=t.sort((g,p)=>D.compareRangesUsingStarts(g.range,p.range));let f=0;for(let g=0;g0){const L=t[g-1].range,x=D.fromPositions(L.getEndPosition(),p.getStartPosition()),I=new gr(c.getValueInRange(x));h.appendChild(I),f+=I.value.length}const v=d.parseFragment(m,h);pd.adjustWhitespace(c,p.getStartPosition(),b!==void 0?!b:s,h,new Set(v)),h.resolveVariables(u);const w=h.toString(),C=w.slice(f);f=w.length;const S=ln.replace(p,C);S.identifier={major:g,minor:0},S._isTracked=!0,l.push(S)}return d.ensureFinalTabstop(h,i,!0),{edits:l,snippets:[new AO(e,h,"")]}}constructor(e,t,i=dle,s){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=s,this._templateMerges=[],this._snippets=[]}dispose(){ei(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(e){if(!this._editor.hasModel())return;const{edits:t,snippets:i}=typeof this._template=="string"?pd.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):pd.createEditsAndSnippetsFromEdits(this._editor,this._template,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService);this._snippets=i,this._editor.executeEdits(e??vo.snippet(),t,s=>{const o=s.filter(r=>!!r.identifier);for(let r=0;rIe.fromPositions(r.range.getEndPosition()))}),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=dle){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:s}=pd.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,o=>{const r=o.filter(l=>!!l.identifier);for(let l=0;lIe.fromPositions(l.range.getEndPosition()))})}next(){const e=this._move(!0);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}prev(){const e=this._move(!1);this._editor.setSelections(e),this._editor.revealPositionInCenterIfOutsideViewport(e[0].getPosition())}_move(e){const t=[];for(const i of this._snippets){const s=i.move(e);t.push(...s)}return t}get isAtFirstPlaceholder(){return this._snippets[0].isAtFirstPlaceholder}get isAtLastPlaceholder(){return this._snippets[0].isAtLastPlaceholder}get hasPlaceholder(){return this._snippets[0].hasPlaceholder}get hasChoice(){return this._snippets[0].hasChoice}get activeChoice(){return this._snippets[0].activeChoice}isSelectionWithinPlaceholders(){if(!this.hasPlaceholder)return!1;const e=this._editor.getSelections();if(e.length{o.push(...s.get(r))})}e.sort(D.compareRangesUsingStarts);for(const[i,s]of t){if(s.length!==e.length){t.delete(i);continue}s.sort(D.compareRangesUsingStarts);for(let o=0;o0}};PO=pd=Qot([Jot(3,qi)],PO);var ert=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},j2=function(n,e){return function(t,i){e(t,i,n)}},FC;const hle={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};var nu;let Xo=(nu=class{static get(e){return e.getContribution(FC.ID)}constructor(e,t,i,s,o){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=o,this._inSnippetObservable=Ze(this,!1),this._snippetListener=new ne,this._modelVersionId=-1,this._inSnippet=FC.InSnippetMode.bindTo(s),this._hasNextTabstop=FC.HasNextTabstop.bindTo(s),this._hasPrevTabstop=FC.HasPrevTabstop.bindTo(s)}dispose(){var e;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),(e=this._session)==null||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,typeof t>"u"?hle:{...hle,...t})}catch(i){this.cancel(),this._logService.error(i),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&typeof e!="string"&&this.cancel(),this._session?(Ft(typeof e=="string"),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new PO(this._editor,e,t,this._languageConfigurationService),this._session.insert(t.reason)),t.undoStopAfter&&this._editor.getModel().pushStackElement(),(i=this._session)!=null&&i.hasChoice){const s={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(d,h)=>{if(!this._session||d!==this._editor.getModel()||!U.equals(this._editor.getPosition(),h))return;const{activeChoice:u}=this._session;if(!u||u.choice.options.length===0)return;const f=d.getValueInRange(u.range),g=!!u.choice.options.find(m=>m.value===f),p=[];for(let m=0;m{r==null||r.dispose(),a=!1},c=()=>{a||(r=this._languageFeaturesService.completionProvider.register({language:o.getLanguageId(),pattern:o.uri.fsPath,scheme:o.uri.scheme,exclusive:!0},s),this._snippetListener.add(r),a=!0)};this._choiceCompletions={provider:s,enable:c,disable:l}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent(s=>s.isFlush&&this.cancel())),this._snippetListener.add(this._editor.onDidChangeModel(()=>this.cancel())),this._snippetListener.add(this._editor.onDidChangeCursorSelection(()=>this._updateState()))}}_updateState(){if(!(!this._session||!this._editor.hasModel())){if(this._modelVersionId===this._editor.getModel().getAlternativeVersionId())return this.cancel();if(!this._session.hasPlaceholder)return this.cancel();if(this._session.isAtLastPlaceholder||!this._session.isSelectionWithinPlaceholders())return this._editor.getModel().pushStackElement(),this.cancel();this._inSnippet.set(!0),this._inSnippetObservable.set(!0,void 0),this._hasPrevTabstop.set(!this._session.isAtFirstPlaceholder),this._hasNextTabstop.set(!this._session.isAtLastPlaceholder),this._handleChoice()}}_handleChoice(){var t;if(!this._session||!this._editor.hasModel()){this._currentChoice=void 0;return}const{activeChoice:e}=this._session;if(!e||!this._choiceCompletions){(t=this._choiceCompletions)==null||t.disable(),this._currentChoice=void 0;return}this._currentChoice!==e.choice&&(this._currentChoice=e.choice,this._choiceCompletions.enable(),queueMicrotask(()=>{yot(this._editor,this._choiceCompletions.provider)}))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._inSnippetObservable.set(!1,void 0),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,(t=this._session)==null||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;(e=this._session)==null||e.prev(),this._updateState()}next(){var e;(e=this._session)==null||e.next(),this._updateState()}isInSnippet(){return!!this._inSnippet.get()}get isInSnippetObservable(){return this._inSnippetObservable}},FC=nu,nu.ID="snippetController2",nu.InSnippetMode=new Se("inSnippetMode",!1,_(1402,"Whether the editor in current in snippet mode")),nu.HasNextTabstop=new Se("hasNextTabstop",!1,_(1403,"Whether there is a next tab stop when in snippet mode")),nu.HasPrevTabstop=new Se("hasPrevTabstop",!1,_(1404,"Whether there is a previous tab stop when in snippet mode")),nu);Xo=FC=ert([j2(1,Li),j2(2,De),j2(3,Xe),j2(4,qi)],Xo);At(Xo.ID,Xo,4);const s8=hs.bindToContribution(Xo.get);ye(new s8({id:"jumpToNextSnippetPlaceholder",precondition:le.and(Xo.InSnippetMode,Xo.HasNextTabstop),handler:n=>n.next(),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:2}}));ye(new s8({id:"jumpToPrevSnippetPlaceholder",precondition:le.and(Xo.InSnippetMode,Xo.HasPrevTabstop),handler:n=>n.prev(),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:1026}}));ye(new s8({id:"leaveSnippet",precondition:Xo.InSnippetMode,handler:n=>n.cancel(!0),kbOpts:{weight:130,kbExpr:H.textInputFocus,primary:9,secondary:[1033]}}));ye(new s8({id:"acceptSnippet",precondition:Xo.InSnippetMode,handler:n=>n.finish()}));function kN(n){return new trt(n)}class trt extends Hpe{constructor(e){super(),this._textModel=e}getOffset(e){return this._textModel.getOffsetAt(e)}getPosition(e){return this._textModel.getPositionAt(e)}}const irt=[];function nrt(){return irt}function ule(n){return srt(n).map(t=>t.getEndPosition())}function srt(n){const e=YM.createSortPermutation(n,co(s=>s.range,D.compareRangesUsingStarts)),i=new ga(e.apply(n)).getNewRanges();return e.inverse().apply(i)}function ort(n,e){const t=kN(e),i=e.getValue();return n.map(r=>t.getStringReplacement(r)).map(r=>r.removeCommonSuffixPrefix(i)).map(r=>t.getTextReplacement(r))}function rrt(n,e){const t=Ze("result",[]),i=[];return e.add(qe(s=>{const o=n.read(s);vi(r=>{if(o.length!==i.length){i.length=o.length;for(let a=0;aa.set(o[l],r))})})),t}class art{constructor(e){this._contextKeyService=e}bind(e,t){return Dh(e,this._contextKeyService,t instanceof Function?t:i=>t.read(i))}}function fle(n,e){return new Promise(t=>{let i;const s=setTimeout(()=>{i&&i.dispose(),t()},n);e&&(i=e.onCancellationRequested(()=>{clearTimeout(s),i&&i.dispose(),t()}))})}class lrt{constructor(e,t,i,s=crt){this.startValue=e,this.endValue=t,this.durationMs=i,this._interpolationFunction=s,this.startTimeMs=Date.now(),e===t&&(this.durationMs=0)}isFinished(){return Date.now()>=this.startTimeMs+this.durationMs}getValue(){const e=Date.now()-this.startTimeMs;return e>=this.durationMs?this.endValue:this._interpolationFunction(e,this.startValue,this.endValue-this.startValue,this.durationMs)}}function crt(n,e,t,i){return n===i?e+t:t*(-Math.pow(2,-10*n/i)+1)+e}function drt(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}class hrt{constructor(e){this._value=Ze(this,e)}getValue(e){const t=this._value.read(e);return t.isFinished()||OO.instance.invalidateOnNextAnimationFrame(e),t.getValue()}}const xF=class xF{constructor(){this._counter=Vl(this),this._isScheduled=!1}invalidateOnNextAnimationFrame(e){this._counter.read(e),this._isScheduled||(this._isScheduled=!0,ii().requestAnimationFrame(()=>{this._isScheduled=!1,this._update()}))}_update(){this._counter.trigger(void 0)}};xF.instance=new xF;let OO=xF;class IN{constructor(e,t){this.lineNumber=e,this.parts=t,Xm(()=>nD(t,(i,s)=>i.column<=s.column))}equals(e){return this.lineNumber===e.lineNumber&&this.parts.length===e.parts.length&&this.parts.every((t,i)=>t.equals(e.parts[i]))}renderForScreenReader(e){if(this.parts.length===0)return"";const t=this.parts[this.parts.length-1],i=e.substr(0,t.column-1);return new ga([...this.parts.map(o=>new An(D.fromPositions(new U(1,o.column)),o.lines.map(r=>r.line).join(` +`)))]).applyToString(i).substring(this.parts[0].column-1)}isEmpty(){return this.parts.every(e=>e.lines.length===0)}get lineCount(){return 1+this.parts.reduce((e,t)=>e+t.lines.length-1,0)}}class FO{constructor(e,t,i,s=[]){this.column=e,this.text=t,this.preview=i,this._inlineDecorations=s,this.lines=Ca(this.text).map((o,r)=>({line:o,lineDecorations:Ko.filter(this._inlineDecorations,r+1,1,o.length+1)}))}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every((t,i)=>t.line===e.lines[i].line&&Ko.equalsArr(t.lineDecorations,e.lines[i].lineDecorations))}}class EU{constructor(e,t,i,s=0){this.lineNumber=e,this.columnRange=t,this.text=i,this.additionalReservedLineCount=s,this.parts=[new FO(this.columnRange.endColumnExclusive,this.text,!1)],this.newLines=Ca(this.text)}renderForScreenReader(e){return this.newLines.join(` +`)}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every(e=>e.lines.length===0)}equals(e){return this.lineNumber===e.lineNumber&&this.columnRange.equals(e.columnRange)&&this.newLines.length===e.newLines.length&&this.newLines.every((t,i)=>t===e.newLines[i])&&this.additionalReservedLineCount===e.additionalReservedLineCount}}function gle(n,e){return Fi(n,e,CCe)}function CCe(n,e){return n===e?!0:!n||!e?!1:n instanceof IN&&e instanceof IN||n instanceof EU&&e instanceof EU?n.equals(e):!1}function Gf(n,e,t){const i=t?n.range.intersectRanges(t):n.range;if(!i)return n;const s=n.text.replaceAll(`\r `,` -`),o=e.getValueInRange(i,1),r=Kc(o,s),a=rs.ofText(o.substring(0,r)).addToPosition(n.range.getStartPosition()),l=s.substring(r),c=D.fromPositions(a,n.range.getEndPosition());return new On(c,l)}function kCe(n,e){return n.text.startsWith(e.text)&&grt(n.range,e.range)}function grt(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}function _le(n,e,t,i,s=0){let o=Gf(n,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=mi(r).length;if(o.range.startColumn-1<=a){const g=mi(o.text).length,p=r.substring(o.range.startColumn-1,a),[m,b]=[o.range.getStartPosition(),o.range.getEndPosition()],v=m.column+p.length<=b.column?m.delta(0,p.length):b,w=D.fromPositions(v,b),C=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new On(w,C)}const c=e.getValueInRange(o.range),d=prt(c,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const g=d.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-s;for(const g of d){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const m=g.modifiedStart+g.modifiedLength,b=Math.max(g.modifiedStart,Math.min(m,f)),v=o.text.substring(g.modifiedStart,b),w=o.text.substring(b,Math.max(g.modifiedStart,m));v.length>0&&u.push(new FO(p,v,!1)),w.length>0&&u.push(new FO(p,w,!0))}return new EN(h,u)}let xh;function prt(n,e){if((xh==null?void 0:xh.originalValue)===n&&(xh==null?void 0:xh.newValue)===e)return xh==null?void 0:xh.changes;{let t=vle(n,e,!0);if(t){const i=ble(t);if(i>0){const s=vle(n,e,!1);s&&ble(s)5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;hd&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return s+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}function mrt(n,e){let t,i=!1;const s=new Zge(new ho(n,void 0,e.update),(o,r)=>{i||(t=e.initial instanceof Function?e.initial():e.initial,i=!0);const a=e.update(o,t,r);return t=a,a},e.changeTracker,()=>{var o;i&&((o=e.disposeFinal)==null||o.call(e,t),i=!1)},e.equalityComparer??dl,(o,r,a)=>{if(!i)throw new ze("Can only set when there is a listener! This is to prevent leaks.");cS(r,l=>{t=o,s.setValue(o,l,a)})},ls.ofCaller());return s}var _rt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wle=function(n,e){return function(t,i){e(t,i,n)}};class brt{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let DU=class extends brt{constructor(e,t){super(e,(i,s)=>{let o=!0;s&&TU in s&&(o=!!s[TU]),o&&t.getDataChannel("editTelemetry").sendData({eventName:i,data:s??{}})})}};DU=_rt([wle(0,Ro),wle(1,oX)],DU);const TU=Symbol("shouldForwardToChannel");function vrt(n){return{[TU]:n}}function Cle(n){if(!n)return!1;const e=n.toLowerCase();return e==="github.copilot"||e==="github.copilot-chat"}function wrt(n){const e=n.map(i=>new zs(Me.ofStartAndLength(i.rangeOffset,i.rangeLength),i.text));return e.reverse(),new Dg(e)}function Crt(n,e){n.publicLog2("inlineCompletion.endOfLife",e)}var RU;(function(n){function e(t,i){return!t.isInlineEdit&&!t.uri?Yk.create(t,i):ky.create(t,i)}n.create=e})(RU||(RU={}));class ECe{constructor(e,t,i){this._data=e,this.identity=t,this.hint=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===Mr.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){var e,t;return(e=this.hint)!=null&&e.range&&!this.hint.jumpToEdit?(t=this.hint)==null?void 0:t.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}}const LF=class LF{constructor(){this._onDispose=Ul(this),this._jumpedTo=Ze(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+LF.idCounter++}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,this._refCount===0&&this._onDispose.trigger(void 0)}setJumpTo(e){this._jumpedTo.set(!0,e)}};LF.idCounter=0;let BO=LF;class IN{static create(e){return new IN(D.lift(e.range),e.content,e.style,e.jumpToEdit)}constructor(e,t,i,s){this.range=e,this.content=t,this.style=i,this.jumpToEdit=s}withEdit(e,t){const i=new Me(t.getOffset(this.range.getStartPosition()),t.getOffset(this.range.getEndPosition())),s=g_e([i],e)[0];if(!s)return;const o=t.getRange(s);return new IN(o,this.content,this.style,this.jumpToEdit)}}class Yk extends ECe{static create(e,t){const i=new BO,s=kN(t),o=e.insertText.replace(/\r\n|\r|\n/g,t.getEOL()),r=Srt(new zs(s.getOffsetRange(e.range),o),t),a=r.removeCommonSuffixAndPrefix(t.getValue()),l=s.getTextReplacement(r),c=e.hint?IN.create(e.hint):void 0;return new Yk(r,a,l,l.range,e.snippetInfo,e.additionalTextEdits,e,i,c)}constructor(e,t,i,s,o,r,a,l,c){super(a,l,c),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=s,this.snippetInfo=o,this.additionalTextEdits=r,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new Yk(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,e,this.hint)}withEdit(e,t){const i=g_e([this._edit.replaceRange],e);if(i.length===0)return;const s=new zs(i[0],this._textEdit.text),o=kN(t),r=o.getTextReplacement(s);let a=this.hint;if(a&&(a=a.withEdit(e,o),!a))return;const l=s.removeCommonSuffixAndPrefix(t.getValue());return new Yk(s,l,r,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,a)}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&rs.ofRange(i).isGreaterThanOrEqualTo(rs.ofRange(this._originalRange))}isVisible(e,t){const i=this.getSingleTextEdit();return ICe(i,this._originalRange,e,t)}}function ICe(n,e,t,i){const s=Gf(n,t),o=n.range;if(!o||e&&!e.getStartPosition().equals(o.getStartPosition())||i.lineNumber!==s.range.startLineNumber||s.isEmpty)return!1;const r=t.getValueInRange(s.range,1),a=s.text,l=Math.max(0,i.column-s.range.startColumn);let c=a.substring(0,l),d=a.substring(l),h=r.substring(0,l),u=r.substring(l);const f=t.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),c=c.trimStart(),c.length===0&&(d=d.trimStart())),c.startsWith(h)&&!!lbe(u,d)}class ky extends ECe{static create(e,t){const i=yrt(t,e.range,e.insertText),s=new mw(t),o=fa.fromStringEdit(i,s),r=i.isEmpty()?new On(new D(1,1,1,1),""):o.toReplacement(s),a=new BO,l=i.replacements.map(d=>{const h=D.fromPositions(t.getPositionAt(d.replaceRange.start),t.getPositionAt(d.replaceRange.endExclusive)),u=t.getValueInRange(h);return WO.create(d,u)}),c=e.hint?IN.create(e.hint):void 0;return new ky(i,r,e.uri,e,a,l,c,!1,t.getVersionId())}constructor(e,t,i,s,o,r,a,l=!1,c){super(s,o,a),this._edit=e,this._textEdit=t,this.uri=i,this._edits=r,this._lastChangePartOfInlineEdit=l,this._inlineEditModelVersion=c,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new ky(this._edit,this._textEdit,this.uri,this._data,e,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(e,t,i){if(t=t.map(h=>h.applyTextModelChanges(e)),t.some(h=>h.edit===void 0))return;const s=i.getVersionId();let o=this._inlineEditModelVersion;const r=t.some(h=>h.lastChangeUpdatedEdit);if(r&&(o=s??-1),s===null||o+20!h.edit.isEmpty),t.length===0))return;const a=new Dg(t.map(h=>h.edit)),l=kN(i),c=l.getTextEdit(a).toReplacement(new mw(i));let d=this.hint;if(!(d&&(d=d.withEdit(e,l),!d)))return new ky(a,c,this.uri,this._data,this.identity,t,d,r,o)}}function yrt(n,e,t){const i=n.getEOL(),s=n.getValueInRange(e),o=t.replace(/\r\n|\r|\n/g,i),l=FH.getDefault().computeDiff(wa(s),wa(o),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(u=>u.innerChanges??[]);function c(u,f){const g=rs.fromPosition(f.getStartPosition());return rs.ofRange(f).createRange(g.addToPosition(u))}const d=new Yp(o);return new Dg(l.map(u=>{const f=c(e.getStartPosition(),u.originalRange),g=kN(n).getOffsetRange(f),p=d.getValueOfRange(u.modifiedRange),m=new zs(g,p),b=n.getValueInRange(f);return xrt(m,b,l.length,n)}))}class WO{static create(e,t){const i=Kc(e.newText,t),s=Sg(e.newText,t),o=e.newText.substring(i,e.newText.length-s);return new WO(e,o,i,s)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,s,o=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=s,this._lastChangeUpdatedEdit=o}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new WO(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new ze("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);if(!t){this._edit=void 0;return}this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged}_applyChanges(e,t){let i=e.replaceRange.start,s=e.replaceRange.endExclusive,o=e.newText,r=!1;const a=this._prefixLength>0||this._suffixLength>0;for(let l=t.replacements.length-1;l>=0;l--){const c=t.replacements[l],d=c.newText.length>0&&c.replaceRange.isEmpty;if(d&&!a&&c.replaceRange.start===i&&o.startsWith(c.newText)){i+=c.newText.length,o=o.substring(c.newText.length),s=Math.max(i,s),r=!0;continue}if(d&&a&&c.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(c.newText)){s+=c.newText.length,r=!0,this._prefixLength+=c.newText.length,this._trimmedNewText=this._trimmedNewText.substring(c.newText.length);continue}if(c.newText.length===0&&c.replaceRange.length>0&&c.replaceRange.start>=i+this._prefixLength&&c.replaceRange.endExclusive<=s-this._suffixLength){s-=c.replaceRange.length,r=!0;continue}if(c.equals(e)){r=!0,i=c.replaceRange.endExclusive,o="";continue}if(!(c.replaceRange.start>s)){if(c.replaceRange.endExclusive1&&n.newText.endsWith(t)&&!n.newText.startsWith(t)?new zs(n.replaceRange.delta(-1),t+n.newText.slice(0,-t.length)):n}function Lrt(n,e){const t=new w_e,i=new y_e(t,c=>e.getLanguageConfiguration(c)),s=new C_e(new krt([n]),i),o=DV(s,[],void 0,!0);let r="";const a=n.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=cn(d,c.openingBracket.length),c.child&&(l(c.child,d),d=cn(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=cn(d,c.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=u}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,cn(d,c.length));else if(c.kind===4)for(const h of c.children)l(h,d),d=cn(d,h.length)}}return l(o,fr),r}class krt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class GX{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(e,t){const i=new GX;for(const s of e)i._nodes.add(s);for(const s of e){const o=t(s);if(o.length>0){const r=new Set;for(const a of o)r.add(a);i._outgoingEdges.set(s,r)}}return i}removeCycles(){const e=[],t=new Set,i=new Set,s=[],o=r=>{t.add(r),i.add(r);const a=this._outgoingEdges.get(r);if(a)for(const l of a)t.has(l)?i.has(l)&&(e.push(l),s.push({from:r,to:l})):o(l);i.delete(r)};for(const r of this._nodes)t.has(r)||o(r);for(const{from:r,to:a}of s){const l=this._outgoingEdges.get(r);l&&l.delete(a)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}}var So;(function(n){n.Jump="jump",n.Accept="accept",n.Inactive="inactive"})(So||(So={}));var jt;(function(n){n.GhostText="ghostText",n.Custom="custom",n.SideBySide="sideBySide",n.Deletion="deletion",n.InsertionInline="insertionInline",n.InsertionMultiLine="insertionMultiLine",n.WordReplacements="wordReplacements",n.LineReplacement="lineReplacement",n.Collapsed="collapsed"})(jt||(jt={}));function Ert(n,e,t,i,s,o){const r=Mme("icr"),a=new Wi;let l;const c={...i,requestUuid:r},d=Trt(e,t),h=wVe(n,b=>b.groupId),u=GX.from(n,b=>{var v;return((v=b.yieldsToGroupIds)==null?void 0:v.flatMap(w=>h.get(w)??[]))??[]}),{foundCycles:f}=u.removeCycles();f.length>0&&Bn(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${f.map(b=>b.toString?b.toString():""+b).join(" -> ")}`));let g=0;const p=new aH(async b=>{try{if(g++,a.token.isCancellationRequested)return;const v=u.getOutgoing(b);for(const E of v){const I=await p.get(E);if(I)for(const R of I.inlineSuggestions.items){if(R.isInlineEdit||typeof R.insertText!="string"&&R.insertText!==void 0)return;if(R.insertText!==void 0){const M=new On(D.lift(R.range)??d,R.insertText);if(ICe(M,void 0,t,e))return}}}let w;const C=Date.now();try{w=await b.provideInlineCompletions(t,e,c,a.token)}catch(E){Bn(E);return}const S=Date.now();if(!w)return;const L=[],x=new Drt(w,L,b);if(x.addRef(),DCe(a.token,()=>x.removeRef(l)),a.token.isCancellationRequested)return;for(const E of w.items)L.push(Irt(E,x,d,t,o,c,s,{startTime:C,endTime:S}));return x}finally{g--}}),m=Xl.fromPromisesResolveOrder(n.map(b=>p.get(b))).filter(Ts);return{contextWithUuid:c,get didAllProvidersReturn(){return g===0},lists:m,cancelAndDispose:b=>{l===void 0&&(l=b,a.dispose(!0))}}}function DCe(n,e){if(n.isCancellationRequested)return e(),G.None;{const t=n.onCancellationRequested(()=>{t.dispose(),e()});return{dispose:()=>t.dispose()}}}function Irt(n,e,t,i,s,o,r,a){let l,c,d=n.range?D.lift(n.range):t;if(typeof n.insertText=="string"){if(l=n.insertText,s&&n.completeBracketPairs){l=yle(l,d.getStartPosition(),i,s);const h=l.length-n.insertText.length;h!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+h))}c=void 0}else if(n.insertText===void 0)l="",c=void 0,d=new D(1,1,1,1);else if("snippet"in n.insertText){const h=n.insertText.snippet.length;if(s&&n.completeBracketPairs){n.insertText.snippet=yle(n.insertText.snippet,d.getStartPosition(),i,s);const f=n.insertText.snippet.length-h;f!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+f))}const u=new vw().parse(n.insertText.snippet);u.children.length===1&&u.children[0]instanceof ur?(l=u.children[0].value,c=void 0):(l=u.toString(),c={snippet:n.insertText.snippet,range:d})}else iD(n.insertText);return new Nrt(d,l,c,He.revive(n.uri),n.hint,n.additionalTextEdits||ort(),n,e,o,n.isInlineEdit??!1,r,a,n.correlationId)}class Nrt{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){this.range=e,this.insertText=t,this.snippetInfo=i,this.uri=s,this.hint=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,this.context=c,this.isInlineEdit=d,this._requestInfo=h,this._providerRequestInfo=u,this._correlationId=f,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:h.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,s){var r,a;if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=s,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const o=new VI(s.lineCountModified,s.lineCountOriginal,s.characterCountModified,s.characterCountOriginal);(a=(r=this.source.provider).handleItemDidShow)==null||a.call(r,this.source.inlineSuggestions,this.sourceInlineCompletion,t,o),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){var s,o;this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,(o=(s=this.source.provider).handlePartialAccept)==null||o.call(s,this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:Q1.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===Q1.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(i=>i.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}setIsPreceeded(e){this._isPreceeded=!0,(this._partiallyAcceptedSinceOriginal.characters!==0||this._partiallyAcceptedSinceOriginal.ratio!==0||this._partiallyAcceptedSinceOriginal.count!==0)&&console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??(this._notShownReason=e)}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===jt.Collapsed;!i&&this._showUncollapsedStartTime===void 0&&(this._showUncollapsedStartTime=t),i&&this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(this._showStartTime===void 0)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}var Zk;(function(n){n.TextEditor="textEditor",n.DiffEditor="diffEditor",n.Notebook="notebook"})(Zk||(Zk={}));class Drt{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,this.refCount===0){for(const t of this.inlineSuggestionsData)t.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}}function Trt(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new D(n.lineNumber,t.startColumn,n.lineNumber,i):D.fromPositions(n,n.with(void 0,i))}function yle(n,e,t,i){const s=t.getLineContent(e.lineNumber),o=zs.replace(new Me(e.column-1,s.length),n),r=t.tokenization.tokenizeLinesAt(e.lineNumber,[o.replace(s)]),a=r==null?void 0:r[0].sliceZeroCopy(o.getRangeAfterReplace());return a?Lrt(a,i):n}var Rrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pL=function(n,e){return function(t,i){e(t,i,n)}},MU,w1;let AU=(w1=class extends G{constructor(e,t,i,s,o,r,a,l,c){var h;super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=s,this._languageConfigurationService=o,this._logService=r,this._configurationService=a,this._instantiationService=l,this._contextKeyService=c,this._updateOperation=this._register(new Kt),this._state=mrt(this,{initial:()=>({inlineCompletions:Rc.createEmpty(),suggestWidgetInlineCompletions:Rc.createEmpty()}),disposeFinal:u=>{u.inlineCompletions.dispose(),u.suggestWidgetInlineCompletions.dispose()},changeTracker:hVe(()=>({versionId:this._versionId})),update:(u,f,g)=>{const p=Dg.compose(g.changes.map(m=>m.change?wrt(m.change.changes):Dg.empty).filter(Ts));if(p.isEmpty())return f;try{return{inlineCompletions:f.inlineCompletions.createStateWithAppliedEdit(p,this._textModel),suggestWidgetInlineCompletions:f.suggestWidgetInlineCompletions.createStateWithAppliedEdit(p,this._textModel)}}finally{f.inlineCompletions.dispose(),f.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,u=>u.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,u=>u.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=oe(this,u=>{this._versionId.read(u),this._updateOperation.clear()}),this._loadingCount=Ze(this,0),this._loggingEnabled=Ire("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=Ire("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(TO.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const d=((h=IR.defaultChatAgent)==null?void 0:h.completionsEnablementSetting)??void 0;d&&(this._updateCompletionsEnablement(d),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration(d)&&this._updateCompletionsEnablement(d)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(e){const t=this._configurationService.getValue(e);ns(t)?this._completionsEnabled=t:this._completionsEnabled=void 0}_log(e){this._loggingEnabled.get()&&this._logService.info(Yot(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,s,o,r,a){var p,m;const l=this._cursorPosition.get(),c=new Mrt(l,i,this._textModel.getVersionId(),new Set(e)),d=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if((p=this._updateOperation.value)!=null&&p.request.satisfies(c))return this._updateOperation.value.promise;if((m=d==null?void 0:d.request)!=null&&m.satisfies(c))return Promise.resolve(!0);const h=!!this._updateOperation.value;this._updateOperation.clear();const u=new Wi,f=(async()=>{const b=new ne;this._loadingCount.set(this._loadingCount.get()+1,void 0);let v=!1;const w=()=>{v||(v=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};b.add(new ai(()=>w(),10*1e3)).schedule();const S=e.filter(x=>x.providerId),L=new Art(i,a,S);try{const x=this._debounceValue.get(this._textModel),E=zpe(e.map(j=>j.debounceDelayMs),IMe(pa))??x;if((h||o&&i.triggerKind===Mr.Automatic)&&await ple(E,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)return L.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const R=MU._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:R,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:i.selectedSuggestionInfo?!0:void 0},time:Date.now(),provider:t});const M=new Date,A=Ert(e,this._cursorPosition.get(),this._textModel,i,a,this._languageConfigurationService);DCe(u.token,()=>A.cancelAndDispose({kind:"tokenCancellation"}));let W=!1,P=!1;const B=[];for await(const j of A.lists)if(j){j.addRef(),b.add(Re(()=>j.removeRef(j.inlineSuggestionsData.length===0?{kind:"empty"}:{kind:"notTaken"})));for(const Q of j.inlineSuggestionsData){if(P=!0,!i.includeInlineEdits&&(Q.isInlineEdit||Q.showInlineEditMenu)){Q.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!(Q.isInlineEdit||Q.showInlineEditMenu)){Q.setNotShownReason("notInlineCompletionRequested");continue}const Y=RU.create(Q,this._textModel);B.push(Y),!Y.isInlineEdit&&!Y.showInlineEditMenu&&i.triggerKind===Mr.Automatic&&Y.isVisible(this._textModel,this._cursorPosition.get())&&(W=!0)}if(W)break}if(A.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const j=A.didAllProvidersReturn;let Q;(u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)&&(Q="canceled");const Y=B.map(te=>{var ce;return{range:te.editRange.toString(),text:te.insertText,hint:te.hint,isInlineEdit:te.isInlineEdit,showInlineEditMenu:te.showInlineEditMenu,providerId:(ce=te.source.provider.providerId)==null?void 0:ce.toString()}});this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:R,durationMs:Date.now()-M.getTime(),error:Q,result:Y,time:Date.now(),didAllProvidersReturn:j})}if(L.setRequestUuid(A.contextWithUuid.requestUuid),P)L.setHasProducedSuggestion(),B.length>0&&u.token.isCancellationRequested&&B.forEach(j=>j.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(u.token.isCancellationRequested)L.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const j=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");L.setNoSuggestionReasonIfNotSet(j?"completionsQuotaExceeded":"noSuggestion")}const V=i.earliestShownDateTime-Date.now();if(V>0&&await ple(V,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId||r.get()){const j=u.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==c.versionId?"canceled:documentChanged":r.get()?"canceled:userJumped":"unknown";return B.forEach(Q=>Q.setNotShownReasonIfNotSet(j)),!1}const K=new Date;this._debounceValue.update(this._textModel,K.getTime()-M.getTime());const z=this._cursorPosition.get();this._updateOperation.clear(),wi(j=>{const Q=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:Rc.createEmpty(),suggestWidgetInlineCompletions:Q.suggestWidgetInlineCompletions.createStateWithAppliedResults(B,c,this._textModel,z,s)},j):this._state.set({inlineCompletions:Q.inlineCompletions.createStateWithAppliedResults(B,c,this._textModel,z,s),suggestWidgetInlineCompletions:Rc.createEmpty()},j),Q.inlineCompletions.dispose(),Q.suggestWidgetInlineCompletions.dispose()})}finally{b.dispose(),w(),this.sendInlineCompletionsRequestTelemetry(L)}return!0})(),g=new Frt(c,u,f);return this._updateOperation.value=g,f}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:Rc.createEmpty(),suggestWidgetInlineCompletions:Rc.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&wi(i=>{var s,o;if(!e||(((s=t.request)==null?void 0:s.versionId)??-1)>(((o=e.request)==null?void 0:o.versionId)??-1)){e==null||e.dispose();const r=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:Rc.createEmpty()},i),r.inlineCompletions.dispose(),r.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)})}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")||e.requestUuid===void 0||e.hasProducedSuggestion||!Ort(this._completionsEnabled,this._textModel.getLanguageId())||!e.providers.some(s=>{var o;return Cle((o=s.providerId)==null?void 0:o.extensionId)}))return;const t={opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map(s=>{var o;return(o=s.providerId)==null?void 0:o.toString()}).filter(Ts).join(","),...vrt(e.providers.some(s=>{var o;return Cle((o=s.providerId)==null?void 0:o.extensionId)})),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0},i=this._instantiationService.createInstance(DU);Crt(i,t)}clearSuggestWidgetInlineCompletions(e){var t;(t=this._updateOperation.value)!=null&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}},MU=w1,w1._requestId=0,w1);AU=MU=Rrt([pL(4,Ki),pL(5,ki),pL(6,lt),pL(7,Ae),pL(8,Xe)],AU);class Mrt{constructor(e,t,i,s){this.position=e,this.context=t,this.versionId=i,this.providers=s}satisfies(e){return this.position.equals(e.position)&&rv(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,KG())&&(e.context.triggerKind===Mr.Automatic||this.context.triggerKind===Mr.Explicit)&&this.versionId===e.versionId&&Prt(e.providers,this.providers)}}class Art{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??(this.noSuggestionReason=e)}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}function Prt(n,e){return[...n].every(t=>e.has(t))}function Ort(n,e="*"){return n===void 0?!1:typeof n[e]<"u"?!!n[e]:!!n["*"]}class Frt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class Rc extends G{static createEmpty(){return new Rc([],void 0)}constructor(e,t){for(const i of e)i.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const i of this.inlineCompletions)i.removeRef()}})}_findById(e){return this.inlineCompletions.find(t=>t.identity===e)}_findByHash(e){return this.inlineCompletions.find(t=>t.hash===e)}createStateWithAppliedEdit(e,t){const i=this.inlineCompletions.map(s=>s.withEdit(e,t)).filter(Ts);return new Rc(i,this.request)}createStateWithAppliedResults(e,t,i,s,o){let r;if(o){const c=this._findById(o);if(c&&c.canBeReused(i,t.position)){r=c;const d=e.find(h=>h.hash===c.hash);d?e=Wrt(d,e):e=[c,...e]}}const a=r?!r.isInlineEdit:e.some(c=>!c.isInlineEdit&&c.isVisible(i,s));let l=[];for(const c of e){const d=this._findByHash(c.hash);let h;d&&d!==c?(h=c.withIdentity(d.identity),c.setIsPreceeded(d),d.setEndOfLifeReason({kind:Q1.Ignored,userTypingDisagreed:!1,supersededBy:c.getSourceCompletion()})):h=c,a!==h.isInlineEdit&&l.push(h)}return l.sort(lo(c=>c.showInlineEditMenu,tge)),l=Brt(l,c=>c.semanticId),new Rc(l,t)}clone(){return new Rc(this.inlineCompletions,this.request)}}function Brt(n,e){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function Wrt(n,e){const t=e.indexOf(n);return t>-1?[n,...e.slice(0,t),...e.slice(t+1)]:e}class Hrt{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}}const Il=class Il extends G{getTypingInterval(){return(this._cacheInvalidated||this._cachedTypingIntervalResult===null)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(t=>this._updateTypingSpeed(t)))}_updateTypingSpeed(e){const t=Date.now();if(!this._isUserTyping(e)){this._finalizeCurrentSession();return}this._currentSession&&t-this._lastChangeTime>Il.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:t,endTime:t,characterCount:0}),this._currentSession.endTime=t,this._currentSession.characterCount+=this._getActualCharacterCount(e),this._lastChangeTime=t,this._cacheInvalidated=!0}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||e.detailedReasons.length===0)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;switch(e.metadata.source){case"cursor":{const t=e.metadata.kind;return t==="type"||t==="compositionType"||t==="compositionEnd"}default:return!1}}_finalizeCurrentSession(){if(!this._currentSession)return;this._currentSession.endTime-this._currentSession.startTime>=Il.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>Il.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null}_calculateTypingInterval(){if(this._currentSession){const e={...this._currentSession};if(e.endTime-e.startTime>=Il.MIN_SESSION_DURATION_MS&&e.characterCount>0){const i=[...this._typingSessions,e];return this._calculateSpeedFromSessions(i)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(e){if(e.length===0)return{averageInterval:0,characterCount:0};const t=[...e].sort((d,h)=>h.endTime-d.endTime),i=Date.now()-Il.TYPING_SPEED_WINDOW_MS,s=t.filter(d=>d.endTime>i),o=t.splice(s.length);let r=ZM(s.map(d=>d.characterCount));for(let d=0;dd.endTime-d.startTime));if(a===0||r<=1)return{averageInterval:0,characterCount:r};const l=Math.max(1,r-1),c=a/l;return{averageInterval:Math.round(c),characterCount:r}}dispose(){this._finalizeCurrentSession(),super.dispose()}};Il.MAX_SESSION_GAP_MS=3e3,Il.MIN_SESSION_DURATION_MS=1e3,Il.SESSION_HISTORY_LIMIT=50,Il.TYPING_SPEED_WINDOW_MS=3e5,Il.MIN_CHARS_FOR_RELIABLE_SPEED=20;let PU=Il;var Vrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eb=function(n,e){return function(t,i){e(t,i,n)}};let OU=class extends G{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=s,this._debounceValue=o,this._enabled=r,this._editor=a,this._instantiationService=l,this._commandService=c,this._languageConfigurationService=d,this._accessibilityService=h,this._languageFeaturesService=u,this._codeEditorService=f,this._inlineCompletionsService=g,this._isActive=Ze(this,!1),this._onlyRequestInlineEditsSignal=Ul(this),this._forceUpdateExplicitlySignal=Ul(this),this._noDelaySignal=Ul(this),this._fetchSpecificProviderSignal=Ul(this),this._selectedInlineCompletionId=Ze(this,void 0),this.primaryPosition=oe(this,C=>this._positions.read(C)[0]??new U(1,1)),this.allPositions=oe(this,C=>this._positions.read(C)),this._isAcceptingPartially=!1,this._appearedInsideViewport=oe(this,C=>{const S=this.state.read(C);return!S||!S.inlineCompletion?!1:jrt(this._editor,S.inlineCompletion)}),this._onDidAccept=new q,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=oie({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(C,S)=>{var L;return S.didUndo=C.didChange(this._textModelVersionId)&&!!((L=C.change)!=null&&L.isUndoing),!0}}},(C,S)=>{const L=this._textModelVersionId.read(C);return L!==null&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===L-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&S.didUndo?(this._lastAcceptedInlineCompletionInfo=void 0,!0):!1}),this._preserveCurrentCompletionReasons=new Set([_f.Redo,_f.Undo,_f.AcceptWord]),this.dontRefetchSignal=Ul(this),this._fetchInlineCompletionsPromise=oie({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Mr.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(C,S)=>{var L;if(C.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(C.change))&&(S.preserveCurrentCompletion=!0);const x=((L=C.change)==null?void 0:L.detailedReasons)??[];S.changeReason=x.length>0?x[0].getType():"",S.textChange=!0}else C.didChange(this._forceUpdateExplicitlySignal)?(S.preserveCurrentCompletion=!0,S.inlineCompletionTriggerKind=Mr.Explicit):C.didChange(this.dontRefetchSignal)?S.dontRefetch=!0:C.didChange(this._onlyRequestInlineEditsSignal)?S.onlyRequestInlineEdits=!0:C.didChange(this._fetchSpecificProviderSignal)&&(S.provider=C.change);return!0}}},(C,S)=>{var z,j,Q;if(this._source.clearOperationOnTextModelChange.read(C),this._noDelaySignal.read(C),this.dontRefetchSignal.read(C),this._onlyRequestInlineEditsSignal.read(C),this._forceUpdateExplicitlySignal.read(C),this._fetchSpecificProviderSignal.read(C),!((this._enabled.read(C)&&this._selectedSuggestItem.read(C)||this._isActive.read(C))&&(!this._inlineCompletionsService.isSnoozing()||S.inlineCompletionTriggerKind===Mr.Explicit))){this._source.cancelUpdate();return}this._textModelVersionId.read(C);const x=this._source.suggestWidgetInlineCompletions.read(void 0);let E=this._selectedSuggestItem.read(C);if(this._shouldShowOnSuggestConflict.read(void 0)&&(E=void 0),x&&!E&&this._source.seedInlineCompletionsWithSuggestWidget(),S.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(C)&&S.inlineCompletionTriggerKind!==Mr.Explicit){wi(Y=>{this._source.clear(Y)});return}let I="";S.provider?I+="providerOnDidChange":S.inlineCompletionTriggerKind===Mr.Explicit&&(I+="explicit"),S.changeReason&&(I+=I.length>0?`:${S.changeReason}`:S.changeReason);const R=this._typing.getTypingInterval(),M={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:I,typingInterval:R.averageInterval,typingIntervalCharacterCount:R.characterCount,availableProviders:[]};let A={triggerKind:S.inlineCompletionTriggerKind,selectedSuggestionInfo:E==null?void 0:E.toSelectedSuggestionInfo(),includeInlineCompletions:!S.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(C),requestIssuedDateTime:M.startTime,earliestShownDateTime:M.startTime+(S.inlineCompletionTriggerKind===Mr.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};A.triggerKind===Mr.Automatic&&S.textChange&&this.textModel.getAlternativeVersionId()===((z=this._lastShownInlineCompletionInfo)==null?void 0:z.alternateTextModelVersionId)&&(A={...A,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const W=this.selectedInlineCompletion.read(void 0)??((j=this._inlineCompletionItems.read(void 0))==null?void 0:j.inlineEdit),P=S.preserveCurrentCompletion||W!=null&&W.forwardStable?W:void 0,B=this._jumpedToId.map(Y=>{var te,ce;return!!Y&&Y===((ce=(te=this._inlineCompletionItems.read(void 0))==null?void 0:te.inlineEdit)==null?void 0:ce.semanticId)}),V=S.provider?{providers:[S.provider],label:"single:"+((Q=S.provider.providerId)==null?void 0:Q.toString())}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},K=this.getAvailableProviders(V.providers);return M.availableProviders=K.map(Y=>Y.providerId).filter(Ts),this._source.fetch(K,V.label,A,P==null?void 0:P.identity,S.shouldDebounce,B,M)}),this._inlineCompletionItems=no({owner:this},C=>{const S=this._source.inlineCompletions.read(C);if(!S)return;const L=this.primaryPosition.read(C);let x;const E=[];for(const I of S.inlineCompletions)I.isInlineEdit?x=I:I.isVisible(this.textModel,L)&&E.push(I);return E.length!==0&&(x=void 0),{inlineCompletions:E,inlineEdit:x}}),this._filteredInlineCompletionItems=no({owner:this,equalsFn:lI()},C=>{const S=this._inlineCompletionItems.read(C);return(S==null?void 0:S.inlineCompletions)??[]}),this.selectedInlineCompletionIndex=oe(this,C=>{const S=this._selectedInlineCompletionId.read(C),L=this._filteredInlineCompletionItems.read(C),x=this._selectedInlineCompletionId===void 0?-1:L.findIndex(E=>E.semanticId===S);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=oe(this,C=>{const S=this._filteredInlineCompletionItems.read(C),L=this.selectedInlineCompletionIndex.read(C);return S[L]}),this.activeCommands=no({owner:this,equalsFn:lI()},C=>{var S;return((S=this.selectedInlineCompletion.read(C))==null?void 0:S.source.inlineSuggestions.commands)??[]}),this.inlineCompletionsCount=oe(this,C=>{if(this.lastTriggerKind.read(C)===Mr.Explicit)return this._filteredInlineCompletionItems.read(C).length}),this._hasVisiblePeekWidgets=oe(this,C=>this._editorObs.openedPeekWidgets.read(C)>0),this._shouldShowOnSuggestConflict=oe(this,C=>{const S=this._showOnSuggestConflict.read(C);if(S!=="never"&&!!this.selectedInlineCompletion.read(C)){const x=this._selectedSuggestItem.read(C);return x?S==="whenSuggestListIsIncomplete"?x.listIncomplete:!0:!1}return!1}),this.state=no({owner:this,equalsFn:(C,S)=>!C||!S?C===S:C.kind==="ghostText"&&S.kind==="ghostText"?mle(C.ghostTexts,S.ghostTexts)&&C.inlineCompletion===S.inlineCompletion&&C.suggestItem===S.suggestItem:C.kind==="inlineEdit"&&S.kind==="inlineEdit"?C.inlineEdit.equals(S.inlineEdit):!1},C=>{var I,R,M,A,W,P,B;const S=this.textModel;if(this._suppressInSnippetMode.read(C)&&this._isInSnippetMode.read(C))return;const L=this._inlineCompletionItems.read(C),x=L==null?void 0:L.inlineEdit;if(x){if(this._hasVisiblePeekWidgets.read(C))return;let V=x.getSingleTextEdit();V=Gf(V,S);const K=this.primaryPosition.map(ce=>Ye.fromRangeInclusive(x.targetRange).addMargin(1,1).contains(ce.lineNumber)),z=x.source.inlineSuggestions.commands,j=new Hrt(V,z??[],x),Q=x.updatedEdit,Y=Q?fa.fromStringEdit(Q,new mw(this.textModel)).replacements:[V],te=(((R=(I=L.inlineEdit)==null?void 0:I.command)==null?void 0:R.id)==="vscode.open"||((A=(M=L.inlineEdit)==null?void 0:M.command)==null?void 0:A.id)==="_workbench.open")&&((P=(W=L.inlineEdit)==null?void 0:W.command.arguments)!=null&&P.length)?He.from((B=L.inlineEdit)==null?void 0:B.command.arguments[0]):void 0;return{kind:"inlineEdit",inlineEdit:j,inlineCompletion:x,edits:Y,cursorAtInlineEdit:K,nextEditUri:te}}const E=this._selectedSuggestItem.read(C);if(!this._shouldShowOnSuggestConflict.read(C)&&E){const V=Gf(E.getSingleTextEdit(),S),K=this._computeAugmentation(V,C);if(!this._suggestPreviewEnabled.read(C)&&!K)return;const j=(K==null?void 0:K.edit)??V,Q=K?K.edit.text.length-V.text.length:0,Y=this._suggestPreviewMode.read(C),te=this._positions.read(C),Ce=[j,...c6(this.textModel,te,j)].map((Le,Ve)=>({edit:Le,ghostText:Le?_le(Le,S,Y,te[Ve],Q):void 0})).filter(({edit:Le,ghostText:Ve})=>Le!==void 0&&Ve!==void 0),xe=Ce.map(({edit:Le})=>Le),je=Ce.map(({ghostText:Le})=>Le),ke=je[0]??new EN(j.range.endLineNumber,[]);return{kind:"ghostText",edits:xe,primaryGhostText:ke,ghostTexts:je,inlineCompletion:K==null?void 0:K.completion,suggestItem:E}}else{if(!this._isActive.read(C))return;const V=this.selectedInlineCompletion.read(C);if(!V)return;const K=V.getSingleTextEdit(),z=this._inlineSuggestMode.read(C),j=this._positions.read(C),Y=[K,...c6(this.textModel,j,K)].map((Ce,xe)=>({edit:Ce,ghostText:Ce?_le(Ce,S,z,j[xe],0):void 0})).filter(({edit:Ce,ghostText:xe})=>Ce!==void 0&&xe!==void 0),te=Y.map(({edit:Ce})=>Ce),ce=Y.map(({ghostText:Ce})=>Ce);return ce[0]?{kind:"ghostText",edits:te,primaryGhostText:ce[0],ghostTexts:ce,inlineCompletion:V,suggestItem:void 0}:void 0}}),this.inlineCompletionState=oe(this,C=>{const S=this.state.read(C);if(!(!S||S.kind!=="ghostText")&&!this._editorObs.inComposition.read(C))return S}),this.inlineEditState=oe(this,C=>{const S=this.state.read(C);if(!(!S||S.kind!=="inlineEdit"))return S}),this.inlineEditAvailable=oe(this,C=>!!this.inlineEditState.read(C)),this.warning=oe(this,C=>{var S,L;return(L=(S=this.inlineCompletionState.read(C))==null?void 0:S.inlineCompletion)==null?void 0:L.warning}),this.ghostTexts=no({owner:this,equalsFn:mle},C=>{const S=this.inlineCompletionState.read(C);if(S)return S.ghostTexts}),this.primaryGhostText=no({owner:this,equalsFn:LCe},C=>{const S=this.inlineCompletionState.read(C);if(S)return S==null?void 0:S.primaryGhostText}),this.showCollapsed=oe(this,C=>{const S=this.state.read(C);if(!S||S.kind!=="inlineEdit"||S.inlineCompletion.hint)return!1;const L=S.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(C);return(this._inlineEditsShowCollapsedEnabled.read(C)||!L)&&this._jumpedToId.read(C)!==S.inlineCompletion.semanticId&&!this._inAcceptFlow.read(C)}),this._tabShouldIndent=oe(this,C=>{if(this._inAcceptFlow.read(C))return!1;function S(E){return E.startLineNumber!==E.endLineNumber}function L(E,I){const R=E.getLineIndentColumn(I),M=E.getLineLastNonWhitespaceColumn(I),A=Math.max(M,R);return new D(I,R,I,A)}const x=this._editorObs.selections.read(C);return x==null?void 0:x.some(E=>E.isEmpty()?this.textModel.getLineLength(E.startLineNumber)===0:S(E)||E.containsRange(L(this.textModel,E.startLineNumber)))}),this.tabShouldJumpToInlineEdit=oe(this,C=>{var L;if(this._tabShouldIndent.read(C))return!1;const S=this.inlineEditState.read(C);return S?this.showCollapsed.read(C)?!0:this._inAcceptFlow.read(C)&&this._appearedInsideViewport.read(C)&&!((L=S.inlineCompletion.hint)!=null&&L.jumpToEdit)?!1:!S.cursorAtInlineEdit.read(C):!1}),this.tabShouldAcceptInlineEdit=oe(this,C=>{var L;const S=this.inlineEditState.read(C);return!S||this.showCollapsed.read(C)||this._tabShouldIndent.read(C)?!1:this._inAcceptFlow.read(C)&&this._appearedInsideViewport.read(C)&&!((L=S.inlineCompletion.hint)!=null&&L.jumpToEdit)||S.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(C)||this._jumpedToId.read(C)===S.inlineCompletion.semanticId?!0:S.cursorAtInlineEdit.read(C)}),this._jumpedToId=Ze(this,void 0),this._inAcceptFlow=Ze(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(AU,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,C=>{var S;return(S=C==null?void 0:C.request)==null?void 0:S.context.triggerKind}),this._editorObs=Ui(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map(C=>C.preview),this._suggestPreviewMode=p.map(C=>C.previewMode);const m=this._editorObs.getOption(71);this._inlineSuggestMode=m.map(C=>C.mode),this._suppressedInlineCompletionGroupIds=m.map(C=>new Set(C.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=m.map(C=>!!C.edits.enabled),this._inlineEditsShowCollapsedEnabled=m.map(C=>C.edits.showCollapsed),this._triggerCommandOnProviderChange=m.map(C=>C.triggerCommandOnProviderChange),this._minShowDelay=m.map(C=>C.minShowDelay),this._showOnSuggestConflict=m.map(C=>C.experimental.showOnSuggestConflict),this._suppressInSnippetMode=m.map(C=>C.suppressInSnippetMode);const b=Zo.get(this._editor);this._isInSnippetMode=(b==null?void 0:b.isInSnippetObservable)??Ci(!1),this._typing=this._register(new PU(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(C=>{C&&this.stop()}));{const C=this.textModel.uri.scheme==="vscode-notebook-cell",[S]=this._codeEditorService.listDiffEditors().filter(L=>L.getOriginalEditor().getId()===this._editor.getId()||L.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!S,this.editorType=C?Zk.Notebook:this.isInDiffEditor?Zk.DiffEditor:Zk.TextEditor}this._register(dS(this.state,C=>{C&&C.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(C.inlineCompletion.requestUuid)})),this._register(dS(this._fetchInlineCompletionsPromise)),this._register(qe(C=>{this._editorObs.versionId.read(C),this._inAcceptFlow.set(!1,void 0)})),this._register(qe(C=>{this.state.map((L,x)=>!L||L.kind==="inlineEdit"&&!L.cursorAtInlineEdit.read(x)).read(C)&&this._jumpedToId.set(void 0,void 0)}));const v=this.inlineEditState.map(C=>C==null?void 0:C.inlineCompletion.semanticId);this._register(qe(C=>{v.read(C)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}));const w=Ut(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(e));ZG(this,w,(C,S)=>{C.onDidChangeInlineCompletions&&S.add(C.onDidChangeInlineCompletions(()=>{var E;if(!this._enabled.get()||(this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get()){this.trigger(void 0,{onlyFetchInlineEdits:!0});return}const x=this.state.get();x&&(x.inlineCompletion||x.edits)&&((E=x.inlineCompletion)==null?void 0:E.source.provider)!==C||wi(I=>{this._fetchSpecificProviderSignal.trigger(I,C),this.trigger(I)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const s=this==null?void 0:this.primaryGhostText.read(e);if(this!=null&&this._selectedSuggestItem&&s&&s.parts.length>0){const{column:o,lines:r}=s.parts[0],a=r[0].line,l=this.textModel.getLineIndentColumn(s.lineNumber);if(o<=l){let d=Yo(a);d===-1&&(d=a.length-1),t=d>0;const h=this.textModel.getOptions().tabSize;i=Zi.visibleColumnFromColumn(a,d+1,h)!(a.groupId&&t.has(a.groupId))),s=new Set;for(const a of i)(r=a.excludesGroupIds)==null||r.forEach(l=>s.add(l));const o=[];for(const a of i)a.groupId&&s.has(a.groupId)||o.push(a);return o}async trigger(e,t={}){cS(e,i=>{t.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(i),t.noDelay&&this._noDelaySignal.trigger(i),this._isActive.set(!0,i),t.explicit&&(this._inAcceptFlow.set(!0,i),this._forceUpdateExplicitlySignal.trigger(i)),t.provider&&this._fetchSpecificProviderSignal.trigger(i,t.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){return this.trigger(e,{onlyFetchInlineEdits:t,explicit:!0})}stop(e="automatic",t){cS(t,i=>{var s;if(e==="explicitCancel"){const o=(s=this.state.get())==null?void 0:s.inlineCompletion;o&&o.reportEndOfLife({kind:Q1.Rejected})}this._isActive.set(!1,i),this._source.clear(i)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions.filter(a=>!a.isInlineEdit):[this.selectedInlineCompletion.read(t)].filter(Ts);return _5e(o,a=>{let l=a.getSingleTextEdit();return l=Gf(l,i,D.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),kCe(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?wo.inlineCompletionPartialAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):wo.inlineCompletionAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){var o;if(e.getModel()!==this.textModel)throw new ze;let t,i=!1;const s=this.state.get();if((s==null?void 0:s.kind)==="ghostText"){if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;t=s.inlineCompletion}else if((s==null?void 0:s.kind)==="inlineEdit")t=s.inlineCompletion,i=!!s.nextEditUri;else return;t.addRef();try{if(e.pushUndoStop(),!i)if(t.snippetInfo){const r=On.delete(t.editRange),a=t.additionalTextEdits.map(c=>new On(D.lift(c.range),c.text??"")),l=fa.fromParallelReplacementsUnsorted([r,...a]);e.edit(l,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(o=Zo.get(e))==null||o.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const r=s.edits;let a=r;s.kind==="ghostText"&&(a=art(r,this.textModel));const l=gle(a).map(h=>Ie.fromPositions(h)),c=t.additionalTextEdits.map(h=>new On(D.lift(h.range),h.text??"")),d=fa.fromParallelReplacementsUnsorted([...r,...c]);if(e.edit(d,this._getMetadata(t,this.textModel.getLanguageId())),t.hint===void 0&&e.setSelections(s.kind==="inlineEdit"?l.slice(-1):l,"inlineCompletionAccept"),s.kind==="inlineEdit"&&!this._accessibilityService.isMotionReduced()){const h=d.getNewRanges(),u=this._store.add(new zrt(e,h,()=>{this._store.delete(u)}))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,Bn),t.reportEndOfLife({kind:Q1.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),s=this._languageConfigurationService.getLanguageConfiguration(i),o=new RegExp(s.wordDefinition.source,s.wordDefinition.flags.replace("g","")),r=t.match(o);let a=0;r&&r.index!==void 0?r.index===0?a=r[0].length:a=r.index:a=t.length;const c=/\s+/g.exec(t);return c&&c.index!==void 0&&c.index+c[0].length{const i=t.match(/\n/);return i&&i.index!==void 0?i.index+1:t.length},1)}async _acceptNext(e,t,i,s){if(e.getModel()!==this.textModel)throw new ze;const o=this.inlineCompletionState.get();if(!o||o.primaryGhostText.isEmpty()||!o.inlineCompletion)return;const r=o.primaryGhostText,a=o.inlineCompletion;if(a.snippetInfo){await this.accept(e);return}const l=r.parts[0],c=new U(r.lineNumber,l.column),d=l.text,h=i(c,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const u=d.substring(0,h),f=this._positions.get(),g=f[0];a.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const v=D.fromPositions(g,c),w=e.getModel().getValueInRange(v)+u,C=new On(v,w),S=[C,...c6(this.textModel,f,C)].filter(Ts),L=gle(S).map(x=>Ie.fromPositions(x));e.edit(fa.fromParallelReplacementsUnsorted(S),this._getMetadata(a,t)),e.setSelections(L,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const p=D.fromPositions(a.editRange.getStartPosition(),rs.ofText(u).addToPosition(c)),b=e.getModel().getValueInRange(p,1).length;a.reportPartialAccept(b,{kind:s,acceptedLength:b},{characters:h,ratio:h/d.length,count:1})}finally{a.removeRef()}}handleSuggestAccepted(e){const t=Gf(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const o=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:o},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){var i;const e=this.textModel.getValue(),t=(i=this.state.get())==null?void 0:i.inlineCompletion;return{documentValue:e,inlineCompletion:t==null?void 0:t.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&wi(t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,s=i.getStartPosition();if(this._editor.setPosition(s,"inlineCompletions.jump"),i.isSingleLine()&&(e.inlineCompletion.hint||!e.inlineCompletion.insertText.includes(` -`)))this._editor.revealPosition(s);else{const r=new D(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(r,1)}e.inlineCompletion.identity.setJumpTo(t),this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};OU=Vrt([eb(7,Ae),eb(8,Ei),eb(9,Ki),eb(10,Us),eb(11,De),eb(12,Ft),eb(13,I3)],OU);var _f;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(_f||(_f={}));function c6(n,e,t){if(e.length===1)return[];const i=new mw(n),s=i.getTransformer(),o=s.getOffset(e[0]),r=e.slice(1).map(u=>s.getOffset(u));t=t.removeCommonPrefixAndSuffix(i);const a=s.getStringReplacement(t),l=a.replaceRange.start-o,c=a.replaceRange.join(Me.emptyAt(o)),d=i.getValueOfOffsetRange(c);return r.map(u=>{const f=u+l,g=f+a.replaceRange.length,p=new Me(f,g),m=p.join(Me.emptyAt(u));if(i.getValueOfOffsetRange(m)!==d)return;const v=new zs(p,a.newText);return s.getTextReplacement(v)}).filter(Ts)}class zrt extends G{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register(Ui(e).setDecorations(Ci(t.map(r=>({range:r,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const s=new drt(1,0,1e3,urt),o=new frt(s);this._register(qe(r=>{const a=o.getValue(r);e.getContainerDomNode().style.setProperty("--animation-opacity",a.toString()),s.isFinished()&&this.dispose()}))}}function jrt(n,e){const t=e.targetRange,i=n.getVisibleRanges();return i.length<1?!1:new D(i[0].startLineNumber,i[0].startColumn,i[i.length-1].endLineNumber,i[i.length-1].endColumn).containsRange(t)}var $rt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sle=function(n,e){return function(t,i){e(t,i,n)}},HL;class YX{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;ol&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:oS.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class qrt extends YX{constructor(){super("recentlyUsedByPrefix"),this._trie=by.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o=`${e.getLanguageId()}/${s}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:oS.fromString(i.type),this._trie.set(t,i)}}}var jm;let FU=(jm=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new ne,this._persistSoon=new ai(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===km.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var s;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((s=this._strategy)==null?void 0:s.name)!==i){this._saveState();const o=HL._strategyCtors.get(i)||xle;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${HL._storagePrefix}/${i}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${HL._storagePrefix}/${this._strategy.name}`,i,t,1)}}},HL=jm,jm._strategyCtors=new Map([["recentlyUsedByPrefix",qrt],["recentlyUsed",Urt],["first",xle]]),jm._storagePrefix="suggest/memories",jm);FU=HL=$rt([Sle(0,Qo),Sle(1,lt)],FU);const o8=mt("ISuggestMemories");xt(o8,FU,1);var Krt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Grt=function(n,e){return function(t,i){e(t,i,n)}},BU,C1;let HO=(C1=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=BU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(139)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)==null||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(139)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column&&s.getStartPosition().lineNumber===s.getEndPosition().lineNumber)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},BU=C1,C1.AtEnd=new Se("atEndOfWord",!1,{type:"boolean",description:_(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")}),C1);HO=BU=Krt([Grt(1,Xe)],HO);var Yrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Zrt=function(n,e){return function(t,i){e(t,i,n)}},VL,y1;let BS=(y1=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=VL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)==null||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(VL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=VL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},VL=y1,y1.OtherSuggestions=new Se("hasOtherSuggestions",!1),y1);BS=VL=Yrt([Zrt(1,Xe)],BS);class Xrt{constructor(e,t,i,s){this._disposables=new ne,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!Go(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new CA;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Nl=class Nl{async provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Nl._bracketsRightYield(a,0,e,s,r)),await new Promise(a=>Nl._bracketsLeftYield(a,0,e,s,r,o))}return i}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Nl._maxRounds){e();break}if(!s){e();break}const l=i.bracketPairs.findNextBracket(s);if(!l){e();break}if(Date.now()-a>Nl._maxDuration){setTimeout(()=>Nl._bracketsRightYield(e,t+1,i,s,o));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new Uo,o.set(d,u)),u.push(l.range)}}s=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,l=Date.now();for(;;){if(t>=Nl._maxRounds&&o.size===0){e();break}if(!s){e();break}const c=i.bracketPairs.findPrevBracket(s);if(!c){e();break}if(Date.now()-l>Nl._maxDuration){setTimeout(()=>Nl._bracketsLeftYield(e,t+1,i,s,o,r));break}if(c.bracketInfo.isOpeningBracket){const h=c.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const g=f.shift();f.size===0&&o.delete(h);const p=D.fromPositions(c.range.getEndPosition(),g.getStartPosition()),m=D.fromPositions(c.range.getStartPosition(),g.getEndPosition());r.push({range:p}),r.push({range:m}),Nl._addBracketLeading(i,m,r)}}}else{const h=c.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}s=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:D.fromPositions(new U(s,o),t.getEndPosition())}),i.push({range:D.fromPositions(new U(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:D.fromPositions(new U(r,a),t.getEndPosition())}),i.push({range:D.fromPositions(new U(r,1),t.getEndPosition())}))}}};Nl._maxDuration=30,Nl._maxRounds=2;let VO=Nl;const Wh=class Wh{static async create(e,t){if(!t.getOption(134).localityBonus||!t.hasModel())return Wh.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Wh.None;const[o]=await new VO().provideSelectionRanges(i,[s]);if(o.length===0)return Wh.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return Wh.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends Wh{distance(l,c){if(!s.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,h=r[d];if(Jfe(h))return 2<<20;const u=KM(h,D.fromPositions(l),D.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let g=o.length;for(const p of o){if(!D.containsRange(p.range,f))break;g-=1}return g}}}};Wh.None=new class extends Wh{distance(){return 0}};let zO=Wh,Lle=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class jp{constructor(e,t,i,s,o,r,a=$I.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=jp._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=jp._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=jp._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?cw:Bje;for(let c=0;c=f)d.score=jc.Default;else if(typeof d.completion.filterText=="string"){const p=l(s,o,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;lH(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=Aje(s,o,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(s,o,g,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?GB(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return 1;if(t.completion.kind===28)return-1}return jp._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return-1;if(t.completion.kind===28)return 1}return jp._compareCompletionItems(e,t)}}var Qrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},up=function(n,e){return function(t,i){e(t,i,n)}},WU;class tb{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function Jrt(n,e,t){if(!e.getContextKeyValue(hi.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(hi.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(71).suppressSuggestions}function eat(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(hi.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(71).suppressSuggestions}let jO=WU=class{constructor(e,t,i,s,o,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new ne,this._triggerCharacterListener=new ne,this._triggerQuickSuggest=new Ca,this._triggerState=void 0,this._completionDisposables=new ne,this._onDidCancel=new q,this._onDidTrigger=new q,this._onDidSuggest=new q,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new Ie(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){Jt(this._triggerCharacterListener),Jt([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,e.set(s,o)),o.add(i)}const t=i=>{var r;if(!eat(this._editor,this._contextKeyService,this._configurationService)||tb.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let s="";Jm(i.charCodeAt(i.length-1))?ts(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())o.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)==null?void 0:r.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)==null||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;L0.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&((e=Zo.get(this._editor))!=null&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!tb.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=this._editor.getOption(102);if(!L0.isAllOff(s)){if(!L0.isAllOn(s)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),r=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(L0.valueFor(s,r)!=="on")return}Jrt(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){Ot(this._editor.hasModel()),Ot(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new tb(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var u,f,g;if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new tb(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??0};e.triggerCharacter&&(s={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Wi;const o=this._editor.getOption(128);let r=1;switch(o){case"top":r=0;break;case"bottom":r=2;break}const{itemKind:a,showDeprecated:l}=WU.createSuggestFilter(this._editor),c=new xN(r,((u=e.completionOptions)==null?void 0:u.kindFilter)??a,(f=e.completionOptions)==null?void 0:f.providerFilter,(g=e.completionOptions)==null?void 0:g.providerItemsToReuse,l),d=zO.create(this._editorWorkerService,this._editor),h=qX(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,s,this._requestToken.token);Promise.all([h,d]).then(async([p,m])=>{var S;if((S=this._requestToken)==null||S.dispose(),!this._editor.hasModel()){p.disposable.dispose();return}let b=e==null?void 0:e.clipboardText;if(!b&&p.needsClipboard&&(b=await this._clipboardService.readText()),this._triggerState===void 0){p.disposable.dispose();return}const v=this._editor.getModel(),w=new tb(v,this._editor.getPosition(),e),C={...$I.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new jp(p.items,this._context.column,{leadingLineContent:w.leadingLineContent,characterCountDelta:w.column-this._context.column},m,this._editor.getOption(134),this._editor.getOption(128),C,b),this._completionDisposables.add(p.disposable),this._onNewContext(w),this._reportDurationsTelemetry(p.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const L of p.items)L.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${L.provider._debugDisplayName}`,L.completion)}).catch(Je)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(128)==="none"&&t.add(28);const s=e.getOption(134);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(28),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(mi(e.leadingLineContent)!==mi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(tb.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=tb.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};jO=WU=Qrt([up(1,Zr),up(2,xa),up(3,Ro),up(4,ki),up(5,Xe),up(6,lt),up(7,De),up(8,dZ)],jO);const kF=class kF{constructor(e,t){this._disposables=new ne,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;akF._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},d6=function(n,e){return function(t,i){e(t,i,n)}};let VU=class{constructor(e,t,i,s,o){this._menuId=t,this._menuService=s,this._contextKeyService=o,this._menuDisposables=new ne,this.element=ue(e,me(".suggest-status-bar"));const r=a=>a instanceof rl?i.createInstance(MZ,a,{useComma:!1}):void 0;this._leftActions=new Vr(this.element,{actionViewItemProvider:r}),this._rightActions=new Vr(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};VU=tat([d6(2,Ae),d6(3,uc),d6(4,Xe)],VU);var iat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kle=function(n,e){return function(t,i){e(t,i,n)}};function ZX(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let zU=class{constructor(e,t,i){this._editor=e,this._themeService=t,this._markdownRendererService=i,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new q,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new ne,this._renderDisposeable=new ne,this._size=new Qt(330,0),this.domNode=me(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=me(".body"),this._scrollbar=new wD(this._body,{alwaysConsumeMouseWheel:!0}),ue(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ue(this._body,me(".header")),this._close=ue(this._header,me("span"+Ue.asCSSSelector(de.close))),this._close.title=_(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=ue(this._header,me("p.type")),this._docs=ue(this._body,me("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),s=e.get(135)||t.fontSize,o=e.get(136)||t.lineHeight,r=t.fontWeight,a=`${s}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=qd(this._themeService.getColorTheme().type)?2:1,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=_(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var o;this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let r="";r+=`score: ${e.score[0]} +`),o=e.getValueInRange(i,1),r=Gc(o,s),a=ls.ofText(o.substring(0,r)).addToPosition(n.range.getStartPosition()),l=s.substring(r),c=D.fromPositions(a,n.range.getEndPosition());return new An(c,l)}function yCe(n,e){return n.text.startsWith(e.text)&&urt(n.range,e.range)}function urt(n,e){return e.getStartPosition().equals(n.getStartPosition())&&e.getEndPosition().isBeforeOrEqual(n.getEndPosition())}function ple(n,e,t,i,s=0){let o=Gf(n,e);if(o.range.endLineNumber!==o.range.startLineNumber)return;const r=e.getLineContent(o.range.startLineNumber),a=pi(r).length;if(o.range.startColumn-1<=a){const g=pi(o.text).length,p=r.substring(o.range.startColumn-1,a),[m,b]=[o.range.getStartPosition(),o.range.getEndPosition()],v=m.column+p.length<=b.column?m.delta(0,p.length):b,w=D.fromPositions(v,b),C=o.text.startsWith(p)?o.text.substring(p.length):o.text.substring(g);o=new An(w,C)}const c=e.getValueInRange(o.range),d=frt(c,o.text);if(!d)return;const h=o.range.startLineNumber,u=new Array;if(t==="prefix"){const g=d.filter(p=>p.originalLength===0);if(g.length>1||g.length===1&&g[0].originalStart!==c.length)return}const f=o.text.length-s;for(const g of d){const p=o.range.startColumn+g.originalStart+g.originalLength;if(t==="subwordSmart"&&i&&i.lineNumber===o.range.startLineNumber&&p0)return;if(g.modifiedLength===0)continue;const m=g.modifiedStart+g.modifiedLength,b=Math.max(g.modifiedStart,Math.min(m,f)),v=o.text.substring(g.modifiedStart,b),w=o.text.substring(b,Math.max(g.modifiedStart,m));v.length>0&&u.push(new FO(p,v,!1)),w.length>0&&u.push(new FO(p,w,!0))}return new IN(h,u)}let Lh;function frt(n,e){if((Lh==null?void 0:Lh.originalValue)===n&&(Lh==null?void 0:Lh.newValue)===e)return Lh==null?void 0:Lh.changes;{let t=_le(n,e,!0);if(t){const i=mle(t);if(i>0){const s=_le(n,e,!1);s&&mle(s)5e3||e.length>5e3)return;function i(c){let d=0;for(let h=0,u=c.length;hd&&(d=f)}return d}const s=Math.max(i(n),i(e));function o(c){if(c<0)throw new Error("unexpected");return s+c+1}function r(c){let d=0,h=0;const u=new Int32Array(c.length);for(let f=0,g=c.length;fa},{getElements:()=>l}).ComputeDiff(!1).changes}function grt(n,e){let t,i=!1;const s=new qge(new uo(n,void 0,e.update),(o,r)=>{i||(t=e.initial instanceof Function?e.initial():e.initial,i=!0);const a=e.update(o,t,r);return t=a,a},e.changeTracker,()=>{var o;i&&((o=e.disposeFinal)==null||o.call(e,t),i=!1)},e.equalityComparer??dl,(o,r,a)=>{if(!i)throw new Ve("Can only set when there is a listener! This is to prevent leaks.");aS(r,l=>{t=o,s.setValue(o,l,a)})},ds.ofCaller());return s}var prt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ble=function(n,e){return function(t,i){e(t,i,n)}};class mrt{constructor(e,t){this._baseService=e,this._intercept=t}publicLog2(e,t){this._intercept(e,t),this._baseService.publicLog2(e,t)}}let NU=class extends mrt{constructor(e,t){super(e,(i,s)=>{let o=!0;s&&DU in s&&(o=!!s[DU]),o&&t.getDataChannel("editTelemetry").sendData({eventName:i,data:s??{}})})}};NU=prt([ble(0,To),ble(1,sX)],NU);const DU=Symbol("shouldForwardToChannel");function _rt(n){return{[DU]:n}}function vle(n){if(!n)return!1;const e=n.toLowerCase();return e==="github.copilot"||e==="github.copilot-chat"}function brt(n){const e=n.map(i=>new zs(Me.ofStartAndLength(i.rangeOffset,i.rangeLength),i.text));return e.reverse(),new Dg(e)}function vrt(n,e){n.publicLog2("inlineCompletion.endOfLife",e)}var TU;(function(n){function e(t,i){return!t.isInlineEdit&&!t.uri?Yk.create(t,i):xy.create(t,i)}n.create=e})(TU||(TU={}));class SCe{constructor(e,t,i){this._data=e,this.identity=t,this.hint=i}get source(){return this._data.source}get isFromExplicitRequest(){return this._data.context.triggerKind===Pr.Explicit}get forwardStable(){return this.source.inlineSuggestions.enableForwardStability??!1}get editRange(){return this.getSingleTextEdit().range}get targetRange(){var e,t;return(e=this.hint)!=null&&e.range&&!this.hint.jumpToEdit?(t=this.hint)==null?void 0:t.range:this.editRange}get insertText(){return this.getSingleTextEdit().text}get semanticId(){return this.hash}get action(){return this._sourceInlineCompletion.gutterMenuLinkAction}get command(){return this._sourceInlineCompletion.command}get warning(){return this._sourceInlineCompletion.warning}get showInlineEditMenu(){return!!this._sourceInlineCompletion.showInlineEditMenu}get hash(){return JSON.stringify([this.getSingleTextEdit().text,this.getSingleTextEdit().range.getStartPosition().toString()])}get requestUuid(){return this._data.context.requestUuid}get partialAccepts(){return this._data.partialAccepts}get _sourceInlineCompletion(){return this._data.sourceInlineCompletion}addRef(){this.identity.addRef(),this.source.addRef()}removeRef(){this.identity.removeRef(),this.source.removeRef()}reportInlineEditShown(e,t,i){this._data.reportInlineEditShown(e,this.insertText,t,i)}reportPartialAccept(e,t,i){this._data.reportPartialAccept(e,t,i)}reportEndOfLife(e){this._data.reportEndOfLife(e)}setEndOfLifeReason(e){this._data.setEndOfLifeReason(e)}setIsPreceeded(e){this._data.setIsPreceeded(e.partialAccepts)}setNotShownReasonIfNotSet(e){this._data.setNotShownReason(e)}getSourceCompletion(){return this._sourceInlineCompletion}}const LF=class LF{constructor(){this._onDispose=Vl(this),this._jumpedTo=Ze(this,!1),this._refCount=1,this.id="InlineCompletionIdentity"+LF.idCounter++}get jumpedTo(){return this._jumpedTo}addRef(){this._refCount++}removeRef(){this._refCount--,this._refCount===0&&this._onDispose.trigger(void 0)}setJumpTo(e){this._jumpedTo.set(!0,e)}};LF.idCounter=0;let BO=LF;class EN{static create(e){return new EN(D.lift(e.range),e.content,e.style,e.jumpToEdit)}constructor(e,t,i,s){this.range=e,this.content=t,this.style=i,this.jumpToEdit=s}withEdit(e,t){const i=new Me(t.getOffset(this.range.getStartPosition()),t.getOffset(this.range.getEndPosition())),s=d_e([i],e)[0];if(!s)return;const o=t.getRange(s);return new EN(o,this.content,this.style,this.jumpToEdit)}}class Yk extends SCe{static create(e,t){const i=new BO,s=kN(t),o=e.insertText.replace(/\r\n|\r|\n/g,t.getEOL()),r=Crt(new zs(s.getOffsetRange(e.range),o),t),a=r.removeCommonSuffixAndPrefix(t.getValue()),l=s.getTextReplacement(r),c=e.hint?EN.create(e.hint):void 0;return new Yk(r,a,l,l.range,e.snippetInfo,e.additionalTextEdits,e,i,c)}constructor(e,t,i,s,o,r,a,l,c){super(a,l,c),this._edit=e,this._trimmedEdit=t,this._textEdit=i,this._originalRange=s,this.snippetInfo=o,this.additionalTextEdits=r,this.isInlineEdit=!1}get hash(){return JSON.stringify(this._trimmedEdit.toJson())}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new Yk(this._edit,this._trimmedEdit,this._textEdit,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,e,this.hint)}withEdit(e,t){const i=d_e([this._edit.replaceRange],e);if(i.length===0)return;const s=new zs(i[0],this._textEdit.text),o=kN(t),r=o.getTextReplacement(s);let a=this.hint;if(a&&(a=a.withEdit(e,o),!a))return;const l=s.removeCommonSuffixAndPrefix(t.getValue());return new Yk(s,l,r,this._originalRange,this.snippetInfo,this.additionalTextEdits,this._data,this.identity,a)}canBeReused(e,t){const i=this._textEdit.range;return!!i&&i.containsPosition(t)&&this.isVisible(e,t)&&ls.ofRange(i).isGreaterThanOrEqualTo(ls.ofRange(this._originalRange))}isVisible(e,t){const i=this.getSingleTextEdit();return xCe(i,this._originalRange,e,t)}}function xCe(n,e,t,i){const s=Gf(n,t),o=n.range;if(!o||e&&!e.getStartPosition().equals(o.getStartPosition())||i.lineNumber!==s.range.startLineNumber||s.isEmpty)return!1;const r=t.getValueInRange(s.range,1),a=s.text,l=Math.max(0,i.column-s.range.startColumn);let c=a.substring(0,l),d=a.substring(l),h=r.substring(0,l),u=r.substring(l);const f=t.getLineIndentColumn(s.range.startLineNumber);return s.range.startColumn<=f&&(h=h.trimStart(),h.length===0&&(u=u.trimStart()),c=c.trimStart(),c.length===0&&(d=d.trimStart())),c.startsWith(h)&&!!sbe(u,d)}class xy extends SCe{static create(e,t){const i=wrt(t,e.range,e.insertText),s=new fw(t),o=ga.fromStringEdit(i,s),r=i.isEmpty()?new An(new D(1,1,1,1),""):o.toReplacement(s),a=new BO,l=i.replacements.map(d=>{const h=D.fromPositions(t.getPositionAt(d.replaceRange.start),t.getPositionAt(d.replaceRange.endExclusive)),u=t.getValueInRange(h);return WO.create(d,u)}),c=e.hint?EN.create(e.hint):void 0;return new xy(i,r,e.uri,e,a,l,c,!1,t.getVersionId())}constructor(e,t,i,s,o,r,a,l=!1,c){super(s,o,a),this._edit=e,this._textEdit=t,this.uri=i,this._edits=r,this._lastChangePartOfInlineEdit=l,this._inlineEditModelVersion=c,this.snippetInfo=void 0,this.additionalTextEdits=[],this.isInlineEdit=!0}get updatedEditModelVersion(){return this._inlineEditModelVersion}get updatedEdit(){return this._edit}getSingleTextEdit(){return this._textEdit}withIdentity(e){return new xy(this._edit,this._textEdit,this.uri,this._data,e,this._edits,this.hint,this._lastChangePartOfInlineEdit,this._inlineEditModelVersion)}canBeReused(e,t){return this._lastChangePartOfInlineEdit&&this.updatedEditModelVersion===e.getVersionId()}withEdit(e,t){return this._applyTextModelChanges(e,this._edits,t)}_applyTextModelChanges(e,t,i){if(t=t.map(h=>h.applyTextModelChanges(e)),t.some(h=>h.edit===void 0))return;const s=i.getVersionId();let o=this._inlineEditModelVersion;const r=t.some(h=>h.lastChangeUpdatedEdit);if(r&&(o=s??-1),s===null||o+20!h.edit.isEmpty),t.length===0))return;const a=new Dg(t.map(h=>h.edit)),l=kN(i),c=l.getTextEdit(a).toReplacement(new fw(i));let d=this.hint;if(!(d&&(d=d.withEdit(e,l),!d)))return new xy(a,c,this.uri,this._data,this.identity,t,d,r,o)}}function wrt(n,e,t){const i=n.getEOL(),s=n.getValueInRange(e),o=t.replace(/\r\n|\r|\n/g,i),l=OH.getDefault().computeDiff(Ca(s),Ca(o),{ignoreTrimWhitespace:!1,computeMoves:!1,extendToSubwords:!0,maxComputationTimeMs:500}).changes.flatMap(u=>u.innerChanges??[]);function c(u,f){const g=ls.fromPosition(f.getStartPosition());return ls.ofRange(f).createRange(g.addToPosition(u))}const d=new Gp(o);return new Dg(l.map(u=>{const f=c(e.getStartPosition(),u.originalRange),g=kN(n).getOffsetRange(f),p=d.getValueOfRange(u.modifiedRange),m=new zs(g,p),b=n.getValueInRange(f);return yrt(m,b,l.length,n)}))}class WO{static create(e,t){const i=Gc(e.newText,t),s=Sg(e.newText,t),o=e.newText.substring(i,e.newText.length-s);return new WO(e,o,i,s)}get edit(){return this._edit}get lastChangeUpdatedEdit(){return this._lastChangeUpdatedEdit}constructor(e,t,i,s,o=!1){this._edit=e,this._trimmedNewText=t,this._prefixLength=i,this._suffixLength=s,this._lastChangeUpdatedEdit=o}applyTextModelChanges(e){const t=this._clone();return t._applyTextModelChanges(e),t}_clone(){return new WO(this._edit,this._trimmedNewText,this._prefixLength,this._suffixLength,this._lastChangeUpdatedEdit)}_applyTextModelChanges(e){if(this._lastChangeUpdatedEdit=!1,!this._edit)throw new Ve("UpdatedInnerEdits: No edit to apply changes to");const t=this._applyChanges(this._edit,e);if(!t){this._edit=void 0;return}this._edit=t.edit,this._lastChangeUpdatedEdit=t.editHasChanged}_applyChanges(e,t){let i=e.replaceRange.start,s=e.replaceRange.endExclusive,o=e.newText,r=!1;const a=this._prefixLength>0||this._suffixLength>0;for(let l=t.replacements.length-1;l>=0;l--){const c=t.replacements[l],d=c.newText.length>0&&c.replaceRange.isEmpty;if(d&&!a&&c.replaceRange.start===i&&o.startsWith(c.newText)){i+=c.newText.length,o=o.substring(c.newText.length),s=Math.max(i,s),r=!0;continue}if(d&&a&&c.replaceRange.start===i+this._prefixLength&&this._trimmedNewText.startsWith(c.newText)){s+=c.newText.length,r=!0,this._prefixLength+=c.newText.length,this._trimmedNewText=this._trimmedNewText.substring(c.newText.length);continue}if(c.newText.length===0&&c.replaceRange.length>0&&c.replaceRange.start>=i+this._prefixLength&&c.replaceRange.endExclusive<=s-this._suffixLength){s-=c.replaceRange.length,r=!0;continue}if(c.equals(e)){r=!0,i=c.replaceRange.endExclusive,o="";continue}if(!(c.replaceRange.start>s)){if(c.replaceRange.endExclusive1&&n.newText.endsWith(t)&&!n.newText.startsWith(t)?new zs(n.replaceRange.delta(-1),t+n.newText.slice(0,-t.length)):n}function Srt(n,e){const t=new m_e,i=new b_e(t,c=>e.getLanguageConfiguration(c)),s=new __e(new xrt([n]),i),o=NV(s,[],void 0,!0);let r="";const a=n.getLineContent();function l(c,d){if(c.kind===2)if(l(c.openingBracket,d),d=cn(d,c.openingBracket.length),c.child&&(l(c.child,d),d=cn(d,c.child.length)),c.closingBracket)l(c.closingBracket,d),d=cn(d,c.closingBracket.length);else{const u=i.getSingleLanguageBracketTokens(c.openingBracket.languageId).findClosingTokenText(c.openingBracket.bracketIds);r+=u}else if(c.kind!==3){if(c.kind===0||c.kind===1)r+=a.substring(d,cn(d,c.length));else if(c.kind===4)for(const h of c.children)l(h,d),d=cn(d,h.length)}}return l(o,pr),r}class xrt{constructor(e){this.lines=e,this.tokenization={getLineTokens:t=>this.lines[t-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class KX{constructor(){this._nodes=new Set,this._outgoingEdges=new Map}static from(e,t){const i=new KX;for(const s of e)i._nodes.add(s);for(const s of e){const o=t(s);if(o.length>0){const r=new Set;for(const a of o)r.add(a);i._outgoingEdges.set(s,r)}}return i}removeCycles(){const e=[],t=new Set,i=new Set,s=[],o=r=>{t.add(r),i.add(r);const a=this._outgoingEdges.get(r);if(a)for(const l of a)t.has(l)?i.has(l)&&(e.push(l),s.push({from:r,to:l})):o(l);i.delete(r)};for(const r of this._nodes)t.has(r)||o(r);for(const{from:r,to:a}of s){const l=this._outgoingEdges.get(r);l&&l.delete(a)}return{foundCycles:e}}getOutgoing(e){const t=this._outgoingEdges.get(e);return t?Array.from(t):[]}}var yo;(function(n){n.Jump="jump",n.Accept="accept",n.Inactive="inactive"})(yo||(yo={}));var $t;(function(n){n.GhostText="ghostText",n.Custom="custom",n.SideBySide="sideBySide",n.Deletion="deletion",n.InsertionInline="insertionInline",n.InsertionMultiLine="insertionMultiLine",n.WordReplacements="wordReplacements",n.LineReplacement="lineReplacement",n.Collapsed="collapsed"})($t||($t={}));function Lrt(n,e,t,i,s,o){const r=Nme("icr"),a=new Bi;let l;const c={...i,requestUuid:r},d=Nrt(e,t),h=bVe(n,b=>b.groupId),u=KX.from(n,b=>{var v;return((v=b.yieldsToGroupIds)==null?void 0:v.flatMap(w=>h.get(w)??[]))??[]}),{foundCycles:f}=u.removeCycles();f.length>0&&On(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${f.map(b=>b.toString?b.toString():""+b).join(" -> ")}`));let g=0;const p=new rH(async b=>{try{if(g++,a.token.isCancellationRequested)return;const v=u.getOutgoing(b);for(const I of v){const E=await p.get(I);if(E)for(const R of E.inlineSuggestions.items){if(R.isInlineEdit||typeof R.insertText!="string"&&R.insertText!==void 0)return;if(R.insertText!==void 0){const M=new An(D.lift(R.range)??d,R.insertText);if(xCe(M,void 0,t,e))return}}}let w;const C=Date.now();try{w=await b.provideInlineCompletions(t,e,c,a.token)}catch(I){On(I);return}const S=Date.now();if(!w)return;const L=[],x=new Ert(w,L,b);if(x.addRef(),kCe(a.token,()=>x.removeRef(l)),a.token.isCancellationRequested)return;for(const I of w.items)L.push(krt(I,x,d,t,o,c,s,{startTime:C,endTime:S}));return x}finally{g--}}),m=Kl.fromPromisesResolveOrder(n.map(b=>p.get(b))).filter(Ts);return{contextWithUuid:c,get didAllProvidersReturn(){return g===0},lists:m,cancelAndDispose:b=>{l===void 0&&(l=b,a.dispose(!0))}}}function kCe(n,e){if(n.isCancellationRequested)return e(),G.None;{const t=n.onCancellationRequested(()=>{t.dispose(),e()});return{dispose:()=>t.dispose()}}}function krt(n,e,t,i,s,o,r,a){let l,c,d=n.range?D.lift(n.range):t;if(typeof n.insertText=="string"){if(l=n.insertText,s&&n.completeBracketPairs){l=wle(l,d.getStartPosition(),i,s);const h=l.length-n.insertText.length;h!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+h))}c=void 0}else if(n.insertText===void 0)l="",c=void 0,d=new D(1,1,1,1);else if("snippet"in n.insertText){const h=n.insertText.snippet.length;if(s&&n.completeBracketPairs){n.insertText.snippet=wle(n.insertText.snippet,d.getStartPosition(),i,s);const f=n.insertText.snippet.length-h;f!==0&&(d=new D(d.startLineNumber,d.startColumn,d.endLineNumber,d.endColumn+f))}const u=new mw().parse(n.insertText.snippet);u.children.length===1&&u.children[0]instanceof gr?(l=u.children[0].value,c=void 0):(l=u.toString(),c={snippet:n.insertText.snippet,range:d})}else iD(n.insertText);return new Irt(d,l,c,He.revive(n.uri),n.hint,n.additionalTextEdits||nrt(),n,e,o,n.isInlineEdit??!1,r,a,n.correlationId)}class Irt{constructor(e,t,i,s,o,r,a,l,c,d,h,u,f){this.range=e,this.insertText=t,this.snippetInfo=i,this.uri=s,this.hint=o,this.additionalTextEdits=r,this.sourceInlineCompletion=a,this.source=l,this.context=c,this.isInlineEdit=d,this._requestInfo=h,this._providerRequestInfo=u,this._correlationId=f,this._didShow=!1,this._timeUntilShown=void 0,this._showStartTime=void 0,this._shownDuration=0,this._showUncollapsedStartTime=void 0,this._showUncollapsedDuration=0,this._notShownReason=void 0,this._didReportEndOfLife=!1,this._lastSetEndOfLifeReason=void 0,this._isPreceeded=!1,this._partiallyAcceptedCount=0,this._partiallyAcceptedSinceOriginal={characters:0,ratio:0,count:0},this._viewData={editorType:h.editorType}}get showInlineEditMenu(){return this.sourceInlineCompletion.showInlineEditMenu??!1}get partialAccepts(){return this._partiallyAcceptedSinceOriginal}async reportInlineEditShown(e,t,i,s){var r,a;if(this.updateShownDuration(i),this._didShow)return;this._didShow=!0,this._viewData.viewKind=i,this._viewData.renderData=s,this._timeUntilShown=Date.now()-this._requestInfo.startTime;const o=new VE(s.lineCountModified,s.lineCountOriginal,s.characterCountModified,s.characterCountOriginal);(a=(r=this.source.provider).handleItemDidShow)==null||a.call(r,this.source.inlineSuggestions,this.sourceInlineCompletion,t,o),this.sourceInlineCompletion.shownCommand&&await e.executeCommand(this.sourceInlineCompletion.shownCommand.id,...this.sourceInlineCompletion.shownCommand.arguments||[])}reportPartialAccept(e,t,i){var s,o;this._partiallyAcceptedCount++,this._partiallyAcceptedSinceOriginal.characters+=i.characters,this._partiallyAcceptedSinceOriginal.ratio=Math.min(this._partiallyAcceptedSinceOriginal.ratio+(1-this._partiallyAcceptedSinceOriginal.ratio)*i.ratio,1),this._partiallyAcceptedSinceOriginal.count+=i.count,(o=(s=this.source.provider).handlePartialAccept)==null||o.call(s,this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}reportEndOfLife(e){if(!this._didReportEndOfLife&&(this._didReportEndOfLife=!0,this.reportInlineEditHidden(),e||(e=this._lastSetEndOfLifeReason??{kind:Y1.Ignored,userTypingDisagreed:!1,supersededBy:void 0}),e.kind===Y1.Rejected&&this.source.provider.handleRejection&&this.source.provider.handleRejection(this.source.inlineSuggestions,this.sourceInlineCompletion),this.source.provider.handleEndOfLifetime)){const t={requestUuid:this.context.requestUuid,correlationId:this._correlationId,selectedSuggestionInfo:!!this.context.selectedSuggestionInfo,partiallyAccepted:this._partiallyAcceptedCount,partiallyAcceptedCountSinceOriginal:this._partiallyAcceptedSinceOriginal.count,partiallyAcceptedRatioSinceOriginal:this._partiallyAcceptedSinceOriginal.ratio,partiallyAcceptedCharactersSinceOriginal:this._partiallyAcceptedSinceOriginal.characters,shown:this._didShow,shownDuration:this._shownDuration,shownDurationUncollapsed:this._showUncollapsedDuration,preceeded:this._isPreceeded,timeUntilShown:this._timeUntilShown,timeUntilProviderRequest:this._providerRequestInfo.startTime-this._requestInfo.startTime,timeUntilProviderResponse:this._providerRequestInfo.endTime-this._requestInfo.startTime,editorType:this._viewData.editorType,languageId:this._requestInfo.languageId,requestReason:this._requestInfo.reason,viewKind:this._viewData.viewKind,notShownReason:this._notShownReason,typingInterval:this._requestInfo.typingInterval,typingIntervalCharacterCount:this._requestInfo.typingIntervalCharacterCount,availableProviders:this._requestInfo.availableProviders.map(i=>i.toString()).join(","),...this._viewData.renderData};this.source.provider.handleEndOfLifetime(this.source.inlineSuggestions,this.sourceInlineCompletion,e,t)}}setIsPreceeded(e){this._isPreceeded=!0,(this._partiallyAcceptedSinceOriginal.characters!==0||this._partiallyAcceptedSinceOriginal.ratio!==0||this._partiallyAcceptedSinceOriginal.count!==0)&&console.warn("Expected partiallyAcceptedCountSinceOriginal to be { characters: 0, rate: 0, partialAcceptances: 0 } before setIsPreceeded."),this._partiallyAcceptedSinceOriginal=e}setNotShownReason(e){this._notShownReason??(this._notShownReason=e)}setEndOfLifeReason(e){this.reportInlineEditHidden(),this._lastSetEndOfLifeReason=e}updateShownDuration(e){const t=Date.now();this._showStartTime||(this._showStartTime=t);const i=e===$t.Collapsed;!i&&this._showUncollapsedStartTime===void 0&&(this._showUncollapsedStartTime=t),i&&this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=t-this._showUncollapsedStartTime)}reportInlineEditHidden(){if(this._showStartTime===void 0)return;const e=Date.now();this._shownDuration+=e-this._showStartTime,this._showStartTime=void 0,this._showUncollapsedStartTime!==void 0&&(this._showUncollapsedDuration+=e-this._showUncollapsedStartTime,this._showUncollapsedStartTime=void 0)}}var Zk;(function(n){n.TextEditor="textEditor",n.DiffEditor="diffEditor",n.Notebook="notebook"})(Zk||(Zk={}));class Ert{constructor(e,t,i){this.inlineSuggestions=e,this.inlineSuggestionsData=t,this.provider=i,this.refCount=0}addRef(){this.refCount++}removeRef(e={kind:"other"}){if(this.refCount--,this.refCount===0){for(const t of this.inlineSuggestionsData)t.reportEndOfLife();this.provider.disposeInlineCompletions(this.inlineSuggestions,e)}}}function Nrt(n,e){const t=e.getWordAtPosition(n),i=e.getLineMaxColumn(n.lineNumber);return t?new D(n.lineNumber,t.startColumn,n.lineNumber,i):D.fromPositions(n,n.with(void 0,i))}function wle(n,e,t,i){const s=t.getLineContent(e.lineNumber),o=zs.replace(new Me(e.column-1,s.length),n),r=t.tokenization.tokenizeLinesAt(e.lineNumber,[o.replace(s)]),a=r==null?void 0:r[0].sliceZeroCopy(o.getRangeAfterReplace());return a?Srt(a,i):n}var Drt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},pL=function(n,e){return function(t,i){e(t,i,n)}},RU,_1;let MU=(_1=class extends G{constructor(e,t,i,s,o,r,a,l,c){var h;super(),this._textModel=e,this._versionId=t,this._debounceValue=i,this._cursorPosition=s,this._languageConfigurationService=o,this._logService=r,this._configurationService=a,this._instantiationService=l,this._contextKeyService=c,this._updateOperation=this._register(new Gt),this._state=grt(this,{initial:()=>({inlineCompletions:Mc.createEmpty(),suggestWidgetInlineCompletions:Mc.createEmpty()}),disposeFinal:u=>{u.inlineCompletions.dispose(),u.suggestWidgetInlineCompletions.dispose()},changeTracker:cVe(()=>({versionId:this._versionId})),update:(u,f,g)=>{const p=Dg.compose(g.changes.map(m=>m.change?brt(m.change.changes):Dg.empty).filter(Ts));if(p.isEmpty())return f;try{return{inlineCompletions:f.inlineCompletions.createStateWithAppliedEdit(p,this._textModel),suggestWidgetInlineCompletions:f.suggestWidgetInlineCompletions.createStateWithAppliedEdit(p,this._textModel)}}finally{f.inlineCompletions.dispose(),f.suggestWidgetInlineCompletions.dispose()}}}),this.inlineCompletions=this._state.map(this,u=>u.inlineCompletions),this.suggestWidgetInlineCompletions=this._state.map(this,u=>u.suggestWidgetInlineCompletions),this._completionsEnabled=void 0,this.clearOperationOnTextModelChange=oe(this,u=>{this._versionId.read(u),this._updateOperation.clear()}),this._loadingCount=Ze(this,0),this._loggingEnabled=kre("editor.inlineSuggest.logFetch",!1,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._sendRequestData=kre("editor.inlineSuggest.emptyResponseInformation",!0,this._configurationService).recomputeInitiallyAndOnChange(this._store),this._structuredFetchLogger=this._register(this._instantiationService.createInstance(TO.cast(),"editor.inlineSuggest.logFetch.commandId")),this.clearOperationOnTextModelChange.recomputeInitiallyAndOnChange(this._store);const d=((h=NR.defaultChatAgent)==null?void 0:h.completionsEnablementSetting)??void 0;d&&(this._updateCompletionsEnablement(d),this._register(this._configurationService.onDidChangeConfiguration(u=>{u.affectsConfiguration(d)&&this._updateCompletionsEnablement(d)}))),this._state.recomputeInitiallyAndOnChange(this._store)}_updateCompletionsEnablement(e){const t=this._configurationService.getValue(e);os(t)?this._completionsEnabled=t:this._completionsEnabled=void 0}_log(e){this._loggingEnabled.get()&&this._logService.info(Kot(e)),this._structuredFetchLogger.log(e)}fetch(e,t,i,s,o,r,a){var p,m;const l=this._cursorPosition.get(),c=new Trt(l,i,this._textModel.getVersionId(),new Set(e)),d=i.selectedSuggestionInfo?this.suggestWidgetInlineCompletions.get():this.inlineCompletions.get();if((p=this._updateOperation.value)!=null&&p.request.satisfies(c))return this._updateOperation.value.promise;if((m=d==null?void 0:d.request)!=null&&m.satisfies(c))return Promise.resolve(!0);const h=!!this._updateOperation.value;this._updateOperation.clear();const u=new Bi,f=(async()=>{const b=new ne;this._loadingCount.set(this._loadingCount.get()+1,void 0);let v=!1;const w=()=>{v||(v=!0,this._loadingCount.set(this._loadingCount.get()-1,void 0))};b.add(new ai(()=>w(),10*1e3)).schedule();const S=e.filter(x=>x.providerId),L=new Rrt(i,a,S);try{const x=this._debounceValue.get(this._textModel),I=Bpe(e.map(j=>j.debounceDelayMs),kMe(ma))??x;if((h||o&&i.triggerKind===Pr.Automatic)&&await fle(I,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)return L.setNoSuggestionReasonIfNotSet("canceled:beforeFetch"),!1;const R=RU._requestId++;(this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get())&&this._log({sourceId:"InlineCompletions.fetch",kind:"start",requestId:R,modelUri:this._textModel.uri,modelVersion:this._textModel.getVersionId(),context:{triggerKind:i.triggerKind,suggestInfo:i.selectedSuggestionInfo?!0:void 0},time:Date.now(),provider:t});const M=new Date,A=Lrt(e,this._cursorPosition.get(),this._textModel,i,a,this._languageConfigurationService);kCe(u.token,()=>A.cancelAndDispose({kind:"tokenCancellation"}));let W=!1,P=!1;const B=[];for await(const j of A.lists)if(j){j.addRef(),b.add(Re(()=>j.removeRef(j.inlineSuggestionsData.length===0?{kind:"empty"}:{kind:"notTaken"})));for(const X of j.inlineSuggestionsData){if(P=!0,!i.includeInlineEdits&&(X.isInlineEdit||X.showInlineEditMenu)){X.setNotShownReason("notInlineEditRequested");continue}if(!i.includeInlineCompletions&&!(X.isInlineEdit||X.showInlineEditMenu)){X.setNotShownReason("notInlineCompletionRequested");continue}const Y=TU.create(X,this._textModel);B.push(Y),!Y.isInlineEdit&&!Y.showInlineEditMenu&&i.triggerKind===Pr.Automatic&&Y.isVisible(this._textModel,this._cursorPosition.get())&&(W=!0)}if(W)break}if(A.cancelAndDispose({kind:"lostRace"}),this._loggingEnabled.get()||this._structuredFetchLogger.isEnabled.get()){const j=A.didAllProvidersReturn;let X;(u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId)&&(X="canceled");const Y=B.map(te=>{var ce;return{range:te.editRange.toString(),text:te.insertText,hint:te.hint,isInlineEdit:te.isInlineEdit,showInlineEditMenu:te.showInlineEditMenu,providerId:(ce=te.source.provider.providerId)==null?void 0:ce.toString()}});this._log({sourceId:"InlineCompletions.fetch",kind:"end",requestId:R,durationMs:Date.now()-M.getTime(),error:X,result:Y,time:Date.now(),didAllProvidersReturn:j})}if(L.setRequestUuid(A.contextWithUuid.requestUuid),P)L.setHasProducedSuggestion(),B.length>0&&u.token.isCancellationRequested&&B.forEach(j=>j.setNotShownReasonIfNotSet("canceled:whileAwaitingOtherProviders"));else if(u.token.isCancellationRequested)L.setNoSuggestionReasonIfNotSet("canceled:whileFetching");else{const j=this._contextKeyService.getContextKeyValue("completionsQuotaExceeded");L.setNoSuggestionReasonIfNotSet(j?"completionsQuotaExceeded":"noSuggestion")}const V=i.earliestShownDateTime-Date.now();if(V>0&&await fle(V,u.token),u.token.isCancellationRequested||this._store.isDisposed||this._textModel.getVersionId()!==c.versionId||r.get()){const j=u.token.isCancellationRequested?"canceled:afterMinShowDelay":this._store.isDisposed?"canceled:disposed":this._textModel.getVersionId()!==c.versionId?"canceled:documentChanged":r.get()?"canceled:userJumped":"unknown";return B.forEach(X=>X.setNotShownReasonIfNotSet(j)),!1}const K=new Date;this._debounceValue.update(this._textModel,K.getTime()-M.getTime());const z=this._cursorPosition.get();this._updateOperation.clear(),vi(j=>{const X=this._state.get();i.selectedSuggestionInfo?this._state.set({inlineCompletions:Mc.createEmpty(),suggestWidgetInlineCompletions:X.suggestWidgetInlineCompletions.createStateWithAppliedResults(B,c,this._textModel,z,s)},j):this._state.set({inlineCompletions:X.inlineCompletions.createStateWithAppliedResults(B,c,this._textModel,z,s),suggestWidgetInlineCompletions:Mc.createEmpty()},j),X.inlineCompletions.dispose(),X.suggestWidgetInlineCompletions.dispose()})}finally{b.dispose(),w(),this.sendInlineCompletionsRequestTelemetry(L)}return!0})(),g=new Prt(c,u,f);return this._updateOperation.value=g,f}clear(e){this._updateOperation.clear();const t=this._state.get();this._state.set({inlineCompletions:Mc.createEmpty(),suggestWidgetInlineCompletions:Mc.createEmpty()},e),t.inlineCompletions.dispose(),t.suggestWidgetInlineCompletions.dispose()}seedInlineCompletionsWithSuggestWidget(){const e=this.inlineCompletions.get(),t=this.suggestWidgetInlineCompletions.get();t&&vi(i=>{var s,o;if(!e||(((s=t.request)==null?void 0:s.versionId)??-1)>(((o=e.request)==null?void 0:o.versionId)??-1)){e==null||e.dispose();const r=this._state.get();this._state.set({inlineCompletions:t.clone(),suggestWidgetInlineCompletions:Mc.createEmpty()},i),r.inlineCompletions.dispose(),r.suggestWidgetInlineCompletions.dispose()}this.clearSuggestWidgetInlineCompletions(i)})}sendInlineCompletionsRequestTelemetry(e){if(!this._sendRequestData.get()&&!this._contextKeyService.getContextKeyValue("isRunningUnificationExperiment")||e.requestUuid===void 0||e.hasProducedSuggestion||!Art(this._completionsEnabled,this._textModel.getLanguageId())||!e.providers.some(s=>{var o;return vle((o=s.providerId)==null?void 0:o.extensionId)}))return;const t={opportunityId:e.requestUuid,noSuggestionReason:e.noSuggestionReason??"unknown",extensionId:"vscode-core",extensionVersion:"0.0.0",groupId:"empty",shown:!1,editorType:e.requestInfo.editorType,requestReason:e.requestInfo.reason,typingInterval:e.requestInfo.typingInterval,typingIntervalCharacterCount:e.requestInfo.typingIntervalCharacterCount,languageId:e.requestInfo.languageId,selectedSuggestionInfo:!!e.context.selectedSuggestionInfo,availableProviders:e.providers.map(s=>{var o;return(o=s.providerId)==null?void 0:o.toString()}).filter(Ts).join(","),..._rt(e.providers.some(s=>{var o;return vle((o=s.providerId)==null?void 0:o.extensionId)})),timeUntilProviderRequest:void 0,timeUntilProviderResponse:void 0,viewKind:void 0,preceeded:void 0,superseded:void 0,reason:void 0,correlationId:void 0,shownDuration:void 0,shownDurationUncollapsed:void 0,timeUntilShown:void 0,partiallyAccepted:void 0,partiallyAcceptedCountSinceOriginal:void 0,partiallyAcceptedRatioSinceOriginal:void 0,partiallyAcceptedCharactersSinceOriginal:void 0,cursorColumnDistance:void 0,cursorLineDistance:void 0,lineCountOriginal:void 0,lineCountModified:void 0,characterCountOriginal:void 0,characterCountModified:void 0,disjointReplacements:void 0,sameShapeReplacements:void 0,notShownReason:void 0},i=this._instantiationService.createInstance(NU);vrt(i,t)}clearSuggestWidgetInlineCompletions(e){var t;(t=this._updateOperation.value)!=null&&t.request.context.selectedSuggestionInfo&&this._updateOperation.clear()}cancelUpdate(){this._updateOperation.clear()}},RU=_1,_1._requestId=0,_1);MU=RU=Drt([pL(4,qi),pL(5,Li),pL(6,lt),pL(7,Ae),pL(8,Xe)],MU);class Trt{constructor(e,t,i,s){this.position=e,this.context=t,this.versionId=i,this.providers=s}satisfies(e){return this.position.equals(e.position)&&nv(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,qG())&&(e.context.triggerKind===Pr.Automatic||this.context.triggerKind===Pr.Explicit)&&this.versionId===e.versionId&&Mrt(e.providers,this.providers)}}class Rrt{constructor(e,t,i){this.context=e,this.requestInfo=t,this.providers=i,this.hasProducedSuggestion=!1}setRequestUuid(e){this.requestUuid=e}setNoSuggestionReasonIfNotSet(e){this.noSuggestionReason??(this.noSuggestionReason=e)}setHasProducedSuggestion(){this.hasProducedSuggestion=!0}}function Mrt(n,e){return[...n].every(t=>e.has(t))}function Art(n,e="*"){return n===void 0?!1:typeof n[e]<"u"?!!n[e]:!!n["*"]}class Prt{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class Mc extends G{static createEmpty(){return new Mc([],void 0)}constructor(e,t){for(const i of e)i.addRef();super(),this.inlineCompletions=e,this.request=t,this._register({dispose:()=>{for(const i of this.inlineCompletions)i.removeRef()}})}_findById(e){return this.inlineCompletions.find(t=>t.identity===e)}_findByHash(e){return this.inlineCompletions.find(t=>t.hash===e)}createStateWithAppliedEdit(e,t){const i=this.inlineCompletions.map(s=>s.withEdit(e,t)).filter(Ts);return new Mc(i,this.request)}createStateWithAppliedResults(e,t,i,s,o){let r;if(o){const c=this._findById(o);if(c&&c.canBeReused(i,t.position)){r=c;const d=e.find(h=>h.hash===c.hash);d?e=Frt(d,e):e=[c,...e]}}const a=r?!r.isInlineEdit:e.some(c=>!c.isInlineEdit&&c.isVisible(i,s));let l=[];for(const c of e){const d=this._findByHash(c.hash);let h;d&&d!==c?(h=c.withIdentity(d.identity),c.setIsPreceeded(d),d.setEndOfLifeReason({kind:Y1.Ignored,userTypingDisagreed:!1,supersededBy:c.getSourceCompletion()})):h=c,a!==h.isInlineEdit&&l.push(h)}return l.sort(co(c=>c.showInlineEditMenu,Xfe)),l=Ort(l,c=>c.semanticId),new Mc(l,t)}clone(){return new Mc(this.inlineCompletions,this.request)}}function Ort(n,e){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function Frt(n,e){const t=e.indexOf(n);return t>-1?[n,...e.slice(0,t),...e.slice(t+1)]:e}class Brt{constructor(e,t,i){this.edit=e,this.commands=t,this.inlineCompletion=i}equals(e){return this.edit.equals(e.edit)&&this.inlineCompletion===e.inlineCompletion}}const xl=class xl extends G{getTypingInterval(){return(this._cacheInvalidated||this._cachedTypingIntervalResult===null)&&(this._cachedTypingIntervalResult=this._calculateTypingInterval(),this._cacheInvalidated=!1),this._cachedTypingIntervalResult}constructor(e){super(),this._textModel=e,this._typingSessions=[],this._currentSession=null,this._lastChangeTime=0,this._cachedTypingIntervalResult=null,this._cacheInvalidated=!0,this._register(this._textModel.onDidChangeContent(t=>this._updateTypingSpeed(t)))}_updateTypingSpeed(e){const t=Date.now();if(!this._isUserTyping(e)){this._finalizeCurrentSession();return}this._currentSession&&t-this._lastChangeTime>xl.MAX_SESSION_GAP_MS&&this._finalizeCurrentSession(),this._currentSession||(this._currentSession={startTime:t,endTime:t,characterCount:0}),this._currentSession.endTime=t,this._currentSession.characterCount+=this._getActualCharacterCount(e),this._lastChangeTime=t,this._cacheInvalidated=!0}_getActualCharacterCount(e){let t=0;for(const i of e.changes)t+=Math.max(i.text.length,i.rangeLength);return t}_isUserTyping(e){if(!e.detailedReasons||e.detailedReasons.length===0)return!1;for(const t of e.detailedReasons)if(this._isUserTypingReason(t))return!0;return!1}_isUserTypingReason(e){if(e.metadata.isUndoing||e.metadata.isRedoing)return!1;switch(e.metadata.source){case"cursor":{const t=e.metadata.kind;return t==="type"||t==="compositionType"||t==="compositionEnd"}default:return!1}}_finalizeCurrentSession(){if(!this._currentSession)return;this._currentSession.endTime-this._currentSession.startTime>=xl.MIN_SESSION_DURATION_MS&&this._currentSession.characterCount>0&&(this._typingSessions.push(this._currentSession),this._typingSessions.length>xl.SESSION_HISTORY_LIMIT&&this._typingSessions.shift()),this._currentSession=null}_calculateTypingInterval(){if(this._currentSession){const e={...this._currentSession};if(e.endTime-e.startTime>=xl.MIN_SESSION_DURATION_MS&&e.characterCount>0){const i=[...this._typingSessions,e];return this._calculateSpeedFromSessions(i)}}return this._calculateSpeedFromSessions(this._typingSessions)}_calculateSpeedFromSessions(e){if(e.length===0)return{averageInterval:0,characterCount:0};const t=[...e].sort((d,h)=>h.endTime-d.endTime),i=Date.now()-xl.TYPING_SPEED_WINDOW_MS,s=t.filter(d=>d.endTime>i),o=t.splice(s.length);let r=ZM(s.map(d=>d.characterCount));for(let d=0;dd.endTime-d.startTime));if(a===0||r<=1)return{averageInterval:0,characterCount:r};const l=Math.max(1,r-1),c=a/l;return{averageInterval:Math.round(c),characterCount:r}}dispose(){this._finalizeCurrentSession(),super.dispose()}};xl.MAX_SESSION_GAP_MS=3e3,xl.MIN_SESSION_DURATION_MS=1e3,xl.SESSION_HISTORY_LIMIT=50,xl.TYPING_SPEED_WINDOW_MS=3e5,xl.MIN_CHARS_FOR_RELIABLE_SPEED=20;let AU=xl;var Wrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},J_=function(n,e){return function(t,i){e(t,i,n)}};let PU=class extends G{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,s,o,r,a,l,c,d,h,u,f,g){super(),this.textModel=e,this._selectedSuggestItem=t,this._textModelVersionId=i,this._positions=s,this._debounceValue=o,this._enabled=r,this._editor=a,this._instantiationService=l,this._commandService=c,this._languageConfigurationService=d,this._accessibilityService=h,this._languageFeaturesService=u,this._codeEditorService=f,this._inlineCompletionsService=g,this._isActive=Ze(this,!1),this._onlyRequestInlineEditsSignal=Vl(this),this._forceUpdateExplicitlySignal=Vl(this),this._noDelaySignal=Vl(this),this._fetchSpecificProviderSignal=Vl(this),this._selectedInlineCompletionId=Ze(this,void 0),this.primaryPosition=oe(this,C=>this._positions.read(C)[0]??new U(1,1)),this.allPositions=oe(this,C=>this._positions.read(C)),this._isAcceptingPartially=!1,this._appearedInsideViewport=oe(this,C=>{const S=this.state.read(C);return!S||!S.inlineCompletion?!1:Vrt(this._editor,S.inlineCompletion)}),this._onDidAccept=new q,this.onDidAccept=this._onDidAccept.event,this._lastShownInlineCompletionInfo=void 0,this._lastAcceptedInlineCompletionInfo=void 0,this._didUndoInlineEdits=nie({owner:this,changeTracker:{createChangeSummary:()=>({didUndo:!1}),handleChange:(C,S)=>{var L;return S.didUndo=C.didChange(this._textModelVersionId)&&!!((L=C.change)!=null&&L.isUndoing),!0}}},(C,S)=>{const L=this._textModelVersionId.read(C);return L!==null&&this._lastAcceptedInlineCompletionInfo&&this._lastAcceptedInlineCompletionInfo.textModelVersionIdAfter===L-1&&this._lastAcceptedInlineCompletionInfo.inlineCompletion.isInlineEdit&&S.didUndo?(this._lastAcceptedInlineCompletionInfo=void 0,!0):!1}),this._preserveCurrentCompletionReasons=new Set([_f.Redo,_f.Undo,_f.AcceptWord]),this.dontRefetchSignal=Vl(this),this._fetchInlineCompletionsPromise=nie({owner:this,changeTracker:{createChangeSummary:()=>({dontRefetch:!1,preserveCurrentCompletion:!1,inlineCompletionTriggerKind:Pr.Automatic,onlyRequestInlineEdits:!1,shouldDebounce:!0,provider:void 0,textChange:!1,changeReason:""}),handleChange:(C,S)=>{var L;if(C.didChange(this._textModelVersionId)){this._preserveCurrentCompletionReasons.has(this._getReason(C.change))&&(S.preserveCurrentCompletion=!0);const x=((L=C.change)==null?void 0:L.detailedReasons)??[];S.changeReason=x.length>0?x[0].getType():"",S.textChange=!0}else C.didChange(this._forceUpdateExplicitlySignal)?(S.preserveCurrentCompletion=!0,S.inlineCompletionTriggerKind=Pr.Explicit):C.didChange(this.dontRefetchSignal)?S.dontRefetch=!0:C.didChange(this._onlyRequestInlineEditsSignal)?S.onlyRequestInlineEdits=!0:C.didChange(this._fetchSpecificProviderSignal)&&(S.provider=C.change);return!0}}},(C,S)=>{var z,j,X;if(this._source.clearOperationOnTextModelChange.read(C),this._noDelaySignal.read(C),this.dontRefetchSignal.read(C),this._onlyRequestInlineEditsSignal.read(C),this._forceUpdateExplicitlySignal.read(C),this._fetchSpecificProviderSignal.read(C),!((this._enabled.read(C)&&this._selectedSuggestItem.read(C)||this._isActive.read(C))&&(!this._inlineCompletionsService.isSnoozing()||S.inlineCompletionTriggerKind===Pr.Explicit))){this._source.cancelUpdate();return}this._textModelVersionId.read(C);const x=this._source.suggestWidgetInlineCompletions.read(void 0);let I=this._selectedSuggestItem.read(C);if(this._shouldShowOnSuggestConflict.read(void 0)&&(I=void 0),x&&!I&&this._source.seedInlineCompletionsWithSuggestWidget(),S.dontRefetch)return Promise.resolve(!0);if(this._didUndoInlineEdits.read(C)&&S.inlineCompletionTriggerKind!==Pr.Explicit){vi(Y=>{this._source.clear(Y)});return}let E="";S.provider?E+="providerOnDidChange":S.inlineCompletionTriggerKind===Pr.Explicit&&(E+="explicit"),S.changeReason&&(E+=E.length>0?`:${S.changeReason}`:S.changeReason);const R=this._typing.getTypingInterval(),M={editorType:this.editorType,startTime:Date.now(),languageId:this.textModel.getLanguageId(),reason:E,typingInterval:R.averageInterval,typingIntervalCharacterCount:R.characterCount,availableProviders:[]};let A={triggerKind:S.inlineCompletionTriggerKind,selectedSuggestionInfo:I==null?void 0:I.toSelectedSuggestionInfo(),includeInlineCompletions:!S.onlyRequestInlineEdits,includeInlineEdits:this._inlineEditsEnabled.read(C),requestIssuedDateTime:M.startTime,earliestShownDateTime:M.startTime+(S.inlineCompletionTriggerKind===Pr.Explicit||this.inAcceptFlow.read(void 0)?0:this._minShowDelay.read(void 0))};A.triggerKind===Pr.Automatic&&S.textChange&&this.textModel.getAlternativeVersionId()===((z=this._lastShownInlineCompletionInfo)==null?void 0:z.alternateTextModelVersionId)&&(A={...A,includeInlineCompletions:!this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit,includeInlineEdits:this._lastShownInlineCompletionInfo.inlineCompletion.isInlineEdit});const W=this.selectedInlineCompletion.read(void 0)??((j=this._inlineCompletionItems.read(void 0))==null?void 0:j.inlineEdit),P=S.preserveCurrentCompletion||W!=null&&W.forwardStable?W:void 0,B=this._jumpedToId.map(Y=>{var te,ce;return!!Y&&Y===((ce=(te=this._inlineCompletionItems.read(void 0))==null?void 0:te.inlineEdit)==null?void 0:ce.semanticId)}),V=S.provider?{providers:[S.provider],label:"single:"+((X=S.provider.providerId)==null?void 0:X.toString())}:{providers:this._languageFeaturesService.inlineCompletionsProvider.all(this.textModel),label:void 0},K=this.getAvailableProviders(V.providers);return M.availableProviders=K.map(Y=>Y.providerId).filter(Ts),this._source.fetch(K,V.label,A,P==null?void 0:P.identity,S.shouldDebounce,B,M)}),this._inlineCompletionItems=so({owner:this},C=>{const S=this._source.inlineCompletions.read(C);if(!S)return;const L=this.primaryPosition.read(C);let x;const I=[];for(const E of S.inlineCompletions)E.isInlineEdit?x=E:E.isVisible(this.textModel,L)&&I.push(E);return I.length!==0&&(x=void 0),{inlineCompletions:I,inlineEdit:x}}),this._filteredInlineCompletionItems=so({owner:this,equalsFn:lE()},C=>{const S=this._inlineCompletionItems.read(C);return(S==null?void 0:S.inlineCompletions)??[]}),this.selectedInlineCompletionIndex=oe(this,C=>{const S=this._selectedInlineCompletionId.read(C),L=this._filteredInlineCompletionItems.read(C),x=this._selectedInlineCompletionId===void 0?-1:L.findIndex(I=>I.semanticId===S);return x===-1?(this._selectedInlineCompletionId.set(void 0,void 0),0):x}),this.selectedInlineCompletion=oe(this,C=>{const S=this._filteredInlineCompletionItems.read(C),L=this.selectedInlineCompletionIndex.read(C);return S[L]}),this.activeCommands=so({owner:this,equalsFn:lE()},C=>{var S;return((S=this.selectedInlineCompletion.read(C))==null?void 0:S.source.inlineSuggestions.commands)??[]}),this.inlineCompletionsCount=oe(this,C=>{if(this.lastTriggerKind.read(C)===Pr.Explicit)return this._filteredInlineCompletionItems.read(C).length}),this._hasVisiblePeekWidgets=oe(this,C=>this._editorObs.openedPeekWidgets.read(C)>0),this._shouldShowOnSuggestConflict=oe(this,C=>{const S=this._showOnSuggestConflict.read(C);if(S!=="never"&&!!this.selectedInlineCompletion.read(C)){const x=this._selectedSuggestItem.read(C);return x?S==="whenSuggestListIsIncomplete"?x.listIncomplete:!0:!1}return!1}),this.state=so({owner:this,equalsFn:(C,S)=>!C||!S?C===S:C.kind==="ghostText"&&S.kind==="ghostText"?gle(C.ghostTexts,S.ghostTexts)&&C.inlineCompletion===S.inlineCompletion&&C.suggestItem===S.suggestItem:C.kind==="inlineEdit"&&S.kind==="inlineEdit"?C.inlineEdit.equals(S.inlineEdit):!1},C=>{var E,R,M,A,W,P,B;const S=this.textModel;if(this._suppressInSnippetMode.read(C)&&this._isInSnippetMode.read(C))return;const L=this._inlineCompletionItems.read(C),x=L==null?void 0:L.inlineEdit;if(x){if(this._hasVisiblePeekWidgets.read(C))return;let V=x.getSingleTextEdit();V=Gf(V,S);const K=this.primaryPosition.map(ce=>Ye.fromRangeInclusive(x.targetRange).addMargin(1,1).contains(ce.lineNumber)),z=x.source.inlineSuggestions.commands,j=new Brt(V,z??[],x),X=x.updatedEdit,Y=X?ga.fromStringEdit(X,new fw(this.textModel)).replacements:[V],te=(((R=(E=L.inlineEdit)==null?void 0:E.command)==null?void 0:R.id)==="vscode.open"||((A=(M=L.inlineEdit)==null?void 0:M.command)==null?void 0:A.id)==="_workbench.open")&&((P=(W=L.inlineEdit)==null?void 0:W.command.arguments)!=null&&P.length)?He.from((B=L.inlineEdit)==null?void 0:B.command.arguments[0]):void 0;return{kind:"inlineEdit",inlineEdit:j,inlineCompletion:x,edits:Y,cursorAtInlineEdit:K,nextEditUri:te}}const I=this._selectedSuggestItem.read(C);if(!this._shouldShowOnSuggestConflict.read(C)&&I){const V=Gf(I.getSingleTextEdit(),S),K=this._computeAugmentation(V,C);if(!this._suggestPreviewEnabled.read(C)&&!K)return;const j=(K==null?void 0:K.edit)??V,X=K?K.edit.text.length-V.text.length:0,Y=this._suggestPreviewMode.read(C),te=this._positions.read(C),Ce=[j,...c6(this.textModel,te,j)].map((Le,ze)=>({edit:Le,ghostText:Le?ple(Le,S,Y,te[ze],X):void 0})).filter(({edit:Le,ghostText:ze})=>Le!==void 0&&ze!==void 0),xe=Ce.map(({edit:Le})=>Le),Be=Ce.map(({ghostText:Le})=>Le),Ee=Be[0]??new IN(j.range.endLineNumber,[]);return{kind:"ghostText",edits:xe,primaryGhostText:Ee,ghostTexts:Be,inlineCompletion:K==null?void 0:K.completion,suggestItem:I}}else{if(!this._isActive.read(C))return;const V=this.selectedInlineCompletion.read(C);if(!V)return;const K=V.getSingleTextEdit(),z=this._inlineSuggestMode.read(C),j=this._positions.read(C),Y=[K,...c6(this.textModel,j,K)].map((Ce,xe)=>({edit:Ce,ghostText:Ce?ple(Ce,S,z,j[xe],0):void 0})).filter(({edit:Ce,ghostText:xe})=>Ce!==void 0&&xe!==void 0),te=Y.map(({edit:Ce})=>Ce),ce=Y.map(({ghostText:Ce})=>Ce);return ce[0]?{kind:"ghostText",edits:te,primaryGhostText:ce[0],ghostTexts:ce,inlineCompletion:V,suggestItem:void 0}:void 0}}),this.inlineCompletionState=oe(this,C=>{const S=this.state.read(C);if(!(!S||S.kind!=="ghostText")&&!this._editorObs.inComposition.read(C))return S}),this.inlineEditState=oe(this,C=>{const S=this.state.read(C);if(!(!S||S.kind!=="inlineEdit"))return S}),this.inlineEditAvailable=oe(this,C=>!!this.inlineEditState.read(C)),this.warning=oe(this,C=>{var S,L;return(L=(S=this.inlineCompletionState.read(C))==null?void 0:S.inlineCompletion)==null?void 0:L.warning}),this.ghostTexts=so({owner:this,equalsFn:gle},C=>{const S=this.inlineCompletionState.read(C);if(S)return S.ghostTexts}),this.primaryGhostText=so({owner:this,equalsFn:CCe},C=>{const S=this.inlineCompletionState.read(C);if(S)return S==null?void 0:S.primaryGhostText}),this.showCollapsed=oe(this,C=>{const S=this.state.read(C);if(!S||S.kind!=="inlineEdit"||S.inlineCompletion.hint)return!1;const L=S.inlineCompletion.updatedEditModelVersion===this._textModelVersionId.read(C);return(this._inlineEditsShowCollapsedEnabled.read(C)||!L)&&this._jumpedToId.read(C)!==S.inlineCompletion.semanticId&&!this._inAcceptFlow.read(C)}),this._tabShouldIndent=oe(this,C=>{if(this._inAcceptFlow.read(C))return!1;function S(I){return I.startLineNumber!==I.endLineNumber}function L(I,E){const R=I.getLineIndentColumn(E),M=I.getLineLastNonWhitespaceColumn(E),A=Math.max(M,R);return new D(E,R,E,A)}const x=this._editorObs.selections.read(C);return x==null?void 0:x.some(I=>I.isEmpty()?this.textModel.getLineLength(I.startLineNumber)===0:S(I)||I.containsRange(L(this.textModel,I.startLineNumber)))}),this.tabShouldJumpToInlineEdit=oe(this,C=>{var L;if(this._tabShouldIndent.read(C))return!1;const S=this.inlineEditState.read(C);return S?this.showCollapsed.read(C)?!0:this._inAcceptFlow.read(C)&&this._appearedInsideViewport.read(C)&&!((L=S.inlineCompletion.hint)!=null&&L.jumpToEdit)?!1:!S.cursorAtInlineEdit.read(C):!1}),this.tabShouldAcceptInlineEdit=oe(this,C=>{var L;const S=this.inlineEditState.read(C);return!S||this.showCollapsed.read(C)||this._tabShouldIndent.read(C)?!1:this._inAcceptFlow.read(C)&&this._appearedInsideViewport.read(C)&&!((L=S.inlineCompletion.hint)!=null&&L.jumpToEdit)||S.inlineCompletion.targetRange.startLineNumber===this._editorObs.cursorLineNumber.read(C)||this._jumpedToId.read(C)===S.inlineCompletion.semanticId?!0:S.cursorAtInlineEdit.read(C)}),this._jumpedToId=Ze(this,void 0),this._inAcceptFlow=Ze(this,!1),this.inAcceptFlow=this._inAcceptFlow,this._source=this._register(this._instantiationService.createInstance(MU,this.textModel,this._textModelVersionId,this._debounceValue,this.primaryPosition)),this.lastTriggerKind=this._source.inlineCompletions.map(this,C=>{var S;return(S=C==null?void 0:C.request)==null?void 0:S.context.triggerKind}),this._editorObs=$i(this._editor);const p=this._editorObs.getOption(134);this._suggestPreviewEnabled=p.map(C=>C.preview),this._suggestPreviewMode=p.map(C=>C.previewMode);const m=this._editorObs.getOption(71);this._inlineSuggestMode=m.map(C=>C.mode),this._suppressedInlineCompletionGroupIds=m.map(C=>new Set(C.experimental.suppressInlineSuggestions.split(","))),this._inlineEditsEnabled=m.map(C=>!!C.edits.enabled),this._inlineEditsShowCollapsedEnabled=m.map(C=>C.edits.showCollapsed),this._triggerCommandOnProviderChange=m.map(C=>C.triggerCommandOnProviderChange),this._minShowDelay=m.map(C=>C.minShowDelay),this._showOnSuggestConflict=m.map(C=>C.experimental.showOnSuggestConflict),this._suppressInSnippetMode=m.map(C=>C.suppressInSnippetMode);const b=Xo.get(this._editor);this._isInSnippetMode=(b==null?void 0:b.isInSnippetObservable)??wi(!1),this._typing=this._register(new AU(this.textModel)),this._register(this._inlineCompletionsService.onDidChangeIsSnoozing(C=>{C&&this.stop()}));{const C=this.textModel.uri.scheme==="vscode-notebook-cell",[S]=this._codeEditorService.listDiffEditors().filter(L=>L.getOriginalEditor().getId()===this._editor.getId()||L.getModifiedEditor().getId()===this._editor.getId());this.isInDiffEditor=!!S,this.editorType=C?Zk.Notebook:this.isInDiffEditor?Zk.DiffEditor:Zk.TextEditor}this._register(lS(this.state,C=>{C&&C.inlineCompletion&&this._inlineCompletionsService.reportNewCompletion(C.inlineCompletion.requestUuid)})),this._register(lS(this._fetchInlineCompletionsPromise)),this._register(qe(C=>{this._editorObs.versionId.read(C),this._inAcceptFlow.set(!1,void 0)})),this._register(qe(C=>{this.state.map((L,x)=>!L||L.kind==="inlineEdit"&&!L.cursorAtInlineEdit.read(x)).read(C)&&this._jumpedToId.set(void 0,void 0)}));const v=this.inlineEditState.map(C=>C==null?void 0:C.inlineCompletion.semanticId);this._register(qe(C=>{v.read(C)&&(this._editor.pushUndoStop(),this._lastShownInlineCompletionInfo={alternateTextModelVersionId:this.textModel.getAlternativeVersionId(),inlineCompletion:this.state.get().inlineCompletion})}));const w=qt(this._languageFeaturesService.inlineCompletionsProvider.onDidChange,()=>this._languageFeaturesService.inlineCompletionsProvider.all(e));YG(this,w,(C,S)=>{C.onDidChangeInlineCompletions&&S.add(C.onDidChangeInlineCompletions(()=>{var I;if(!this._enabled.get()||(this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor())!==this._editor)return;if(this._triggerCommandOnProviderChange.get()){this.trigger(void 0,{onlyFetchInlineEdits:!0});return}const x=this.state.get();x&&(x.inlineCompletion||x.edits)&&((I=x.inlineCompletion)==null?void 0:I.source.provider)!==C||vi(E=>{this._fetchSpecificProviderSignal.trigger(E,C),this.trigger(E)})}))}).recomputeInitiallyAndOnChange(this._store),this._didUndoInlineEdits.recomputeInitiallyAndOnChange(this._store)}getIndentationInfo(e){let t=!1,i=!0;const s=this==null?void 0:this.primaryGhostText.read(e);if(this!=null&&this._selectedSuggestItem&&s&&s.parts.length>0){const{column:o,lines:r}=s.parts[0],a=r[0].line,l=this.textModel.getLineIndentColumn(s.lineNumber);if(o<=l){let d=Zo(a);d===-1&&(d=a.length-1),t=d>0;const h=this.textModel.getOptions().tabSize;i=Zi.visibleColumnFromColumn(a,d+1,h)!(a.groupId&&t.has(a.groupId))),s=new Set;for(const a of i)(r=a.excludesGroupIds)==null||r.forEach(l=>s.add(l));const o=[];for(const a of i)a.groupId&&s.has(a.groupId)||o.push(a);return o}async trigger(e,t={}){aS(e,i=>{t.onlyFetchInlineEdits&&this._onlyRequestInlineEditsSignal.trigger(i),t.noDelay&&this._noDelaySignal.trigger(i),this._isActive.set(!0,i),t.explicit&&(this._inAcceptFlow.set(!0,i),this._forceUpdateExplicitlySignal.trigger(i)),t.provider&&this._fetchSpecificProviderSignal.trigger(i,t.provider)}),await this._fetchInlineCompletionsPromise.get()}async triggerExplicitly(e,t=!1){return this.trigger(e,{onlyFetchInlineEdits:t,explicit:!0})}stop(e="automatic",t){aS(t,i=>{var s;if(e==="explicitCancel"){const o=(s=this.state.get())==null?void 0:s.inlineCompletion;o&&o.reportEndOfLife({kind:Y1.Rejected})}this._isActive.set(!1,i),this._source.clear(i)})}_computeAugmentation(e,t){const i=this.textModel,s=this._source.suggestWidgetInlineCompletions.read(t),o=s?s.inlineCompletions.filter(a=>!a.isInlineEdit):[this.selectedInlineCompletion.read(t)].filter(Ts);return p5e(o,a=>{let l=a.getSingleTextEdit();return l=Gf(l,i,D.fromPositions(l.range.getStartPosition(),e.range.getEndPosition())),yCe(l,e)?{completion:a,edit:l}:void 0})}async _deltaSelectedInlineCompletionIndex(e){await this.triggerExplicitly();const t=this._filteredInlineCompletionItems.get()||[];if(t.length>0){const i=(this.selectedInlineCompletionIndex.get()+e+t.length)%t.length;this._selectedInlineCompletionId.set(t[i].semanticId,void 0)}else this._selectedInlineCompletionId.set(void 0,void 0)}async next(){await this._deltaSelectedInlineCompletionIndex(1)}async previous(){await this._deltaSelectedInlineCompletionIndex(-1)}_getMetadata(e,t,i=void 0){return i?vo.inlineCompletionPartialAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t,type:i}):vo.inlineCompletionAccept({nes:e.isInlineEdit,requestUuid:e.requestUuid,providerId:e.source.provider.providerId,languageId:t})}async accept(e=this._editor){var o;if(e.getModel()!==this.textModel)throw new Ve;let t,i=!1;const s=this.state.get();if((s==null?void 0:s.kind)==="ghostText"){if(!s||s.primaryGhostText.isEmpty()||!s.inlineCompletion)return;t=s.inlineCompletion}else if((s==null?void 0:s.kind)==="inlineEdit")t=s.inlineCompletion,i=!!s.nextEditUri;else return;t.addRef();try{if(e.pushUndoStop(),!i)if(t.snippetInfo){const r=An.delete(t.editRange),a=t.additionalTextEdits.map(c=>new An(D.lift(c.range),c.text??"")),l=ga.fromParallelReplacementsUnsorted([r,...a]);e.edit(l,this._getMetadata(t,this.textModel.getLanguageId())),e.setPosition(t.snippetInfo.range.getStartPosition(),"inlineCompletionAccept"),(o=Xo.get(e))==null||o.insert(t.snippetInfo.snippet,{undoStopBefore:!1})}else{const r=s.edits;let a=r;s.kind==="ghostText"&&(a=ort(r,this.textModel));const l=ule(a).map(h=>Ie.fromPositions(h)),c=t.additionalTextEdits.map(h=>new An(D.lift(h.range),h.text??"")),d=ga.fromParallelReplacementsUnsorted([...r,...c]);if(e.edit(d,this._getMetadata(t,this.textModel.getLanguageId())),t.hint===void 0&&e.setSelections(s.kind==="inlineEdit"?l.slice(-1):l,"inlineCompletionAccept"),s.kind==="inlineEdit"&&!this._accessibilityService.isMotionReduced()){const h=d.getNewRanges(),u=this._store.add(new Hrt(e,h,()=>{this._store.delete(u)}))}}this._onDidAccept.fire(),this.stop(),t.command&&await this._commandService.executeCommand(t.command.id,...t.command.arguments||[]).then(void 0,On),t.reportEndOfLife({kind:Y1.Accepted})}finally{t.removeRef(),this._inAcceptFlow.set(!0,void 0),this._lastAcceptedInlineCompletionInfo={textModelVersionIdAfter:this.textModel.getVersionId(),inlineCompletion:t}}}async acceptNextWord(){await this._acceptNext(this._editor,"word",(e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),s=this._languageConfigurationService.getLanguageConfiguration(i),o=new RegExp(s.wordDefinition.source,s.wordDefinition.flags.replace("g","")),r=t.match(o);let a=0;r&&r.index!==void 0?r.index===0?a=r[0].length:a=r.index:a=t.length;const c=/\s+/g.exec(t);return c&&c.index!==void 0&&c.index+c[0].length{const i=t.match(/\n/);return i&&i.index!==void 0?i.index+1:t.length},1)}async _acceptNext(e,t,i,s){if(e.getModel()!==this.textModel)throw new Ve;const o=this.inlineCompletionState.get();if(!o||o.primaryGhostText.isEmpty()||!o.inlineCompletion)return;const r=o.primaryGhostText,a=o.inlineCompletion;if(a.snippetInfo){await this.accept(e);return}const l=r.parts[0],c=new U(r.lineNumber,l.column),d=l.text,h=i(c,d);if(h===d.length&&r.parts.length===1){this.accept(e);return}const u=d.substring(0,h),f=this._positions.get(),g=f[0];a.addRef();try{this._isAcceptingPartially=!0;try{e.pushUndoStop();const v=D.fromPositions(g,c),w=e.getModel().getValueInRange(v)+u,C=new An(v,w),S=[C,...c6(this.textModel,f,C)].filter(Ts),L=ule(S).map(x=>Ie.fromPositions(x));e.edit(ga.fromParallelReplacementsUnsorted(S),this._getMetadata(a,t)),e.setSelections(L,"inlineCompletionPartialAccept"),e.revealPositionInCenterIfOutsideViewport(e.getPosition(),1)}finally{this._isAcceptingPartially=!1}const p=D.fromPositions(a.editRange.getStartPosition(),ls.ofText(u).addToPosition(c)),b=e.getModel().getValueInRange(p,1).length;a.reportPartialAccept(b,{kind:s,acceptedLength:b},{characters:h,ratio:h/d.length,count:1})}finally{a.removeRef()}}handleSuggestAccepted(e){const t=Gf(e.getSingleTextEdit(),this.textModel),i=this._computeAugmentation(t,void 0);if(!i)return;const o=this.textModel.getValueInRange(i.completion.editRange,1).length+t.text.length;i.completion.reportPartialAccept(t.text.length,{kind:2,acceptedLength:o},{characters:t.text.length,count:1,ratio:1})}extractReproSample(){var i;const e=this.textModel.getValue(),t=(i=this.state.get())==null?void 0:i.inlineCompletion;return{documentValue:e,inlineCompletion:t==null?void 0:t.getSourceCompletion()}}jump(){const e=this.inlineEditState.get();e&&vi(t=>{this._jumpedToId.set(e.inlineCompletion.semanticId,t),this.dontRefetchSignal.trigger(t);const i=e.inlineCompletion.targetRange,s=i.getStartPosition();if(this._editor.setPosition(s,"inlineCompletions.jump"),i.isSingleLine()&&(e.inlineCompletion.hint||!e.inlineCompletion.insertText.includes(` +`)))this._editor.revealPosition(s);else{const r=new D(i.startLineNumber-1,1,i.endLineNumber+1,1);this._editor.revealRange(r,1)}e.inlineCompletion.identity.setJumpTo(t),this._editor.focus()})}async handleInlineSuggestionShown(e,t,i){await e.reportInlineEditShown(this._commandService,t,i)}};PU=Wrt([J_(7,Ae),J_(8,ki),J_(9,qi),J_(10,Us),J_(11,De),J_(12,Bt),J_(13,E3)],PU);var _f;(function(n){n[n.Undo=0]="Undo",n[n.Redo=1]="Redo",n[n.AcceptWord=2]="AcceptWord",n[n.Other=3]="Other"})(_f||(_f={}));function c6(n,e,t){if(e.length===1)return[];const i=new fw(n),s=i.getTransformer(),o=s.getOffset(e[0]),r=e.slice(1).map(u=>s.getOffset(u));t=t.removeCommonPrefixAndSuffix(i);const a=s.getStringReplacement(t),l=a.replaceRange.start-o,c=a.replaceRange.join(Me.emptyAt(o)),d=i.getValueOfOffsetRange(c);return r.map(u=>{const f=u+l,g=f+a.replaceRange.length,p=new Me(f,g),m=p.join(Me.emptyAt(u));if(i.getValueOfOffsetRange(m)!==d)return;const v=new zs(p,a.newText);return s.getTextReplacement(v)}).filter(Ts)}class Hrt extends G{constructor(e,t,i){super(),i&&this._register({dispose:()=>i()}),this._register($i(e).setDecorations(wi(t.map(r=>({range:r,options:{description:"animation",className:"edits-fadeout-decoration",zIndex:1}})))));const s=new lrt(1,0,1e3,drt),o=new hrt(s);this._register(qe(r=>{const a=o.getValue(r);e.getContainerDomNode().style.setProperty("--animation-opacity",a.toString()),s.isFinished()&&this.dispose()}))}}function Vrt(n,e){const t=e.targetRange,i=n.getVisibleRanges();return i.length<1?!1:new D(i[0].startLineNumber,i[0].startColumn,i[i.length-1].endLineNumber,i[i.length-1].endColumn).containsRange(t)}var zrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Cle=function(n,e){return function(t,i){e(t,i,n)}},HL;class GX{constructor(e){this.name=e}select(e,t,i){if(i.length===0)return 0;const s=i[0].score[0];for(let o=0;ol&&h.type===i[c].completion.kind&&h.insertText===i[c].completion.insertText&&(l=h.touch,a=c),i[c].completion.preselect&&r===-1)return r=c}return a!==-1?a:r!==-1?r:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();const t=0;for(const[i,s]of e)s.touch=t,s.type=typeof s.type=="number"?s.type:nS.fromString(s.type),this._cache.set(i,s);this._seq=this._cache.size}}class $rt extends GX{constructor(){super("recentlyUsedByPrefix"),this._trie=my.forStrings(),this._seq=0}memorize(e,t,i){const{word:s}=e.getWordUntilPosition(t),o=`${e.getLanguageId()}/${s}`;this._trie.set(o,{type:i.completion.kind,insertText:i.completion.insertText,touch:this._seq++})}select(e,t,i){const{word:s}=e.getWordUntilPosition(t);if(!s)return super.select(e,t,i);const o=`${e.getLanguageId()}/${s}`;let r=this._trie.get(o);if(r||(r=this._trie.findSubstr(o)),r)for(let a=0;ae.push([i,t])),e.sort((t,i)=>-(t[1].touch-i[1].touch)).forEach((t,i)=>t[1].touch=i),e.slice(0,200)}fromJSON(e){if(this._trie.clear(),e.length>0){this._seq=e[0][1].touch+1;for(const[t,i]of e)i.type=typeof i.type=="number"?i.type:nS.fromString(i.type),this._trie.set(t,i)}}}var zm;let OU=(zm=class{constructor(e,t){this._storageService=e,this._configService=t,this._disposables=new ne,this._persistSoon=new ai(()=>this._saveState(),500),this._disposables.add(e.onWillSaveState(i=>{i.reason===Lm.SHUTDOWN&&this._saveState()}))}dispose(){this._disposables.dispose(),this._persistSoon.dispose()}memorize(e,t,i){this._withStrategy(e,t).memorize(e,t,i),this._persistSoon.schedule()}select(e,t,i){return this._withStrategy(e,t).select(e,t,i)}_withStrategy(e,t){var s;const i=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if(((s=this._strategy)==null?void 0:s.name)!==i){this._saveState();const o=HL._strategyCtors.get(i)||yle;this._strategy=new o;try{const a=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,l=this._storageService.get(`${HL._storagePrefix}/${i}`,a);l&&this._strategy.fromJSON(JSON.parse(l))}catch{}}return this._strategy}_saveState(){if(this._strategy){const t=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,i=JSON.stringify(this._strategy);this._storageService.store(`${HL._storagePrefix}/${this._strategy.name}`,i,t,1)}}},HL=zm,zm._strategyCtors=new Map([["recentlyUsedByPrefix",$rt],["recentlyUsed",jrt],["first",yle]]),zm._storagePrefix="suggest/memories",zm);OU=HL=zrt([Cle(0,Jo),Cle(1,lt)],OU);const o8=mt("ISuggestMemories");Lt(o8,OU,1);var Urt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qrt=function(n,e){return function(t,i){e(t,i,n)}},FU,b1;let HO=(b1=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=FU.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration(i=>i.hasChanged(139)&&this._update()),this._update()}dispose(){var e;this._configListener.dispose(),(e=this._selectionListener)==null||e.dispose(),this._ckAtEnd.reset()}_update(){const e=this._editor.getOption(139)==="on";if(this._enabled!==e)if(this._enabled=e,this._enabled){const t=()=>{if(!this._editor.hasModel()){this._ckAtEnd.set(!1);return}const i=this._editor.getModel(),s=this._editor.getSelection(),o=i.getWordAtPosition(s.getStartPosition());if(!o){this._ckAtEnd.set(!1);return}this._ckAtEnd.set(o.endColumn===s.getStartPosition().column&&s.getStartPosition().lineNumber===s.getEndPosition().lineNumber)};this._selectionListener=this._editor.onDidChangeCursorSelection(t),t()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}},FU=b1,b1.AtEnd=new Se("atEndOfWord",!1,{type:"boolean",description:_(1494,"A context key that is true when at the end of a word. Note that this is only defined when tab-completions are enabled")}),b1);HO=FU=Urt([qrt(1,Xe)],HO);var Krt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Grt=function(n,e){return function(t,i){e(t,i,n)}},VL,v1;let OS=(v1=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=VL.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),(e=this._listener)==null||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(e.items.length===0){this.reset();return}if(VL._moveIndex(!0,e,t)===t){this.reset();return}this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition(()=>{this._ignore||this.reset()}),this._ckOtherSuggestions.set(!0)}static _moveIndex(e,t,i){let s=i;for(let o=t.items.length;o>0&&(s=(s+t.items.length+(e?1:-1))%t.items.length,!(s===i||!t.items[s].completion.additionalTextEdits));o--);return s}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=VL._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}},VL=v1,v1.OtherSuggestions=new Se("hasOtherSuggestions",!1),v1);OS=VL=Krt([Grt(1,Xe)],OS);class Yrt{constructor(e,t,i,s){this._disposables=new ne,this._disposables.add(i.onDidSuggest(o=>{o.completionModel.items.length===0&&this.reset()})),this._disposables.add(i.onDidCancel(o=>{this.reset()})),this._disposables.add(t.onDidShow(()=>this._onItem(t.getFocusedItem()))),this._disposables.add(t.onDidFocus(this._onItem,this)),this._disposables.add(t.onDidHide(this.reset,this)),this._disposables.add(e.onWillType(o=>{if(this._active&&!t.isFrozen()&&i.state!==0){const r=o.charCodeAt(o.length-1);this._active.acceptCharacters.has(r)&&e.getOption(0)&&s(this._active.item)}}))}_onItem(e){if(!e||!Yo(e.item.completion.commitCharacters)){this.reset();return}if(this._active&&this._active.item.item===e.item)return;const t=new CA;for(const i of e.item.completion.commitCharacters)i.length>0&&t.add(i.charCodeAt(0));this._active={acceptCharacters:t,item:e}}reset(){this._active=void 0}dispose(){this._disposables.dispose()}}const Ll=class Ll{async provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o);const r=new Map;await new Promise(a=>Ll._bracketsRightYield(a,0,e,s,r)),await new Promise(a=>Ll._bracketsLeftYield(a,0,e,s,r,o))}return i}static _bracketsRightYield(e,t,i,s,o){const r=new Map,a=Date.now();for(;;){if(t>=Ll._maxRounds){e();break}if(!s){e();break}const l=i.bracketPairs.findNextBracket(s);if(!l){e();break}if(Date.now()-a>Ll._maxDuration){setTimeout(()=>Ll._bracketsRightYield(e,t+1,i,s,o));break}if(l.bracketInfo.isOpeningBracket){const d=l.bracketInfo.bracketText,h=r.has(d)?r.get(d):0;r.set(d,h+1)}else{const d=l.bracketInfo.getOpeningBrackets()[0].bracketText;let h=r.has(d)?r.get(d):0;if(h-=1,r.set(d,Math.max(0,h)),h<0){let u=o.get(d);u||(u=new qo,o.set(d,u)),u.push(l.range)}}s=l.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,s,o,r){const a=new Map,l=Date.now();for(;;){if(t>=Ll._maxRounds&&o.size===0){e();break}if(!s){e();break}const c=i.bracketPairs.findPrevBracket(s);if(!c){e();break}if(Date.now()-l>Ll._maxDuration){setTimeout(()=>Ll._bracketsLeftYield(e,t+1,i,s,o,r));break}if(c.bracketInfo.isOpeningBracket){const h=c.bracketInfo.bracketText;let u=a.has(h)?a.get(h):0;if(u-=1,a.set(h,Math.max(0,u)),u<0){const f=o.get(h);if(f){const g=f.shift();f.size===0&&o.delete(h);const p=D.fromPositions(c.range.getEndPosition(),g.getStartPosition()),m=D.fromPositions(c.range.getStartPosition(),g.getEndPosition());r.push({range:p}),r.push({range:m}),Ll._addBracketLeading(i,m,r)}}}else{const h=c.bracketInfo.getOpeningBrackets()[0].bracketText,u=a.has(h)?a.get(h):0;a.set(h,u+1)}s=c.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const s=t.startLineNumber,o=e.getLineFirstNonWhitespaceColumn(s);o!==0&&o!==t.startColumn&&(i.push({range:D.fromPositions(new U(s,o),t.getEndPosition())}),i.push({range:D.fromPositions(new U(s,1),t.getEndPosition())}));const r=s-1;if(r>0){const a=e.getLineFirstNonWhitespaceColumn(r);a===t.startColumn&&a!==e.getLineLastNonWhitespaceColumn(r)&&(i.push({range:D.fromPositions(new U(r,a),t.getEndPosition())}),i.push({range:D.fromPositions(new U(r,1),t.getEndPosition())}))}}};Ll._maxDuration=30,Ll._maxRounds=2;let VO=Ll;const Hh=class Hh{static async create(e,t){if(!t.getOption(134).localityBonus||!t.hasModel())return Hh.None;const i=t.getModel(),s=t.getPosition();if(!e.canComputeWordRanges(i.uri))return Hh.None;const[o]=await new VO().provideSelectionRanges(i,[s]);if(o.length===0)return Hh.None;const r=await e.computeWordRanges(i.uri,o[0].range);if(!r)return Hh.None;const a=i.getWordUntilPosition(s);return delete r[a.word],new class extends Hh{distance(l,c){if(!s.equals(t.getPosition()))return 0;if(c.kind===17)return 2<<20;const d=typeof c.label=="string"?c.label:c.label.label,h=r[d];if(Yfe(h))return 2<<20;const u=KM(h,D.fromPositions(l),D.compareRangesUsingStarts),f=u>=0?h[u]:h[Math.max(0,~u-1)];let g=o.length;for(const p of o){if(!D.containsRange(p.range,f))break;g-=1}return g}}}};Hh.None=new class extends Hh{distance(){return 0}};let zO=Hh,Sle=class{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}};class zp{constructor(e,t,i,s,o,r,a=$E.default,l=void 0){this.clipboardText=l,this._snippetCompareFn=zp._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=s,this._options=o,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=a,r==="top"?this._snippetCompareFn=zp._compareCompletionItemsSnippetsUp:r==="bottom"&&(this._snippetCompareFn=zp._compareCompletionItemsSnippetsDown)}get lineContext(){return this._lineContext}set lineContext(e){(this._lineContext.leadingLineContent!==e.leadingLineContent||this._lineContext.characterCountDelta!==e.characterCountDelta)&&(this._refilterKind=this._lineContext.characterCountDelta0&&i[0].container.incomplete&&e.add(t);return e}get stats(){return this._ensureCachedState(),this._stats}_ensureCachedState(){this._refilterKind!==0&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let s="",o="";const r=this._refilterKind===1?this._items:this._filteredItems,a=[],l=!this._options.filterGraceful||r.length>2e3?rw:Oje;for(let c=0;c=f)d.score=$c.Default;else if(typeof d.completion.filterText=="string"){const p=l(s,o,g,d.completion.filterText,d.filterTextLow,0,this._fuzzyScoreOptions);if(!p)continue;aH(d.completion.filterText,d.textLabel)===0?d.score=p:(d.score=Rje(s,o,g,d.textLabel,d.labelLow,0),d.score[0]=p[0])}else{const p=l(s,o,g,d.textLabel,d.labelLow,0,this._fuzzyScoreOptions);if(!p)continue;d.score=p}}d.idx=c,d.distance=this._wordDistance.distance(d.position,d.completion),a.push(d),e.push(d.textLabel.length)}this._filteredItems=a.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?KB(e.length-.85,e,(c,d)=>c-d):0}}static _compareCompletionItems(e,t){return e.score[0]>t.score[0]?-1:e.score[0]t.distance?1:e.idxt.idx?1:0}static _compareCompletionItemsSnippetsDown(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return 1;if(t.completion.kind===28)return-1}return zp._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(e.completion.kind===28)return-1;if(t.completion.kind===28)return 1}return zp._compareCompletionItems(e,t)}}var Zrt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},up=function(n,e){return function(t,i){e(t,i,n)}},BU;class eb{static shouldAutoTrigger(e){if(!e.hasModel())return!1;const t=e.getModel(),i=e.getPosition();t.tokenization.tokenizeIfCheap(i.lineNumber);const s=t.getWordAtPosition(i);return!(!s||s.endColumn!==i.column&&s.startColumn+1!==i.column||!isNaN(Number(s.word)))}constructor(e,t,i){this.leadingLineContent=e.getLineContent(t.lineNumber).substr(0,t.column-1),this.leadingWord=e.getWordUntilPosition(t),this.lineNumber=t.lineNumber,this.column=t.column,this.triggerOptions=i}}function Xrt(n,e,t){if(!e.getContextKeyValue(hi.inlineSuggestionVisible.key))return!0;const i=e.getContextKeyValue(hi.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(71).suppressSuggestions}function Qrt(n,e,t){if(!e.getContextKeyValue("inlineSuggestionVisible"))return!0;const i=e.getContextKeyValue(hi.suppressSuggestions.key);return i!==void 0?!i:!n.getOption(71).suppressSuggestions}let jO=BU=class{constructor(e,t,i,s,o,r,a,l,c){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=s,this._logService=o,this._contextKeyService=r,this._configurationService=a,this._languageFeaturesService=l,this._envService=c,this._toDispose=new ne,this._triggerCharacterListener=new ne,this._triggerQuickSuggest=new ya,this._triggerState=void 0,this._completionDisposables=new ne,this._onDidCancel=new q,this._onDidTrigger=new q,this._onDidSuggest=new q,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._currentSelection=this._editor.getSelection()||new Ie(1,1,1,1),this._toDispose.add(this._editor.onDidChangeModel(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeModelLanguage(()=>{this._updateTriggerCharacters(),this.cancel()})),this._toDispose.add(this._editor.onDidChangeConfiguration(()=>{this._updateTriggerCharacters()})),this._toDispose.add(this._languageFeaturesService.completionProvider.onDidChange(()=>{this._updateTriggerCharacters(),this._updateActiveSuggestSession()}));let d=!1;this._toDispose.add(this._editor.onDidCompositionStart(()=>{d=!0})),this._toDispose.add(this._editor.onDidCompositionEnd(()=>{d=!1,this._onCompositionEnd()})),this._toDispose.add(this._editor.onDidChangeCursorSelection(h=>{d||this._onCursorChange(h)})),this._toDispose.add(this._editor.onDidChangeModelContent(()=>{!d&&this._triggerState!==void 0&&this._refilterCompletionItems()})),this._updateTriggerCharacters()}dispose(){ei(this._triggerCharacterListener),ei([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(104)||!this._editor.hasModel()||!this._editor.getOption(137))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const s of i.triggerCharacters||[]){let o=e.get(s);o||(o=new Set,e.set(s,o)),o.add(i)}const t=i=>{var r;if(!Qrt(this._editor,this._contextKeyService,this._configurationService)||eb.shouldAutoTrigger(this._editor))return;if(!i){const a=this._editor.getPosition();i=this._editor.getModel().getLineContent(a.lineNumber).substr(0,a.column-1)}let s="";Qm(i.charCodeAt(i.length-1))?ns(i.charCodeAt(i.length-2))&&(s=i.substr(i.length-2)):s=i.charAt(i.length-1);const o=e.get(s);if(o){const a=new Map;if(this._completionModel)for(const[l,c]of this._completionModel.getItemsByProvider())o.has(l)||a.set(l,c);this.trigger({auto:!0,triggerKind:1,triggerCharacter:s,retrigger:!!this._completionModel,clipboardText:(r=this._completionModel)==null?void 0:r.clipboardText,completionOptions:{providerFilter:o,providerItemsToReuse:a}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd(()=>t()))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;this._triggerState!==void 0&&(this._triggerQuickSuggest.cancel(),(t=this._requestToken)==null||t.cancel(),this._requestToken=void 0,this._triggerState=void 0,this._completionModel=void 0,this._context=void 0,this._onDidCancel.fire({retrigger:e}))}clear(){this._completionDisposables.clear()}_updateActiveSuggestSession(){this._triggerState!==void 0&&(!this._editor.hasModel()||!this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.cancel():this.trigger({auto:this._triggerState.auto,retrigger:!0}))}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;if(this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||e.reason!==0&&e.reason!==3||e.source!=="keyboard"&&e.source!=="deleteLeft"){this.cancel();return}this._triggerState===void 0&&e.reason===0?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():this._triggerState!==void 0&&e.reason===3&&this._refilterCompletionItems()}_onCompositionEnd(){this._triggerState===void 0?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;S0.isAllOff(this._editor.getOption(102))||this._editor.getOption(134).snippetsPreventQuickSuggestions&&((e=Xo.get(this._editor))!=null&&e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet(()=>{if(this._triggerState!==void 0||!eb.shouldAutoTrigger(this._editor)||!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const t=this._editor.getModel(),i=this._editor.getPosition(),s=this._editor.getOption(102);if(!S0.isAllOff(s)){if(!S0.isAllOn(s)){t.tokenization.tokenizeIfCheap(i.lineNumber);const o=t.tokenization.getLineTokens(i.lineNumber),r=o.getStandardTokenType(o.findTokenIndexAtOffset(Math.max(i.column-1-1,0)));if(S0.valueFor(s,r)!=="on")return}Xrt(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(t)&&this.trigger({auto:!0})}},this._editor.getOption(103)))}_refilterCompletionItems(){Ft(this._editor.hasModel()),Ft(this._triggerState!==void 0);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new eb(e,t,{...this._triggerState,refilter:!0});this._onNewContext(i)}trigger(e){var u,f,g;if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=new eb(t,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:e.shy??!1,position:this._editor.getPosition()}),this._context=i;let s={triggerKind:e.triggerKind??0};e.triggerCharacter&&(s={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new Bi;const o=this._editor.getOption(128);let r=1;switch(o){case"top":r=0;break;case"bottom":r=2;break}const{itemKind:a,showDeprecated:l}=BU.createSuggestFilter(this._editor),c=new xN(r,((u=e.completionOptions)==null?void 0:u.kindFilter)??a,(f=e.completionOptions)==null?void 0:f.providerFilter,(g=e.completionOptions)==null?void 0:g.providerItemsToReuse,l),d=zO.create(this._editorWorkerService,this._editor),h=UX(this._languageFeaturesService.completionProvider,t,this._editor.getPosition(),c,s,this._requestToken.token);Promise.all([h,d]).then(async([p,m])=>{var S;if((S=this._requestToken)==null||S.dispose(),!this._editor.hasModel()){p.disposable.dispose();return}let b=e==null?void 0:e.clipboardText;if(!b&&p.needsClipboard&&(b=await this._clipboardService.readText()),this._triggerState===void 0){p.disposable.dispose();return}const v=this._editor.getModel(),w=new eb(v,this._editor.getPosition(),e),C={...$E.default,firstMatchCanBeWeak:!this._editor.getOption(134).matchOnWordStartOnly};if(this._completionModel=new zp(p.items,this._context.column,{leadingLineContent:w.leadingLineContent,characterCountDelta:w.column-this._context.column},m,this._editor.getOption(134),this._editor.getOption(128),C,b),this._completionDisposables.add(p.disposable),this._onNewContext(w),this._reportDurationsTelemetry(p.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const L of p.items)L.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${L.provider._debugDisplayName}`,L.completion)}).catch(Je)}_reportDurationsTelemetry(e){Math.random()>1e-4||setTimeout(()=>{this._telemetryService.publicLog2("suggest.durations.json",{data:JSON.stringify(e)}),this._logService.debug("suggest.durations.json",e)})}static createSuggestFilter(e){const t=new Set;e.getOption(128)==="none"&&t.add(28);const s=e.getOption(134);return s.showMethods||t.add(0),s.showFunctions||t.add(1),s.showConstructors||t.add(2),s.showFields||t.add(3),s.showVariables||t.add(4),s.showClasses||t.add(5),s.showStructs||t.add(6),s.showInterfaces||t.add(7),s.showModules||t.add(8),s.showProperties||t.add(9),s.showEvents||t.add(10),s.showOperators||t.add(11),s.showUnits||t.add(12),s.showValues||t.add(13),s.showConstants||t.add(14),s.showEnums||t.add(15),s.showEnumMembers||t.add(16),s.showKeywords||t.add(17),s.showWords||t.add(18),s.showColors||t.add(19),s.showFiles||t.add(20),s.showReferences||t.add(21),s.showColors||t.add(22),s.showFolders||t.add(23),s.showTypeParameters||t.add(24),s.showSnippets||t.add(28),s.showUsers||t.add(25),s.showIssues||t.add(26),{itemKind:t,showDeprecated:s.showDeprecated}}_onNewContext(e){if(this._context){if(e.lineNumber!==this._context.lineNumber){this.cancel();return}if(pi(e.leadingLineContent)!==pi(this._context.leadingLineContent)){this.cancel();return}if(e.columnthis._context.leadingWord.startColumn){if(eb.shouldAutoTrigger(this._editor)&&this._context){const i=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:i}})}return}if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&e.leadingWord.word.length!==0){const t=new Map,i=new Set;for(const[s,o]of this._completionModel.getItemsByProvider())o.length>0&&o[0].container.incomplete?i.add(s):t.set(s,o);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:i,providerItemsToReuse:t}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},this._completionModel.items.length===0){const s=eb.shouldAutoTrigger(this._editor);if(!this._context){this.cancel();return}if(s&&this._context.leadingWord.endColumn0,i&&e.leadingWord.word.length===0){this.cancel();return}}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}}}};jO=BU=Zrt([up(1,Qr),up(2,La),up(3,To),up(4,Li),up(5,Xe),up(6,lt),up(7,De),up(8,cZ)],jO);const kF=class kF{constructor(e,t){this._disposables=new ne,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType(()=>{if(this._locked||!e.hasModel())return;const i=e.getSelections(),s=i.length;let o=!1;for(let a=0;akF._maxSelectionLength)return;this._lastOvertyped[a]={value:r.getValueInRange(l),multiline:l.startLineNumber!==l.endLineNumber}}})),this._disposables.add(t.onDidTrigger(i=>{this._locked=!0})),this._disposables.add(t.onDidCancel(i=>{this._locked=!1}))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},d6=function(n,e){return function(t,i){e(t,i,n)}};let HU=class{constructor(e,t,i,s,o){this._menuId=t,this._menuService=s,this._contextKeyService=o,this._menuDisposables=new ne,this.element=he(e,me(".suggest-status-bar"));const r=a=>a instanceof rl?i.createInstance(RZ,a,{useComma:!1}):void 0;this._leftActions=new jr(this.element,{actionViewItemProvider:r}),this._rightActions=new jr(this.element,{actionViewItemProvider:r}),this._leftActions.domNode.classList.add("left"),this._rightActions.domNode.classList.add("right")}dispose(){this._menuDisposables.dispose(),this._leftActions.dispose(),this._rightActions.dispose(),this.element.remove()}show(){const e=this._menuService.createMenu(this._menuId,this._contextKeyService),t=()=>{const i=[],s=[];for(const[o,r]of e.getActions())o==="left"?i.push(...r):s.push(...r);this._leftActions.clear(),this._leftActions.push(i),this._rightActions.clear(),this._rightActions.push(s)};this._menuDisposables.add(e.onDidChange(()=>t())),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};HU=Jrt([d6(2,Ae),d6(3,lc),d6(4,Xe)],HU);var eat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xle=function(n,e){return function(t,i){e(t,i,n)}};function YX(n){return!!n&&!!(n.completion.documentation||n.completion.detail&&n.completion.detail!==n.completion.label)}let VU=class{constructor(e,t,i){this._editor=e,this._themeService=t,this._markdownRendererService=i,this._onDidClose=new q,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new q,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new ne,this._renderDisposeable=new ne,this._size=new Jt(330,0),this.domNode=me(".suggest-details"),this.domNode.classList.add("no-docs"),this._body=me(".body"),this._scrollbar=new wD(this._body,{alwaysConsumeMouseWheel:!0}),he(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=he(this._body,me(".header")),this._close=he(this._header,me("span"+$e.asCSSSelector(de.close))),this._close.title=_(1490,"Close"),this._close.role="button",this._close.tabIndex=-1,this._type=he(this._header,me("p.type")),this._docs=he(this._body,me("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(59)&&this._configureFont()}))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(59),i=t.getMassagedFontFamily(),s=e.get(135)||t.fontSize,o=e.get(136)||t.lineHeight,r=t.fontWeight,a=`${s}px`,l=`${o}px`;this.domNode.style.fontSize=a,this.domNode.style.lineHeight=`${o/s}`,this.domNode.style.fontWeight=r,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=l,this._close.style.width=l}getLayoutInfo(){const e=this._editor.getOption(136)||this._editor.getOption(59).lineHeight,t=Gd(this._themeService.getColorTheme().type)?2:1,i=t*2;return{lineHeight:e,borderWidth:t,borderHeight:i,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=_(1491,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,this.getLayoutInfo().lineHeight*2),this._onDidChangeContents.fire(this)}renderItem(e,t){var o;this._renderDisposeable.clear();let{detail:i,documentation:s}=e.completion;if(t){let r="";r+=`score: ${e.score[0]} `,r+=`prefix: ${e.word??"(no prefix)"} `,r+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel} `,r+=`distance: ${e.distance} (localityBonus-setting) `,r+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"} `,r+=`commit_chars: ${(o=e.completion.commitCharacters)==null?void 0:o.join("")} -`,s=new yo().appendCodeblock("empty",r),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!ZX(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const r=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=r,this._type.title=r,la(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(r))}else js(this._type),this._type.title="",ar(this._type),this.domNode.classList.add("no-type");if(js(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),js(this._docs);const r=this._markdownRendererService.render(s,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(r.element),this._renderDisposeable.add(r)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!s),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=r=>{r.preventDefault(),r.stopPropagation()},this._close.onclick=r=>{r.preventDefault(),r.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Qt(e,t);Qt.equals(i,this._size)||(this._size=i,ZOe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}};zU=iat([kle(1,en),kle(2,Jc)],zU);class nat{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new ne,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new EX,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=s.width-a.dimension.width,l=!0),a.north&&(o=s.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=e_(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Qt(220,2*o.lineHeight),a=e.top,l=function(){const S=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),L=-o.borderWidth+e.left+e.width,x=new Qt(S,s.height-e.top-o.borderHeight-o.verticalPadding),E=x.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:E,minSize:r.with(Math.min(S,r.width))}}(),c=function(){const S=e.left-o.borderWidth-o.horizontalPadding,L=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),x=new Qt(S,s.height-e.top-o.borderHeight-o.verticalPadding),E=x.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:E,minSize:r.with(Math.min(S,r.width))}}(),d=function(){const S=e.left,L=-o.borderWidth+e.top+e.height,x=new Qt(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:L,left:S,fit:x.height-t.height,maxSizeBottom:x,maxSizeTop:x,minSize:r.with(x.width)}}(),h=[l,c,d],u=h.find(S=>S.fit>=0)??h.sort((S,L)=>L.fit-S.fit)[0],f=e.top+e.height-o.borderHeight;let g,p=t.height;const m=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);p>m&&(p=m);let b;i?p<=u.maxSizeTop.height?(g=!0,b=u.maxSizeTop):(g=!1,b=u.maxSizeBottom):p<=u.maxSizeBottom.height?(g=!1,b=u.maxSizeBottom):(g=!0,b=u.maxSizeTop);let{top:v,left:w}=u;!g&&p>e.height&&(v=f-p);const C=this._editor.getDomNode();if(C){const S=C.getBoundingClientRect();v-=S.top,w-=S.left}this._applyTopLeft({left:w,top:v}),this._resizable.enableSashes(!g,u===l,g,u!==l),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(p,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const Ele=mt("fileService");var lu;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(lu||(lu={}));const sat=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function j2(n,e,t,i,s){if(Ue.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(He.isUri(s))return[];const o=i===lu.ROOT_FOLDER?["rootfolder-icon"]:i===lu.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===Ge.data)r=n_.parseMetaData(t).get(n_.META_DATA_LABEL);else{const a=t.path.match(sat);a?(r=$2(a[2].toLowerCase()),a[1]&&o.push(`${$2(a[1].toLowerCase())}-name-dir-icon`)):r=$2(t.authority.toLowerCase())}if(i===lu.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===lu.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const l=r.split(".");for(let c=1;c=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},h6=function(n,e){return function(t,i){e(t,i,n)}};const aat=Ai("suggest-more-info",de.chevronRight,_(1492,"Icon for more information in the suggest widget."));var Td;const lat=new(Td=class{extract(e,t){if(e.textLabel.match(Td._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(Td._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,s=Td._regexRelaxed.exec(i);if(s&&(s.index===0||s.index+s[0].length===i.length))return t[0]=s[0],!0}return!1}},Td._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Td._regexStrict=new RegExp(`^${Td._regexRelaxed.source}$`,"i"),Td);let jU=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new q,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new ne,i=e;i.classList.add("show-file-icons");const s=ue(e,me(".icon")),o=ue(s,me("span.colorspan")),r=ue(e,me(".contents")),a=ue(r,me(".main")),l=ue(a,me(".icon-label.codicon")),c=ue(a,me("span.left")),d=ue(a,me("span.right")),h=new tN(c,{supportHighlights:!0,supportIcons:!0});t.add(h);const u=ue(c,me("span.signature-label")),f=ue(c,me("span.qualifier-label")),g=ue(d,me("span.details-label")),p=ue(d,me("span.readMore"+Ue.asCSSSelector(aat)));return p.title=_(1493,"Read More"),{root:i,left:c,right:d,icon:s,colorspan:o,iconLabel:h,iconContainer:l,parametersLabel:u,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const b=this._editor.getOptions(),v=b.get(59),w=v.getMassagedFontFamily(),C=v.fontFeatureSettings,S=v.fontVariationSettings,L=b.get(135)||v.fontSize,x=b.get(136)||v.lineHeight,E=v.fontWeight,I=v.letterSpacing,R=`${L}px`,M=`${x}px`,A=`${I}px`;i.style.fontSize=R,i.style.fontWeight=E,i.style.letterSpacing=A,a.style.fontFamily=w,a.style.fontFeatureSettings=C,a.style.fontVariationSettings=S,a.style.lineHeight=M,s.style.height=M,s.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:xD(e.score)},r=[];if(s.kind===19&&lat.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=j2(this._modelService,this._languageService,He.from({scheme:"fake",path:e.textLabel}),lu.FILE),l=j2(this._modelService,this._languageService,He.from({scheme:"fake",path:s.detail}),lu.FILE);o.extraClasses=a.length>l.length?a:l}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[j2(this._modelService,this._languageService,He.from({scheme:"fake",path:e.textLabel}),lu.FOLDER),j2(this._modelService,this._languageService,He.from({scheme:"fake",path:s.detail}),lu.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...Ue.asClassNameArray(oS.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=u6(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=u6(s.label.detail||""),i.detailsLabel.textContent=u6(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?la(i.detailsLabel):ar(i.detailsLabel),ZX(e)?(i.right.classList.add("can-expand-details"),la(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),ar(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};jU=rat([h6(1,qi),h6(2,un),h6(3,en)],jU);function u6(n){return n.replace(/\r\n|\r|\n/g,"")}var cat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},U2=function(n,e){return function(t,i){e(t,i,n)}},jC;F("editorSuggestWidget.background",el,_(1473,"Background color of the suggest widget."));F("editorSuggestWidget.border",vY,_(1474,"Border color of the suggest widget."));const dat=F("editorSuggestWidget.foreground",Ru,_(1475,"Foreground color of the suggest widget."));F("editorSuggestWidget.selectedForeground",II,_(1476,"Foreground color of the selected entry in the suggest widget."));F("editorSuggestWidget.selectedIconForeground",DY,_(1477,"Icon foreground color of the selected entry in the suggest widget."));const hat=F("editorSuggestWidget.selectedBackground",NI,_(1478,"Background color of the selected entry in the suggest widget."));F("editorSuggestWidget.highlightForeground",u0,_(1479,"Color of the match highlights in the suggest widget."));F("editorSuggestWidget.focusHighlightForeground",C7e,_(1480,"Color of the match highlights in the suggest widget when an item is focused."));F("editorSuggestWidgetStatus.foreground",st(dat,.5),_(1481,"Foreground color of the suggest widget status."));class uat{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Pg}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Qt.is(t))return Qt.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var $m;let $U=($m=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Kt,this._pendingShowDetails=new Kt,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new Ca,this._disposables=new ne,this._onDidSelect=new Z1,this._onDidFocus=new Z1,this._onDidHide=new q,this._onDidShow=new q,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new q,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new EX,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new fat(this,e),this._persistedSize=new uat(t,e);class r{constructor(f,g,p=!1,m=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=m}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{var f,g;if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:p,defaultSize:m}=this.getLayoutInfo(),b=Math.round(p/2);let{width:v,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=b)&&(w=((f=a.persistedSize)==null?void 0:f.height)??m.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=b)&&(v=((g=a.persistedSize)==null?void 0:g.width)??m.width),this._persistedSize.store(new Qt(v,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=ue(this.element.domNode,me(".message")),this._listElement=ue(this.element.domNode,me(".tree"));const l=this._disposables.add(o.createInstance(zU,this.editor));l.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new nat(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);c();const d=o.createInstance(jU,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new pl("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>$s?"listitem":"option",getWidgetAriaLabel:()=>_(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;const g=oS.toLabel(u.completion.kind);if(typeof u.completion.label!="string"){const{detail:v,description:w}=u.completion.label;v&&w?f=_(1485,"{0} {1}, {2}, {3}",f,v,w,g):v?f=_(1486,"{0} {1}, {2}",f,v,g):w&&(f=_(1487,"{0}, {1}, {2}",f,w,g))}else f=_(1488,"{0}, {1}",f,g);if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,b=J1("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return _(1489,"{0}, docs: {1}",f,b)}}}),this._list.style(zw({listInactiveFocusBackground:hat,listInactiveFocusOutline:Vi})),this._status=o.createInstance(VU,this.element.domNode,Nm);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);h(),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(134)&&(h(),c()),this._completionModel&&(u.hasChanged(59)||u.hasChanged(135)||u.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=_t.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=_t.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=_t.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=_t.HasFocusedSuggestion.bindTo(i),this._disposables.add(xn(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onListFocus(e){var s;if(this._ignoreFocusEvents)return;if(this._state===5&&this._setState(3),!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((s=this._currentSuggestionDetails)==null||s.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=ss(async o=>{const r=kg(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),a=o.onCancellationRequested(()=>r.dispose());try{return await t.resolve(o)}finally{r.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))}).catch(Je)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:ar(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=jC.LOADING_MESSAGE,ar(this._listElement,this._status.element),la(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xd(jC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=jC.NO_SUGGESTIONS_MESSAGE,ar(this._listElement,this._status.element),la(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Xd(jC.NO_SUGGESTIONS_MESSAGE);break;case 3:ar(this._messageElement),la(this._listElement,this._status.element),this._show();break;case 4:ar(this._messageElement),la(this._listElement,this._status.element),this._show();break;case 5:ar(this._messageElement),la(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=kg(()=>this._setState(1),t)))}showSuggestions(e,t,i,s,o){var l,c;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(c=this._currentSuggestionDetails)==null||c.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,t===0?0:this.getLayoutInfo().itemHeight*.33),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=gA(Oe(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._list.setFocus(this._list.getFocus()),this._setState(3)):this._state===3&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(ZX(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=gA(Oe(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightl&&(o=l);const c=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,d=i.statusBarHeight+this._list.contentHeight+i.borderHeight,h=i.itemHeight+i.statusBarHeight,u=dn(this.editor.getDomNode()),f=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),g=u.top+f.top+f.height,p=Math.min(t.height-g-i.verticalPadding,d),m=u.top+f.top-i.verticalPadding,b=Math.min(m,d);let v=Math.min(Math.max(b,p)+i.borderHeight,d);s===((r=this._cappedHeight)==null?void 0:r.capped)&&(s=this._cappedHeight.wanted),sv&&(s=v),s>p&&b>p||this._forceRenderingAbove&&m>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=p),this.element.preferredSize=new Qt(c,i.defaultSize.height),this.element.maxSize=new Qt(l,v),this.element.minSize=new Qt(220,h),this._cappedHeight=s===d?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:s}:void 0}this._resize(o,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())==null?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(59),t=rr(this.editor.getOption(136)||e.lineHeight,8,1e3),i=!this.editor.getOption(134).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.getLayoutInfo().borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Qt(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},jC=$m,$m.LOADING_MESSAGE=_(1482,"Loading..."),$m.NO_SUGGESTIONS_MESSAGE=_(1483,"No suggestions."),$m);$U=jC=cat([U2(1,Qo),U2(2,Xe),U2(3,en),U2(4,Ae)],$U);class fat{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Qt(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var gat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},TC=function(n,e){return function(t,i){e(t,i,n)}},UU;class pat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=nt.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(D.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var S1;let Hd=(S1=class{static get(e){return e.getContribution(UU.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Kt,this._toDispose=new ne,this._selectors=new mat(h=>h.priority),this._onWillInsertSuggestItem=new q,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=o.createInstance(jO,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const l=_t.InsertMode.bindTo(s);l.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(134).insertMode))),this.widget=this._toDispose.add(new v7(Oe(e.getDomNode()),()=>{const h=this._instantiationService.createInstance($U,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(m=>this._insertSuggestion(m,0),this));const u=new Xrt(this.editor,h,this.model,m=>this._insertSuggestion(m,2));this._toDispose.add(u);const f=_t.MakesTextEdit.bindTo(this._contextKeyService),g=_t.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=_t.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Re(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(h.onDidFocus(({item:m})=>{const b=this.editor.getPosition(),v=m.editStart.column,w=b.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&w-v===m.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:v,endLineNumber:b.lineNumber,endColumn:w})!==m.completion.insertText),f.set(C),g.set(!U.equals(m.editInsertEnd,m.editReplaceEnd)),p.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(m=>{if(m.toKeyCodeChord().equals(new Lg(!0,!1,!1,!1,33))||wt&&m.toKeyCodeChord().equals(new Lg(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&h.forceRenderingAbove(),h})),this._overtypingCapturer=this._toDispose.add(new v7(Oe(e.getDomNode()),()=>this._toDispose.add(new HU(this.editor,this.model)))),this._alternatives=this._toDispose.add(new v7(Oe(e.getDomNode()),()=>this._toDispose.add(new BS(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(HO,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new pat(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(u=g.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===0)return;let f=!1;if(h.triggerOptions.auto){const g=this.editor.getOption(134);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===1&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=_t.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(1);c.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){var g;if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Zo.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],l=new Wi;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=nh.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let b=D.lift(m.range);if(b.startLineNumber===r.position.lineNumber&&b.startColumn>r.position.column){const v=this.editor.getPosition().column-r.position.column,w=v,C=D.spansMultipleLines(b)?0:v;b=new D(b.startLineNumber,b.startColumn+w,b.endLineNumber,b.endColumn+C)}return ln.replaceMove(b,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new xs;let m;const b=s.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),b.dispose();return}for(const L of S.changes){const x=D.getEndPosition(L.range);(!m||U.isBefore(x,m))&&(m=x)}}),v=t;t|=2;let w=!1;const C=this.editor.onWillType(()=>{C.dispose(),w=!0,v&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(L=>U.isBefore(m,D.getStartPosition(L.range))))return!1;w&&this.editor.pushUndoStop();const S=nh.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(L=>ln.replaceMove(D.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(v&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),S),u=S===!0?1:S===!1?0:-2}).finally(()=>{b.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&4||(f=vw.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:wo.suggest({providerId:A5.fromExtensionId((g=r.extensionId)==null?void 0:g.value)})}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===$O.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new xs;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?Bn(m):Je(m)}).finally(()=>{h=p.elapsed()}))}t&4&&this._alternatives.value.set(e,p=>{for(l.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(p,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,h,u,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o,r,a){var u;if(Math.random()>1e-4)return;const l=new Map;for(let f=0;f1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((u=e.extensionId)==null?void 0:u.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:dD(rc(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:G4e(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o,index:r,firstIndex:h})}getOverwriteInfo(e,t){Ot(this.editor.hasModel());let i=this.editor.getOption(134).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(Go(e.completion.additionalTextEdits)){const t=_(1463,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);_r(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};ve.once(this.model.onDidTrigger)(o=>{const r=[];ve.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{Jt(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(Jt(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!s(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}},UU=S1,S1.ID="editor.contrib.suggestController",S1);Hd=UU=gat([TC(1,o8),TC(2,Ei),TC(3,Xe),TC(4,Ae),TC(5,ki),TC(6,Ro)],Hd);class mat{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const EF=class EF extends Ne{constructor(){super({id:EF.id,label:ie(1471,"Trigger Suggest"),precondition:le.and(H.writable,H.hasCompletionItemProvider,_t.Visible.toNegated()),kbOpts:{kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=Hd.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}};EF.id="editor.action.triggerSuggest";let $O=EF;At(Hd.ID,Hd,2);we($O);const ul=190,Sr=cs.bindToContribution(Hd.get);ye(new Sr({id:"acceptSelectedSuggestion",precondition:le.and(_t.Visible,_t.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:le.and(_t.Visible,H.textInputFocus),weight:ul},{primary:3,kbExpr:le.and(_t.Visible,H.textInputFocus,_t.AcceptSuggestionsOnEnter,_t.MakesTextEdit),weight:ul}],menuOpts:[{menuId:Nm,title:_(1464,"Insert"),group:"left",order:1,when:_t.HasInsertAndReplaceRange.toNegated()},{menuId:Nm,title:_(1465,"Insert"),group:"left",order:1,when:le.and(_t.HasInsertAndReplaceRange,_t.InsertMode.isEqualTo("insert"))},{menuId:Nm,title:_(1466,"Replace"),group:"left",order:1,when:le.and(_t.HasInsertAndReplaceRange,_t.InsertMode.isEqualTo("replace"))}]}));ye(new Sr({id:"acceptAlternativeSelectedSuggestion",precondition:le.and(_t.Visible,H.textInputFocus,_t.HasFocusedSuggestion),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Nm,group:"left",order:2,when:le.and(_t.HasInsertAndReplaceRange,_t.InsertMode.isEqualTo("insert")),title:_(1467,"Replace")},{menuId:Nm,group:"left",order:2,when:le.and(_t.HasInsertAndReplaceRange,_t.InsertMode.isEqualTo("replace")),title:_(1468,"Insert")}]}));Rt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");ye(new Sr({id:"hideSuggestWidget",precondition:_t.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:9,secondary:[1033]}}));ye(new Sr({id:"selectNextSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));ye(new Sr({id:"selectNextPageSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:12,secondary:[2060]}}));ye(new Sr({id:"selectLastSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));ye(new Sr({id:"selectPrevSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));ye(new Sr({id:"selectPrevPageSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:11,secondary:[2059]}}));ye(new Sr({id:"selectFirstSuggestion",precondition:le.and(_t.Visible,le.or(_t.MultipleSuggestions,_t.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));ye(new Sr({id:"focusSuggestion",precondition:le.and(_t.Visible,_t.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));ye(new Sr({id:"focusAndAcceptSuggestion",precondition:le.and(_t.Visible,_t.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));ye(new Sr({id:"toggleSuggestionDetails",precondition:le.and(_t.Visible,_t.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Nm,group:"right",order:1,when:le.and(_t.DetailsVisible,_t.CanResolve),title:_(1469,"Show Less")},{menuId:Nm,group:"right",order:1,when:le.and(_t.DetailsVisible.toNegated(),_t.CanResolve),title:_(1470,"Show More")}]}));ye(new Sr({id:"toggleExplainMode",precondition:_t.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));ye(new Sr({id:"toggleSuggestionFocus",precondition:_t.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2570,mac:{primary:778}}}));ye(new Sr({id:"insertBestCompletion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),HO.AtEnd,_t.Visible.toNegated(),BS.OtherSuggestions.toNegated(),Zo.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(ns(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:ul,primary:2}}));ye(new Sr({id:"insertNextSuggestion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),BS.OtherSuggestions,_t.Visible.toNegated(),Zo.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2}}));ye(new Sr({id:"insertPrevSuggestion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),BS.OtherSuggestions,_t.Visible.toNegated(),Zo.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:1026}}));we(class extends Ne{constructor(){super({id:"editor.action.resetSuggestSize",label:ie(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(n,e){var t;(t=Hd.get(e))==null||t.resetWidgetSize()}});class _at extends G{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new q),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(o=>{o.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(o=>{o.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const s=Hd.get(this.editor);if(s){this._register(s.registerSelector({priority:100,select:(a,l,c)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?Gf(h,d):void 0;if(!u)return-1;const f=U.lift(l),g=c.map((m,b)=>{const v=Xk.fromSuggestion(s,d,f,m,this.isShiftKeyPressed),w=Gf(v.getSingleTextEdit(),d),C=kCe(u,w);return{index:b,valid:C,prefixLength:w.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),p=cY(g,lo(m=>m.prefixLength,pa));return p?p.index:-1}}));let o=!1;const r=()=>{o||(o=!0,this._register(s.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(s.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(s.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(ve.once(s.model.onDidTrigger)(a=>{r()})),this._register(s.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const d=Xk.fromSuggestion(s,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!bat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=Hd.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return Xk.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=Hd.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=Hd.get(this.editor);e==null||e.forceRenderingAbove()}}class Xk{static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&4){const c=new vw().parse(r);c.children.length<100&&PO.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(s,o);return new Xk(D.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,s.completion.kind,a,s.container.incomplete??!1)}constructor(e,t,i,s,o){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s,this.listIncomplete=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new Ige(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new On(this.range,this.insertText)}}function bat(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}class vat extends G{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new _at(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),s=>this._editorObs.forceUpdate(o=>{this._handleSuggestAccepted(s)}))),this.selectedItem=Ut(this,s=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(o=>s(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class wat{constructor(e,t){this.lineNumber=e,this.columnRange=t}}class Ile{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new ze(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new D(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new Me(this.startColumn-1,this.endColumnExclusive-1)}}class wv{static fromLineTokens(e){const t=[];for(let i=0;i({text:i.text,metadata:i.metadata})),e)}map(e){const t=[];let i=0;for(const s of this._tokenInfo){const o=new Me(i,i+s.text.length);t.push(e(o,s)),i+=s.text.length}return t}slice(e){const t=[];let i=0;for(const s of this._tokenInfo){const o=i,r=o+s.text.length;if(r>e.start){if(o>=e.endExclusive)break;const a=Math.max(0,e.start-o),l=Math.max(0,r-e.endExclusive);t.push(new Nle(s.text.slice(a,s.text.length-l),s.metadata))}i+=s.text.length}return wv.create(t)}append(e){const t=this._tokenInfo.concat(e._tokenInfo);return wv.create(t)}}class Nle{constructor(e,t){this.text=e,this.metadata=t}}var Cat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yat=function(n,e){return function(t,i){e(t,i,n)}};const TCe="ghost-text";var x1;let NN=(x1=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=s,this._isClickable=o,this._languageService=r,this._isDisposed=Ze(this,!1),this._editorObs=Ui(this._editor),this._warningState=oe(a=>{const l=this._model.ghostText.read(a);if(!l)return;const c=this._model.warning.read(a);if(c)return{lineNumber:l.lineNumber,position:new U(l.lineNumber,l.parts[0].column),icon:c.icon}}),this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(a=>a.syntaxHighlightingEnabled),this._extraClassNames=oe(this,a=>{const l=[...this._options.read(a).extraClasses??[]];return this._useSyntaxHighlighting.read(a)&&l.push("syntax-highlighted"),this._warningState.read(a)&&l.push("warning"),l.map(d=>` ${d}`).join("")}),this.uiState=oe(this,a=>{var M,A;if(this._isDisposed.read(a))return;const l=this._editorObs.model.read(a);if(l!==this._model.targetTextModel.read(a))return;const c=this._model.ghostText.read(a);if(!c)return;const d=c instanceof NU?c.columnRange:void 0,h=this._useSyntaxHighlighting.read(a),u=this._extraClassNames.read(a),{inlineTexts:f,additionalLines:g,hiddenRange:p,additionalLinesOriginalSuffix:m}=Sat(c,l,TCe+u),b=l.getLineContent(c.lineNumber),v=new Dg(f.map(W=>zs.insert(W.column-1,W.text))),w=h?l.tokenization.tokenizeLinesAt(c.lineNumber,[v.apply(b),...g.map(W=>W.content)]):void 0,C=v.getNewRanges(),S=f.map((W,P)=>{var B;return{...W,tokens:(B=w==null?void 0:w[0])==null?void 0:B.getTokensInRange(C[P])}}),L=g.map((W,P)=>{let B=(w==null?void 0:w[P+1])??vn.createEmpty(W.content,this._languageService.languageIdCodec);if(P===g.length-1&&m){const K=wv.fromLineTokens(l.tokenization.getLineTokens(m.lineNumber)).slice(m.columnRange.toZeroBasedOffsetRange());B=wv.fromLineTokens(B).append(K).toLineTokens(B.languageIdCodec)}return{content:B,decorations:W.decorations}}),x=(M=this._editor.getSelection())==null?void 0:M.getStartPosition().column,E=S.filter(W=>W.text!==""),I=E.length!==0,R={cursorColumnDistance:(I?E[0].column:1)-x,cursorLineDistance:I?0:g.findIndex(W=>W.content!=="")+1,lineCountOriginal:I?1:0,lineCountModified:g.length+(I?1:0),characterCountOriginal:0,characterCountModified:ZM(E.map(W=>W.text.length))+ZM(L.map(W=>W.content.getTextLength())),disjointReplacements:E.length+(g.length>0?1:0),sameShapeReplacements:E.length>1&&L.length===0?E.every(W=>W.text===E[0].text):void 0};return(A=this._model.handleInlineCompletionShown.read(a))==null||A(R),{replacedRange:d,inlineTexts:S,additionalLines:L,hiddenRange:p,lineNumber:c.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(a),targetTextModel:l,syntaxHighlightingEnabled:h}}),this.decorations=oe(this,a=>{const l=this.uiState.read(a);if(!l)return[];const c=[],d=this._extraClassNames.read(a);l.replacedRange&&c.push({range:l.replacedRange.toRange(l.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+d,description:"GhostTextReplacement"}}),l.hiddenRange&&c.push({range:l.hiddenRange.toRange(l.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const h of l.inlineTexts)c.push({range:D.fromPositions(new U(l.lineNumber,h.column)),options:{description:"ghost-text-decoration",after:{content:h.text,tokens:h.tokens,inlineClassName:(h.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+d+h.lineDecorations.map(u=>" "+u.className).join(" "),cursorStops:jl.Left,attachedData:new f6(this)},showIfCollapsed:!0}});return c}),this._additionalLinesWidget=this._register(new xat(this._editor,oe(a=>{const l=this.uiState.read(a);return l?{lineNumber:l.lineNumber,additionalLines:l.additionalLines,minReservedLineCount:l.additionalReservedLineCount,targetTextModel:l.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(a=>{var l;return a.target.type===6&&((l=a.target.detail.injectedText)==null?void 0:l.options.attachedData)instanceof f6&&a.target.detail.injectedText.options.attachedData.owner===this},this._store),this.isHovered=oe(this,a=>this._isDisposed.read(a)?!1:this._isInlineTextHovered.read(a)||this._additionalLinesWidget.isHovered.read(a)),this.height=oe(this,a=>this._editorObs.getOption(75).read(a)+(this._additionalLinesWidget.viewZoneHeight.read(a)??0)),this._register(Re(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(a=>this._onDidClick.fire(a))),this._register(this._editor.onMouseUp(a=>{var c;if(a.target.type!==6)return;const l=(c=a.target.detail.injectedText)==null?void 0:c.options.attachedData;l instanceof f6&&l.owner===this&&this._onDidClick.fire(a.event)}))),this._register(Eo((a,l)=>{}))}static getWarningWidgetContext(e){const t=e.ghostTextViewWarningWidgetData;if(t)return t;if(e.parentElement)return this.getWarningWidgetContext(e.parentElement)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}},x1.hot=j3(x1),x1);NN=Cat([yat(5,un)],NN);class f6{constructor(e){this.owner=e}}function Sat(n,e,t){const i=[],s=[];function o(h,u){if(s.length>0){const f=s[s.length-1];u&&f.decorations.push(new qo(f.content.length+1,f.content.length+1+h[0].line.length,u,0)),f.content+=h[0].line,h=h.slice(1)}for(const f of h)s.push({content:f.line,decorations:u?[new qo(1,f.line.length+1,u,0),...f.lineDecorations]:[...f.lineDecorations]})}const r=e.getLineContent(n.lineNumber);let a,l=0;for(const h of n.parts){let u=h.lines;a===void 0?(i.push({column:h.column,text:u[0].line,preview:h.preview,lineDecorations:u[0].lineDecorations}),u=u.slice(1)):o([{line:r.substring(l,h.column-1),lineDecorations:[]}],void 0),u.length>0&&(o(u,t),a===void 0&&h.column<=r.length&&(a=h.column)),l=h.column-1}let c;a!==void 0&&(c=new wat(n.lineNumber,new Ile(l+1,r.length+1)));const d=a!==void 0?new Ile(a,r.length+1):void 0;return{inlineTexts:i,additionalLines:s,hiddenRange:d,additionalLinesOriginalSuffix:c}}class xat extends G{get viewZoneId(){var e;return(e=this._viewZoneInfo)==null?void 0:e.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,s){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=s,this._viewZoneHeight=Ze("viewZoneHeight",void 0),this.editorOptionsChanged=da("editorOptionChanged",ve.filter(this._editor.onDidChangeConfiguration,o=>o.hasChanged(40)||o.hasChanged(133)||o.hasChanged(113)||o.hasChanged(108)||o.hasChanged(60)||o.hasChanged(59)||o.hasChanged(75))),this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new Kt),this.isHovered=Ui(this._editor).isTargetHovered(o=>Dle(o.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof lw&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(o=>this.hasBeenAccepted=o.source==="inlineSuggestion.accept")),this._register(qe(o=>{const r=this._lines.read(o);this.editorOptionsChanged.read(o),r?(this.hasBeenAccepted=!1,this.updateLines(r.lineNumber,r.additionalLines,r.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(e=>{this.removeActiveViewZone(e)})}updateLines(e,t,i){const s=this._editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this._editor.changeViewZones(r=>{const a=new ne;this.removeActiveViewZone(r);const l=Math.max(t.length,i);if(l>0){const c=document.createElement("div");Lat(c,o,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(a.add(J(c,"mousedown",d=>{d.preventDefault()})),a.add(J(c,"click",d=>{Dle(d.target)&&this._onDidClick.fire(new ao(Oe(d),d))}))),this.addViewZone(r,e,l,c)}this._viewZoneListener.value=a})}addViewZone(e,t,i,s){const o=e.addZone({afterLineNumber:t,heightInLines:i,domNode:s,afterColumnAffinity:1,onComputedHeight:r=>{this._viewZoneHeight.set(r,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:o,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){var s,o;if(!this._shouldKeepCursorStable)return;const i=(o=(s=this._editor.getSelection())==null?void 0:s.getStartPosition())==null?void 0:o.lineNumber;i!==void 0&&e`);for(let m=0,b=t.length;m');const C=w.getLineContent(),S=aD(C),L=aS(C);tx(new Vg(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,C,!1,S,L,0,w,v.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==Cg.OFF,null,null,0),f),f.appendString("")}f.appendString(""),Ms(n,d);const g=f.build(),p=Tle?Tle.createHTML(g):g;n.innerHTML=p}const Tle=Tu("editorGhostText",{createHTML:n=>n}),IF=class IF{constructor(e){this.replacements=e,QE(nD(e,(t,i)=>t.lineRange.endLineNumberExclusive<=i.lineRange.startLineNumber))}toString(){return this.replacements.map(e=>e.toString()).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(Ye.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}};IF.empty=new IF([]);let qU=IF;class UO{static fromSingleTextEdit(e,t){const i=wa(e.text);let s=e.range.startLineNumber;const o=t.getValueOfRange(D.fromPositions(new U(e.range.startLineNumber,1),e.range.getStartPosition()));i[0]=o+i[0];let r=e.range.endLineNumber+1;const a=t.getTransformer().getLineLength(e.range.endLineNumber)+1,l=t.getValueOfRange(D.fromPositions(e.range.getEndPosition(),new U(e.range.endLineNumber,a)));i[i.length-1]=i[i.length-1]+l;const c=e.range.startColumn===t.getTransformer().getLineLength(e.range.startLineNumber)+1,d=e.range.endColumn===1;return c&&i[0].length===o.length&&(s++,i.shift()),i.length>0&&s${JSON.stringify(this.newLines)}`}toLineEdit(){return new qU([this])}}class RCe{get lineEdit(){return this.edit.replacements.length===0?new UO(new Ye(1,1),[]):UO.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(Ye.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,s,o,r){this.originalText=e,this.edit=t,this.cursorPosition=i,this.multiCursorPositions=s,this.commands=o,this.inlineCompletion=r}}class MCe{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??_(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}}class kat{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class Eat{constructor(e,t,i,s){this.lineRange=i;const o=Ui(e),r=oe(this,a=>o.isFocused.read(a)&&s.showInlineEditMenu?So.Accept:So.Inactive);this.model=new MCe(t,new RCe(new Yp(""),new fa([s.getSingleTextEdit()]),t.primaryPosition.get(),t.allPositions.get(),s.source.inlineSuggestions.commands??[],s),r)}}class pi{static fromPoints(e,t){return new pi(e.x,e.y,t.x,t.y)}static fromPointSize(e,t){return new pi(e.x,e.y,e.x+t.x,e.y+t.y)}static fromLeftTopRightBottom(e,t,i,s){return new pi(e,t,i,s)}static fromLeftTopWidthHeight(e,t,i,s){return new pi(e,t,e+i,t+s)}static fromRanges(e,t){return new pi(e.start,t.start,e.endExclusive,t.endExclusive)}static hull(e){let t=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;for(const r of e)t=Math.min(t,r.left),i=Math.min(i,r.top),s=Math.max(s,r.right),o=Math.max(o,r.bottom);return new pi(t,i,s,o)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,s){if(this.left=e,this.top=t,this.right=i,this.bottom=s,e>i)throw new ze("Invalid arguments: Horizontally offset by "+(e-i));if(t>s)throw new ze("Invalid arguments: Vertically offset by "+(t-s))}withMargin(e,t,i,s){let o,r,a,l;return t===void 0&&i===void 0&&s===void 0?o=r=a=l=e:i===void 0&&s===void 0?(o=r=t,a=l=e):(o=s,r=t,a=e,l=i),new pi(this.left-o,this.top-a,this.right+r,this.bottom+l)}intersectVertical(e){const t=Math.max(this.top,e.start),i=Math.min(this.bottom,e.endExclusive);return new pi(this.left,t,this.right,Math.max(t,i))}intersectHorizontal(e){const t=Math.max(this.left,e.start),i=Math.min(this.right,e.endExclusive);return new pi(t,this.top,Math.max(t,i),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(e){const t=Math.max(this.left,e.left),i=Math.min(this.right,e.right),s=Math.max(this.top,e.top),o=Math.min(this.bottom,e.bottom);if(!(t>i||s>o))return new pi(t,s,i,o)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(e){const t=this.width,i=this.height;let s=this.left,o=this.top;return se.right&&(s=e.right-t),oe.bottom&&(o=e.bottom-i),new pi(s,o,s+t,o+i)}withWidth(e){return new pi(this.left,this.top,this.left+e,this.bottom)}withHeight(e){return new pi(this.left,this.top,this.right,this.top+e)}withTop(e){return new pi(this.left,e,this.right,this.bottom)}withLeft(e){return new pi(e,this.top,this.right,this.bottom)}translateX(e){return new pi(this.left+e,this.top,this.right+e,this.bottom)}translateY(e){return new pi(this.left,this.top+e,this.right,this.bottom+e)}getLeftBottom(){return new bs(this.left,this.bottom)}getRightBottom(){return new bs(this.right,this.bottom)}getRightTop(){return new bs(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}class Qk{constructor(e,t,i,s=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=s}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Bi(this.startLineNumbers,e.startLineNumbers)&&Bi(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new Qk([],[],0)}}const Rle=Tu("stickyScrollViewLayer",{createHTML:n=>n}),g6="data-sticky-line-index",Mle="data-sticky-is-line",Iat="data-sticky-is-line-number",Ale="data-sticky-is-folding-icon";class Nat extends G{get height(){return this._height}constructor(e){super(),this._foldingIconStore=this._register(new ne),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new q),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Pg),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(131)&&t(),i.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const s=!this._state&&!e,o=this._state&&this._state.equals(e);if(i===void 0&&(s||o))return;const r=this._findRenderingData(e),a=this._lineNumbers;this._lineNumbers=r.lineNumbers,this._lastLineRelativePosition=r.lastLineRelativePosition;const l=this._findIndexToRebuildFrom(a,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,l),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];e.showEndForLine!==null&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let s=0;s!e.includes(o));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i,s){const o=this._editor._getViewModel();if(!o){this._clearWidget();return}if(e.length===0){this._clearWidget();return}const r=[],a=e[e.length-1];let l=0;for(let d=0;dd.scrollWidth))+c.verticalScrollbarWidth,this._renderedStickyLines=r,this._setHeight(l+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(J(this._lineNumbersDomNode,_e.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s,o,r,a){const l=e.coordinatesConverter.convertModelPositionToViewPosition(new U(i,1)).lineNumber,c=e.getViewLineRenderingData(l),d=this._editor.getOption(76),h=this._editor.getOption(117).verticalScrollbarSize;let u;try{u=qo.filter(c.inlineDecorations,l,c.minColumn,c.maxColumn)}catch{u=[]}const f=this._editor.getLineHeightForPosition(new U(i,1)),g=e.getTextDirection(i),p=new Vg(!0,!0,c.content,c.continuesWithWrappedLine,c.isBasicASCII,c.containsRTL,0,c.tokens,u,c.tabSize,c.startVisibleColumn,1,1,1,500,"none",!0,!0,null,g,h),m=new w_(2e3),b=tx(p,m);let v;Rle?v=Rle.createHTML(m.build()):v=m.build();const w=document.createElement("span");w.setAttribute(g6,String(t)),w.setAttribute(Mle,""),w.setAttribute("role","listitem"),w.tabIndex=0,w.className="sticky-line-content",w.classList.add(`stickyLine${i}`),w.style.lineHeight=`${f}px`,w.innerHTML=v;const C=document.createElement("span");C.setAttribute(g6,String(t)),C.setAttribute(Iat,""),C.className="sticky-line-number",C.style.lineHeight=`${f}px`;const S=a.contentLeft;C.style.width=`${S}px`;const L=document.createElement("span");d.renderType===1||d.renderType===3&&i%10===0?L.innerText=i.toString():d.renderType===2&&(L.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),L.className="sticky-line-number-inner",L.style.width=`${a.lineNumbersWidth}px`,L.style.paddingLeft=`${a.lineNumbersLeft}px`,C.appendChild(L);const x=this._renderFoldingIconForLine(r,i);x&&(C.appendChild(x.domNode),x.domNode.style.left=`${a.lineNumbersWidth+a.lineNumbersLeft}px`,x.domNode.style.lineHeight=`${f}px`),this._editor.applyFontInfo(w),this._editor.applyFontInfo(C),C.style.lineHeight=`${f}px`,w.style.lineHeight=`${f}px`,C.style.height=`${f}px`,w.style.height=`${f}px`;const E=new Dat(t,i,w,C,x,b.characterMapping,w.scrollWidth,f);return this._updatePosition(E,s,o)}_updatePosition(e,t,i){var r;const s=e.lineDomNode,o=e.lineNumberDomNode;if(i){const a="0";s.style.zIndex=a,o.style.zIndex=a;const l=`${t+this._lastLineRelativePosition+((r=e.foldingIcon)!=null&&r.isCollapsed?1:0)}px`;s.style.top=l,o.style.top=l}else{const a="1";s.style.zIndex=a,o.style.zIndex=a,s.style.top=`${t}px`,o.style.top=`${t}px`}return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const l=s.isCollapsed(o),c=new Tat(l,r,s.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(Ale,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=vS(t.characterMapping,e,0);return new U(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,g6);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Mle)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Ale)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Dat{constructor(e,t,i,s,o,r,a,l){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a,this.height=l}}class Tat{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${s}px`,this.domNode.style.lineHeight=`${s}px`,this.domNode.className=Ue.asClassName(e?yO:CO)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class Jk{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class qO{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class ACe{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var r8=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DN=function(n,e){return function(t,i){e(t,i,n)}},eE;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(eE||(eE={}));var cm;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(cm||(cm={}));let KU=class extends G{constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new sc(300)),this._updateOperation=this._register(new ne),this._editor.getOption(131).defaultModel){case eE.OUTLINE_MODEL:this._modelProviders.push(new GU(this._editor,s));case eE.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new ZU(this._editor,t,s));case eE.INDENTATION_MODEL:this._modelProviders.push(new YU(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const o=await i;if(this._modelPromise!==s)return null;switch(o){case cm.CANCELED:return this._updateOperation.clear(),null;case cm.VALID:return t.stickyModel}}return null}).catch(t=>(Je(t),null))}};KU=r8([DN(2,Ae),DN(3,De)],KU);class PCe extends G{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,cm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=ss(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?cm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),cm.VALID):this._invalid()).then(void 0,i=>(Je(i),cm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let GU=class extends PCe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return If.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var r;const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,(r=this._stickyModel)==null?void 0:r.outlineProviderId),o=this._editor.getModel();return new ACe(o.uri,o.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Nt.first(e.children.values())instanceof mCe){const a=Nt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>c&&(d=u,c=f,l=u.id)}t=l,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,l)=>{const c=new Jk(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new Jk(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new qO(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new Jk(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new qO(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof SU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};GU=r8([DN(1,De)],GU);class OCe extends PCe{constructor(e){super(e),this._foldingLimitReporter=this._register(new fCe(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new ACe(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new qO(void 0,[],void 0);for(let o=0;o{this._updateProvider(e,t)})),this._updateProvider(e,t)}_updateProvider(e,t){const i=u_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());i.length!==0&&(this.provider.value=new UX(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider.value)==null?void 0:t.compute(e))??null}};ZU=r8([DN(2,De)],ZU);var Rat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ple=function(n,e){return function(t,i){e(t,i,n)}};class Mat{constructor(e,t,i,s){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=s}}let XU=class extends G{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new q),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new ne),this._updateSoon=this._register(new ai(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Re(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var e;(e=this._stickyModelProvider)==null||e.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new KU(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Wi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){var i;if(!((i=this._model)!=null&&i.element))return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o,r){const a=this._editor.getModel();if(!a||t.children.length===0)return;let l=r;const c=[];for(let u=0;uu-f)),h=this.updateIndex(KM(c,e.endLineNumber,(u,f)=>u-f));for(let u=d;u<=h;u++){const f=t.children[u];if(!f||!f.range)continue;const{startLineNumber:g,endLineNumber:p}=f.range;if(p>g+1&&e.startLineNumber<=p+1&&g-1<=e.endLineNumber&&g!==l&&a.isValidRange(new D(g,1,p,1))){l=g;const m=this._editor.getLineHeightForPosition(new U(g,1));i.push(new Mat(g,p-1,o,m)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,s+1,o+m,g)}}}filterHiddenRanges(e){var i;const t=(i=this._editor._getViewModel())==null?void 0:i.getHiddenAreas();return t?e.filter(s=>!t.some(o=>s.startLineNumber>=o.startLineNumber&&s.endLineNumber<=o.endLineNumber+1)):e}updateIndex(e){return e===-1?0:e<0?-e-2:e}};XU=Rat([Ple(1,De),Ple(2,Ki)],XU);var Aat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},RC=function(n,e){return function(t,i){e(t,i,n)}},QU,L1;let Zc=(L1=class extends G{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new ne,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new q),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new Nat(this._editor),this._stickyLineCandidateProvider=new XU(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=Qk.Empty;const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeFont(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(J(l,_e.CONTEXT_MENU,async d=>{this._onContextMenu(Oe(l),d)})),this._stickyScrollFocusedContextKey=H.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=H.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(oc(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(J(l,_e.MOUSE_DOWN,d=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(d=>{this._onDidChangeStickyScrollHeight.fire(d)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(QU.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new ne,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(D.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new ne),t=this._register(new Z3(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new D(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(xn(s,_e.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const d=new U(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new U(c,1)}this._revealPosition(l)})),this._register(J(ri,_e.MOUSE_MOVE,o=>{this._mouseTarget=o.target,this._onMouseMoveOrKeyDown(o)})),this._register(J(ri,_e.KEY_DOWN,o=>{this._onMouseMoveOrKeyDown(o)})),this._register(J(ri,_e.KEY_UP,()=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new Wi;e.add(Re(()=>d.dispose(!0)));let h;HD(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new U(l.startLineNumber,l.startColumn+1),!1,d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=c;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Re(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Re(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(Qwe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new ao(e,t);this._contextMenuService.showContextMenu({menuId:Te.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey||!this._mouseTarget||!hn(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);t===null||this._showEndForLine===t||(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;VX(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(76).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(t*.25),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),s=this._stickyLineCandidateProvider.getVersionId();if(s===void 0||s===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=u_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=Qk.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const s=[],o=[],r=this._editor.getVisibleRanges();if(r.length!==0){const a=new Jk(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const c of l){const d=c.startLineNumber,h=c.endLineNumber,u=c.top,f=u+c.height,g=this._editor.getTopForLineNumber(d)-t,p=this._editor.getBottomForLineNumber(h)-t;if(u>g&&u<=p&&(s.push(d),o.push(h+1),f>p&&(i=p-f)),s.length===e)break}}return this._endLineNumbers=o,new Qk(s,o,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},QU=L1,L1.ID="store.contrib.stickyScrollController",L1);Zc=QU=Aat([RC(1,gl),RC(2,De),RC(3,Ae),RC(4,Ki),RC(5,pc),RC(6,Xe)],Zc);const tE=F("inlineEdit.originalBackground",st(Jp,.2),_(1220,"Background color for the original text in inline edits."),!0),FCe=F("inlineEdit.modifiedBackground",st(dv,.3),_(1221,"Background color for the modified text in inline edits."),!0);F("inlineEdit.originalChangedLineBackground",st(Jp,.8),_(1222,"Background color for the changed lines in the original text of inline edits."),!0);const Pat=F("inlineEdit.originalChangedTextBackground",st(Jp,.8),_(1223,"Overlay color for the changed text in the original text of inline edits."),!0),Oat=F("inlineEdit.modifiedChangedLineBackground",{light:st(zT,.7),dark:st(zT,.7),hcDark:zT,hcLight:zT},_(1224,"Background color for the changed lines in the modified text of inline edits."),!0),Fat=F("inlineEdit.modifiedChangedTextBackground",st(dv,.7),_(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),Bat=F("inlineEdit.gutterIndicator.primaryForeground",f3,_(1226,"Foreground color for the primary inline edit gutter indicator.")),k0=F("inlineEdit.gutterIndicator.primaryBorder",hv,_(1227,"Border color for the primary inline edit gutter indicator.")),BCe=F("inlineEdit.gutterIndicator.primaryBackground",{light:st(k0,.5),dark:st(k0,.4),hcDark:st(k0,.4),hcLight:st(k0,.5)},_(1228,"Background color for the primary inline edit gutter indicator.")),Wat=F("inlineEdit.gutterIndicator.secondaryForeground",mme,_(1229,"Foreground color for the secondary inline edit gutter indicator.")),WCe=F("inlineEdit.gutterIndicator.secondaryBorder",FA,_(1230,"Border color for the secondary inline edit gutter indicator.")),HCe=F("inlineEdit.gutterIndicator.secondaryBackground",WCe,_(1231,"Background color for the secondary inline edit gutter indicator.")),Hat=F("inlineEdit.gutterIndicator.successfulForeground",f3,_(1232,"Foreground color for the successful inline edit gutter indicator.")),VCe=F("inlineEdit.gutterIndicator.successfulBorder",hv,_(1233,"Border color for the successful inline edit gutter indicator.")),zCe=F("inlineEdit.gutterIndicator.successfulBackground",VCe,_(1234,"Background color for the successful inline edit gutter indicator.")),Vat=F("inlineEdit.gutterIndicator.background",{hcDark:st("tab.inactiveBackground",.5),hcLight:st("tab.inactiveBackground",.5),dark:st("tab.inactiveBackground",.5),light:"#5f5f5f18"},_(1235,"Background color for the inline edit gutter indicator.")),zL=F("inlineEdit.originalBorder",{light:Jp,dark:Jp,hcDark:Jp,hcLight:Jp},_(1236,"Border color for the original text in inline edits.")),jL=F("inlineEdit.modifiedBorder",{light:Wr(dv,.6),dark:dv,hcDark:dv,hcLight:dv},_(1237,"Border color for the modified text in inline edits.")),zat=F("inlineEdit.tabWillAcceptModifiedBorder",{light:Wr(jL,0),dark:Wr(jL,0),hcDark:Wr(jL,0),hcLight:Wr(jL,0)},_(1238,"Modified border color for the inline edits widget when tab will accept it.")),jat=F("inlineEdit.tabWillAcceptOriginalBorder",{light:Wr(zL,0),dark:Wr(zL,0),hcDark:Wr(zL,0),hcLight:Wr(zL,0)},_(1239,"Original border color for the inline edits widget over the original text when tab will accept it."));function TN(n){return n.map(e=>e===So.Accept?zat:jL)}function a8(n){return n.map(e=>e===So.Accept?jat:zL)}function Dl(n,e){let t;typeof n=="string"?t=p6(n,e):t=n.map((s,o)=>p6(s,e).read(o));const i=p6(Ln,e);return t.map((s,o)=>s.makeOpaque(i.read(o)))}function p6(n,e){return Xge({owner:{observeColor:n},equalsFn:(t,i)=>t.equals(i),debugName:()=>`observeColor(${n})`},e.onDidColorThemeChange,()=>{const t=e.getColorTheme().getColor(n);if(!t)throw new ze(`Missing color: ${n}`);return t})}function dm(n,e,t){n.layoutInfo.read(t),n.value.read(t);const i=n.model.read(t);if(!i)return 0;let s=0;n.scrollTop.read(t);for(let r=e.startLineNumber;ri.getLineContent(r));return s<5&&o.some(r=>r.length>0)&&i.uri.scheme!=="file"&&console.error("unexpected width"),s}function $at(n,e,t){return n.layoutInfo.read(t),n.value.read(t),n.model.read(t)?(n.scrollTop.read(t),n.editor.getOffsetForColumn(e.lineNumber,e.column)):0}function XX(n,e,t,i,s=void 0){const o=i.getModel();if(!o)return{prefixTrim:0,prefixLeftOffset:0};const r=n.map(u=>u.isSingleLine()?u.startColumn-1:0),a=e.mapToLineArray(u=>zV(o.getLineContent(u))),l=t.filter(u=>u!=="").map(u=>zV(u)),c=Math.min(...r,...a,...l);let d;if(o.getLineIndentColumn(e.startLineNumber)>=c+1)Ui(i).scrollTop.read(s),d=i.getOffsetForColumn(e.startLineNumber,c+1);else if(t.length>0)d=QX(t[0].slice(0,c),i,o);else return{prefixTrim:0,prefixLeftOffset:0};return{prefixTrim:c,prefixLeftOffset:d}}function QX(n,e,t){const i=e.getOption(59).typicalHalfwidthCharacterWidth,s=t.getOptions().tabSize*i,o=n.split(" ").length-1;return(n.length-o)*i+o*s}function JX(n){const e=n.layoutInfoContentLeft,t=oe({name:"editor.validOverlay.width"},s=>{const o=n.layoutInfoMinimap.read(s).minimapLeft!==0,r=n.layoutInfoWidth.read(s)-e.read(s);if(o){const a=n.layoutInfoMinimap.read(s).minimapWidth+n.layoutInfoVerticalScrollbarWidth.read(s);return r-a}return r}),i=oe({name:"editor.validOverlay.height"},s=>n.layoutInfoHeight.read(s)+n.contentHeight.read(s));return oe({name:"editor.validOverlay"},s=>pi.fromLeftTopWidthHeight(e.read(s),0,t.read(s),i.read(s)))}function Uat(n,e){const t=[];for(const i of n){const s=e.mapRange(i.modifiedRange);t.push(new lr(i.originalRange,s))}return t}function m6(...n){return n.filter(e=>typeof e=="string").join(" ")}function qat(n,e){return new D(e.lineNumber,e.column+n.start,e.lineNumber,e.column+n.endExclusive)}function Kat(n,e){let t=0;e:for(let i=0,s=n.length;iKat(i[r-1],t)),pa);return e.forEach(r=>{const a=Gat(i[r-1],o,t);s.push(new On(qat(new Me(0,a),new U(r,1)),""))}),new fa(s)}class JU{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}}function Iu(n){const e=Hg(void 0,(t,i)=>n.read(t)||i);return no({debugName:()=>`${n.debugName}.mapOutFalsy`},t=>{if(e.read(t),!!n.read(t))return e})}function ql(n,e=ls.ofCaller()){return{left:oe({name:"editor.validOverlay.left"},t=>n(t).left,e),top:oe({name:"editor.validOverlay.top"},t=>n(t).top,e),width:oe({name:"editor.validOverlay.width"},t=>n(t).right-n(t).left,e),height:oe({name:"editor.validOverlay.height"},t=>n(t).bottom-n(t).top,e)}}var Zat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_6=function(n,e){return function(t,i){e(t,i,n)}};let eq=class{constructor(e,t,i,s,o,r){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=s,this._keybindingService=o,this._commandService=r,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(a=>a.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=Ze("active",void 0),t=u=>({title:u.title,icon:u.icon,keybinding:typeof u.commandId=="string"?this._getKeybinding(u.commandArgs?void 0:u.commandId):oe(this,f=>typeof u.commandId=="string"?void 0:this._getKeybinding(u.commandArgs?void 0:u.commandId.read(f)).read(f)),isActive:e.map(f=>f===u.id),onHoverChange:f=>e.set(f?u.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand(typeof u.commandId=="string"?u.commandId:u.commandId.get(),...u.commandArgs??[]))}),i=Qat(this._model.displayName),s=ib(t({id:"gotoAndAccept",title:`${_(1212,"Go To")} / ${_(1213,"Accept")}`,icon:de.check,commandId:bN})),o=ib(t({id:"reject",title:_(1214,"Reject"),icon:de.close,commandId:Swe})),r=this._model.extensionCommands.map((u,f)=>ib(t({id:u.command.id+"_"+f,title:u.command.title,icon:u.icon??de.symbolEvent,commandId:u.command.id,commandArgs:u.command.arguments}))),a=this._inlineEditsShowCollapsed.map(u=>ib(t(u?{id:"showExpanded",title:_(1215,"Show Expanded"),icon:de.expandAll,commandId:N$}:{id:"showCollapsed",title:_(1216,"Show Collapsed"),icon:de.collapseAll,commandId:N$}))),l=ib(t({id:"snooze",title:_(1217,"Snooze"),icon:de.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),c=ib(t({id:"settings",title:_(1218,"Settings"),icon:de.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),d=this._model.action?[this._model.action]:[],h=d.length>0?Jat(d.map(u=>({id:u.id,label:u.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(u.id,...u.arguments??[]),class:void 0,tooltip:u.tooltip??u.title})),{hoverDelegate:yje}):void 0;return Xat([i,s,o,a,r.length?Ole():void 0,l,c,...r,h?Ole():void 0,h])}_getKeybinding(e){return e?Ut(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(e)):Ci(void 0)}};eq=Zat([_6(3,Xe),_6(4,Ht),_6(5,Ei)],eq);function Xat(n){return ht.div({class:"content",style:{margin:4,minWidth:180}},n)}function Qat(n){return ht.div({class:"header",style:{color:pe(ame),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[n])}function ib(n){return oe({name:"inlineEdits.option"},e=>{var t;return ht.div({class:["monaco-menu-option",(t=n.isActive)==null?void 0:t.map(i=>i&&"active")],onmouseenter:()=>{var i;return(i=n.onHoverChange)==null?void 0:i.call(n,!0)},onmouseleave:()=>{var i;return(i=n.onHoverChange)==null?void 0:i.call(n,!1)},onclick:n.onAction,onkeydown:i=>{var s;i.key==="Enter"&&((s=n.onAction)==null||s.call(n))},tabIndex:0,style:{borderRadius:3}},[ht.elem("span",{style:{fontSize:16,display:"flex"}},[Ue.isThemeIcon(n.icon)?eh(n.icon):n.icon.map(i=>eh(i))]),ht.elem("span",{},[n.title]),ht.div({style:{marginLeft:"auto"},ref:i=>{const s=e.store.add(new hx(i,ha,{disableTitle:!0,...ove,keybindingLabelShadow:void 0,keybindingLabelForeground:pe(ame),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));e.store.add(qe(o=>{s.set(n.keybinding.read(o))}))}})])})}function Jat(n,e){return oe({name:"inlineEdits.actionBar"},t=>ht.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[ht.div({ref:i=>{t.store.add(new Vr(i,e)).push(n,{icon:!1,label:!0})}})]))}function Ole(){return ht.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:pe(N7e),padding:"2px 0"}},ht.div({style:{borderBottom:`1px solid ${pe(CY)}`}}))}var elt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q2=function(n,e){return function(t,i){e(t,i,n)}};let tq=class extends G{get model(){const e=this._model.get();if(!e)throw new ze("Inline Edit Model not available");return e}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=s,this._isHoveringOverInlineEdit=o,this._focusIsInMenu=r,this._hoverService=a,this._instantiationService=l,this._accessibilityService=c,this._tabAction=oe(this,h=>{const u=this._model.read(h);return u?u.tabAction.read(h):So.Inactive}),this._hoverVisible=Ze(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Ze(this,!1),this._isHoveredOverIconDebounced=aie(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=aie(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(h,u)=>{switch(h){case So.Inactive:return{background:Dl(HCe,d).read(u).toString(),foreground:Dl(Wat,d).read(u).toString(),border:Dl(WCe,d).read(u).toString()};case So.Jump:return{background:Dl(BCe,d).read(u).toString(),foreground:Dl(Bat,d).read(u).toString(),border:Dl(k0,d).read(u).toString()};case So.Accept:return{background:Dl(zCe,d).read(u).toString(),foreground:Dl(Hat,d).read(u).toString(),border:Dl(VCe,d).read(u).toString()};default:iD()}}),this._originalRangeObs=Iu(this._originalRange),this._state=oe(this,h=>{const u=this._originalRangeObs.read(h);if(u)return{range:u,lineOffsetRange:this._editorObs.observeLineOffsetRange(u,h.store)}}),this._stickyScrollController=Zc.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Ut(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Ci(0),this._lineNumberToRender=oe(this,h=>{var g;if(this._verticalOffset.read(h)!==0)return"";const u=(g=this._originalRange.read(h))==null?void 0:g.startLineNumber,f=this._editorObs.getOption(76).read(h);if(u===void 0||f.renderType===0)return"";if(f.renderType===3){const p=this._editorObs.cursorPosition.read(h);return u%10===0||p&&p.lineNumber===u?u.toString():""}if(f.renderType===2){const p=this._editorObs.cursorPosition.read(h);if(!p)return"";const m=Math.abs(u-p.lineNumber);return m===0?u.toString():m.toString()}return f.renderType===4?f.renderFn?f.renderFn(u):"":u.toString()}),this._availableWidthForIcon=oe(this,h=>{const u=this._editorObs.editor.getModel(),f=this._editorObs.editor,g=this._editorObs.layoutInfo.read(h),p=g.decorationsLeft+g.decorationsWidth-g.glyphMarginLeft;if(!u||p<=0)return()=>0;if(g.lineNumbersLeft===0)return()=>p;const m=this._editorObs.getOption(76).read(h);if(m.renderType===2||m.renderType===0)return()=>p;const b=f.getOption(59).typicalHalfwidthCharacterWidth,v=g.lineNumbersLeft+g.lineNumbersWidth,C=(u.getLineCount()+1).toString().length,S=[];for(let L=1;L<=C;L++){const x=10**(L-1),E=f.getTopForLineNumber(x),I=L*b,R=Math.min(p,Math.max(0,v-I-g.glyphMarginLeft));S.push({firstLineNumberWithDigitCount:x,topOfLineNumber:E,usableWidthLeftOfLineNumber:R})}return L=>{for(let x=S.length-1;x>=0;x--)if(L>=S[x].topOfLineNumber)return S[x].usableWidthLeftOfLineNumber;throw new ze("Could not find avilable width for icon")}}),this._layout=oe(this,h=>{const u=this._state.read(h);if(!u)return;const f=this._editorObs.layoutInfo.read(h),g=this._editorObs.observeLineHeightForLine(u.range.map(te=>te.startLineNumber)).read(h),p=2,m=f.decorationsLeft+f.decorationsWidth-f.glyphMarginLeft-2*p,b=f.height-2*p,v=pi.fromLeftTopWidthHeight(p,p,m,b),w=v.withTop(this._stickyScrollHeight.read(h)),C=v.withTop(w.top+p),S=u.lineOffsetRange.read(h),L=pi.fromRanges(Me.fromTo(C.left,C.right),S),x=g,E=this._verticalOffset.read(h),I=L.withHeight(x).translateY(E),R=w.containsRect(I),M=this._tabAction.map(te=>te===So.Accept?de.keyboardTab:de.arrowRight),A=oe(this,te=>{if(this._isHoveredOverIconDebounced.read(te)||this._isHoveredOverInlineEditDebounced.read(te))return de.check;if(this._tabAction.read(te)===So.Accept)return de.keyboardTab;const ce=this._editorObs.cursorLineNumber.read(te)??0,Ce=u.range.read(te).startLineNumber;return ce<=Ce?de.keyboardTabAbove:de.keyboardTabBelow}),W=22,P=16,B=te=>{const ce=this._availableWidthForIcon.read(void 0)(te.bottom+this._editorObs.editor.getScrollTop())-p;return Math.max(Math.min(ce,W),P)};if(R){const te=I;let ce;f.lineNumbersWidth===0?ce=Math.min(Math.max(f.lineNumbersLeft-v.left,0),te.width-W):ce=Math.max(f.lineNumbersLeft+f.lineNumbersWidth-v.left,0);const Ce=te.withWidth(ce),xe=Math.max(Math.min(f.decorationsWidth,W),P),je=te.withWidth(xe).translateX(ce);return{gutterEditArea:L,icon:A,iconDirection:"right",iconRect:je,pillRect:te,lineNumberRect:Ce}}const V=v.intersect(L);if(V&&V.height>=x){const te=I.moveToBeContainedIn(C).moveToBeContainedIn(V),ce=te.withWidth(B(te));return{gutterEditArea:L,icon:A,iconDirection:"right",iconRect:ce,pillRect:ce}}const z=I.moveToBeContainedIn(v),j=z.withWidth(B(z)),Q=j,Y=j.top!!h),this._indicator=ht.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const h=this._layout.get(),u=(h==null?void 0:h.icon.get())===de.check;this._editorObs.editor.focus(),u?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},Iu(this._layout).map(h=>h?[ht.div({style:{position:"absolute",background:pe(Vat),borderRadius:"4px",...ql(u=>h.read(u).gutterEditArea)}}),ht.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(u=>u.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(u=>u.foreground),border:this._gutterIndicatorStyles.map(u=>`1px solid ${u.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...ql(u=>h.read(u).pillRect)}},[ht.div({className:"line-number",style:{lineHeight:h.map(u=>u.lineNumberRect?u.lineNumberRect.height:0),display:h.map(u=>u.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:h.map(u=>u.lineNumberRect?u.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(u=>u.foreground)}},this._lineNumberToRender),ht.div({style:{rotate:h.map(u=>`${tlt(u.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:h.map(u=>{var f;return u.pillRect.width-u.iconRect.width-(((f=u.lineNumberRect)==null?void 0:f.width)??0)}),width:h.map(u=>u.iconRect.width)}},[h.map((u,f)=>eh(u.icon.read(f)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:Ci(0)})),this._register(this._editorObs.editor.onMouseMove(h=>{if(this._state.get()===void 0)return;const g=this._iconRef.element.getBoundingClientRect(),p=pi.fromLeftTopWidthHeight(g.left,g.top,g.width,g.height),m=new bs(h.event.posx,h.event.posy);this._isHoveredOverIcon.set(p.containsPoint(m),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(Kd(this._isHoveredOverInlineEditDebounced,h=>{h&&this.triggerAnimation()})),this._register(qe(h=>{this._indicator.readEffect(h),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(t=>t.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const e=new ne,t=e.add(this._instantiationService.createInstance(eq,this.model,o=>{o&&this._editorObs.editor.focus(),s==null||s.dispose()},this._editorObs).toDisposableLiveElement()),i=e.add(oc(t.element));e.add(i.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),e.add(i.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),e.add(Re(()=>this._focusIsInMenu.set(!1,void 0)));const s=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});s?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange(()=>s.dispose())),e.add(s.onDispose(()=>{this._hoverVisible.set(!1,void 0),e.dispose()}))):e.dispose()}};tq=elt([q2(6,Cr),q2(7,Ae),q2(8,Us),q2(9,en)],tq);function tlt(n){switch(n){case"top":return 90;case"bottom":return-90;case"right":return 0}}var ilt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Fle=function(n,e){return function(t,i){e(t,i,n)}},Fa;(function(n){n.FirstTime="firstTime",n.SecondTime="secondTime",n.Active="active"})(Fa||(Fa={}));let iq=class extends G{constructor(e,t,i,s,o,r){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=s,this._storageService=o,this._configurationService=r,this._disposables=this._register(new Kt),this._setupDone=Ze({name:"setupDone"},!1),this._activeCompletionId=oe(a=>{const l=this._model.read(a);if(!l||!this._setupDone.read(a))return;const c=this._indicator.read(a);if(!(!c||!c.isVisible.read(a)))return l.inlineEdit.inlineCompletion.identity.id}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===Fa.Active)return;const e=new ne;let t=!1,i=!1,s=0,o=0;return e.add(nWe(this._activeCompletionId,async(r,a,l,c)=>{var h,u;if(r===void 0)return;let d=this.getNewUserType();switch(d){case Fa.FirstTime:{(s++>=5||t)&&(d=Fa.SecondTime,this.setNewUserType(d));break}case Fa.SecondTime:{o++>=3&&i&&(d=Fa.Active,this.setNewUserType(d));break}}switch(d){case Fa.FirstTime:{for(let f=0;f<3&&!c.isCancellationRequested;f++)await((h=this._indicator.get())==null?void 0:h.triggerAnimation()),await vu(500);break}case Fa.SecondTime:{(u=this._indicator.get())==null||u.triggerAnimation();break}}})),e.add(qe(r=>{this._collapsedView.isVisible.read(r)&&this.getNewUserType()!==Fa.Active&&this._collapsedView.triggerAnimation()})),e.add(Eo((r,a)=>{const l=this._indicator.read(r);l&&a.add(Kd(l.isHoveredOverIcon,async c=>{c&&(t=!0)}))})),e.add(Eo((r,a)=>{const l=this._host.read(r);l&&a.add(l.onDidAccept(()=>{i=!0}))})),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,Fa.FirstTime)}setNewUserType(e){switch(e){case Fa.FirstTime:throw new ze("UserKind should not be set to first time");case Fa.SecondTime:break;case Fa.Active:this._disposables.clear();break}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}};iq=ilt([Fle(4,Qo),Fle(5,lt)],iq);var nlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},slt=function(n,e){return function(t,i){e(t,i,n)}};let nq=class extends G{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._iconRef=ht.ref(),this.isHovered=Ci(!1),this._editorObs=Ui(this._editor);const o=this._edit.map(c=>(c==null?void 0:c.edit.replacements[0])??null).map(c=>c?Gf(c,this._editor.getModel()).range.getStartPosition():null),r=this._editorObs.observePosition(o,this._store),a=oe(c=>{const d=r.read(c);if(!d)return null;const h=this._editorObs.layoutInfoContentLeft.read(c),u=this._editorObs.scrollLeft.read(c);return new bs(h+d.x-u,d.y)}),l=ht.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(a)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:l,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:Ci(0)})),this.isVisible=this._edit.map((c,d)=>!!c&&a.read(d)!==null)}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map((o,r)=>o?o.deltaX(-t.read(r)):null),s=this.createIconPath(i);return ht.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...ql(o=>JX(this._editorObs).read(o)),overflow:"hidden",pointerEvents:"none"}},[ht.svgElem("path",{class:"collapsedViewPath",d:s,fill:pe(k0)})])}createIconPath(e){return e.map(o=>{if(!o)return new JU().build();const r=o.deltaX(-6/2).deltaY(-1),a=r.deltaX(6),l=r.deltaY(1),c=a.deltaY(1),d=l.deltaX(6/2).deltaY(3);return new JU().moveTo(r).lineTo(a).lineTo(c).lineTo(d).lineTo(l).lineTo(r).build()})}};nq=nlt([slt(2,Us)],nq);var olt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ble=function(n,e){return function(t,i){e(t,i,n)}};const K2=14,b6=0,ef=4,G2=4,Wle=2;let sq=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._languageService=o,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._isHovered=Ze(this,!1),this.isHovered=this._isHovered,this._viewRef=ht.ref(),this._editorObs=Ui(this._editor);const r=i.map((d,h)=>{let u;switch(d){case So.Inactive:u=HCe;break;case So.Jump:u=BCe;break;case So.Accept:u=zCe;break}return{border:Dl(u,s).read(h).toString(),background:pe(Ln)}}),a=t.map(d=>d?this.getState(d):void 0),l=a.map(d=>d?this.getRendering(d,r):void 0);this.minEditorScrollHeight=oe(this,d=>{const h=a.read(d);return h?h.rect.read(d).bottom+this._editor.getScrollTop():0});const c=ht.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[l]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:c.element,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:Hg(this,(d,h)=>{const u=a.read(d);if(!u)return h??0;const f=u.rect.map(g=>g.right).read(d)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(d)+ef-this._editorObs.layoutInfoContentLeft.read(d);return Math.max(h??0,f)}).recomputeInitiallyAndOnChange(this._store)})),this._register(qe(d=>{if(!l.read(d)){this._isHovered.set(!1,void 0);return}this._isHovered.set(c.isHovered.read(d),void 0)}))}fitsInsideViewport(e,t,i){const s=this._editorObs.layoutInfoWidth.read(i),o=this._editorObs.layoutInfoContentLeft.read(i),r=this._editor.getLayoutInfo().verticalScrollbarWidth,a=this._editorObs.layoutInfoMinimap.read(i).minimapLeft!==0?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0,l=dm(this._editorObs,e,void 0),c=QX(t,this._editor,this._editor.getModel()),d=ef+K2;return l+c+d{var v;const l=e.range.startLineNumber,c=e.range.endLineNumber,d=e.range.startColumn,h=e.range.endColumn,u=((v=this._editor.getModel())==null?void 0:v.getLineCount())??0,f=dm(this._editorObs,new Ye(l,l+1),a),g=l+1<=u?dm(this._editorObs,new Ye(l+1,l+2),a):void 0,p=l-1>=1?dm(this._editorObs,new Ye(l-1,l),a):void 0,m=this._editor.getOffsetForColumn(l,d),b=this._editor.getOffsetForColumn(c,h);return{lineWidth:f,lineWidthBelow:g,lineWidthAbove:p,startContentLeftOffset:m,endContentLeftOffset:b}}),i=e.range.startLineNumber,s=e.range.endLineNumber,o=this.fitsInsideViewport(new Ye(i,s+1),e.content,void 0);return{rect:oe(this,a=>{const l=this._editorObs.getOption(59).read(a).typicalHalfwidthCharacterWidth,{lineWidth:c,lineWidthBelow:d,lineWidthAbove:h,startContentLeftOffset:u,endContentLeftOffset:f}=t.read(a),g=this._editorObs.layoutInfoContentLeft.read(a),p=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(a.store).read(a),m=this._editorObs.scrollTop.read(a),b=this._editorObs.scrollLeft.read(a);let v;i===s&&f+5*l>=c&&o?v="end":d!==void 0&&d+K2-G2-efc.withMargin(0,ef));return ht.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...ql(c=>a.read(c)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map(c=>`1px solid ${c.border}`),borderRadius:"4px",backgroundColor:t.map(c=>c.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new ao(Oe(c),c))}},[i])}};sq=olt([Ble(3,en),Ble(4,un)],sq);const rlt=0,alt=0,v6=1,llt=1,clt=3,w6=4;class dlt extends G{constructor(e,t,i,s){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=s,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._display=oe(this,a=>this._uiState.read(a)?"block":"none"),this._editorMaxContentWidthInRange=oe(this,a=>{const l=this._originalDisplayRange.read(a);return l?(this._editorObs.versionId.read(a),Hg(this,(c,d)=>{const h=dm(this._editorObs,l,c);return Math.max(h,d??0)})):Ci(0)}).map((a,l)=>a.read(l)),this._maxPrefixTrim=oe(this,a=>{const l=this._uiState.read(a);return l?XX(l.deletions,l.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=oe(this,a=>{const l=this._edit.read(a);if(!l||!this._uiState.read(a))return null;const d=this._editorObs.layoutInfo.read(a),h=this._editorObs.scrollLeft.read(a),u=this._editorObs.getOption(59).map(w=>w.typicalHalfwidthCharacterWidth).read(a),f=d.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(a),u)-h,g=l.originalLineRange,p=this._originalVerticalStartPosition.read(a)??this._editor.getTopForLineNumber(g.startLineNumber)-this._editorObs.scrollTop.read(a),m=this._originalVerticalEndPosition.read(a)??this._editor.getTopForLineNumber(g.endLineNumberExclusive)-this._editorObs.scrollTop.read(a),b=d.contentLeft+this._maxPrefixTrim.read(a).prefixLeftOffset-h;return f<=b?null:{codeRect:pi.fromLeftTopRightBottom(b,p,f,m).withMargin(alt,rlt),contentLeft:d.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,a=>{const l=Iu(this._editorLayoutInfo).read(a);if(!l)return;const c=l.map(f=>pi.fromLeftTopRightBottom(f.contentLeft-w6-v6,f.codeRect.top,f.contentLeft,f.codeRect.bottom)),d=oe(this,f=>{const g=l.read(f).codeRect,p=c.read(f);return g.intersectHorizontal(new Me(p.left,Number.MAX_SAFE_INTEGER))}),h=this._uiState.map(f=>f!=null&&f.inDiffEditor?clt:llt).read(a),u=d.map(f=>f.withMargin(h,h));return[ht.div({class:"originalSeparatorDeletion",style:{...u.read(a).toStyles(),borderRadius:`${w6}px`,border:`${v6+h}px solid ${pe(Ln)}`,boxSizing:"border-box"}}),ht.div({class:"originalOverlayDeletion",style:{...d.read(a).toStyles(),borderRadius:`${w6}px`,border:a8(this._tabAction).map(f=>`${v6}px solid ${pe(f)}`),boxSizing:"border-box",backgroundColor:pe(tE)}}),ht.div({class:"originalOverlayHiderDeletion",style:{...c.read(a).toStyles(),backgroundColor:pe(Ln)}})]})).keepUpdated(this._store),this._nonOverflowView=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=Ci(!1),this._editorObs=Ui(this._editor);const o=oe(this,a=>{const l=this._edit.read(a);return l?new U(l.originalLineRange.startLineNumber,1):null}),r=oe(this,a=>{const l=this._edit.read(a);return l?new U(l.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(a=>a==null?void 0:a.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(o,this._store).map(a=>a==null?void 0:a.y),this._originalVerticalEndPosition=this._editorObs.observePosition(r,this._store).map(a=>a==null?void 0:a.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,a=>{const l=this._editorLayoutInfo.read(a);return l===null?0:l.codeRect.width})}))}}var hlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hle=function(n,e){return function(t,i){e(t,i,n)}};const mL=1,ult=1,flt=3,C6=4;let oq=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=o,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._state=oe(this,r=>{const a=this._input.read(r);if(!a)return;const l=this._editor.getModel(),c=l.getEOL();if(a.startColumn===1&&a.lineNumber>1&&l.getLineLength(a.lineNumber)!==0&&a.text.endsWith(c)&&!a.text.startsWith(c)){const d=l.getLineLength(a.lineNumber-1)+1;return{lineNumber:a.lineNumber-1,column:d,text:c+a.text.slice(0,-c.length)}}return{lineNumber:a.lineNumber,column:a.startColumn,text:a.text}}),this._trimVertically=oe(this,r=>{const a=this._state.read(r),l=a==null?void 0:a.text;if(!l||l.trim()==="")return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const c=this._editor.getLineHeightForPosition(new U(a.lineNumber,1)),d=this._editor.getModel().getEOL();let h=0,u=0,f=0;for(;ff&&l.endsWith(d,g);g-=d.length)u+=1;return{topOffset:h*c,bottomOffset:u*c,linesTop:h,linesBottom:u}}),this._maxPrefixTrim=oe(this,r=>{const a=this._state.read(r);if(!a)return{prefixLeftOffset:0,prefixTrim:0};const l=this._editor.getModel(),c=l.getEOL(),d=this._trimVertically.read(r),h=a.text.split(c),u=h.slice(d.linesTop,h.length-d.linesBottom);d.linesTop===0&&(u[0]=l.getLineContent(a.lineNumber)+u[0]);const f=new Ye(a.lineNumber,a.lineNumber+(d.linesTop>0?0:1));return XX([],f,u,this._editor)}),this._ghostText=oe(r=>{const a=this._state.read(r),l=this._maxPrefixTrim.read(r);if(!a)return;const d=this._editor.getModel().getEOL(),u=a.text.split(d).map((f,g)=>new Ov(new D(g+1,g===0?1:l.prefixTrim+1,g+1,f.length+1),"modified-background",0));return new EN(a.lineNumber,[new FO(a.column,a.text,!1,u)])}),this._display=oe(this,r=>this._state.read(r)?"block":"none"),this._editorMaxContentWidthInRange=oe(this,r=>{const a=this._state.read(r);if(!a)return 0;this._editorObs.versionId.read(r);const l=this._editor.getModel(),c=l.getEOL(),d=a.text.startsWith(c)?"":l.getValueInRange(new D(a.lineNumber,1,a.lineNumber,a.column)),h=l.getValueInRange(new D(a.lineNumber,a.column,a.lineNumber,l.getLineLength(a.lineNumber)+1)),f=(d+a.text+h).split(c),g=hg.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p=f.map(m=>{var w;const b=(w=l.tokenization.tokenizeLinesAt(a.lineNumber,[m]))==null?void 0:w[0];let v;return b?v=rg.fromLineTokens(b).toLineTokens(m,this._languageService.languageIdCodec):v=vn.createEmpty(m,this._languageService.languageIdCodec),MD(new AD([v]),g,[],me("div"),!0).minWidthInPx});return Math.max(...p)}),this.startLineOffset=this._trimVertically.map(r=>r.topOffset),this.originalLines=this._state.map(r=>r?new Ye(r.lineNumber,Math.min(r.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=oe(this,r=>{this._ghostText.read(r);const a=this._state.read(r);if(!a)return null;this._editorObs.observePosition(Ze(this,new U(a.lineNumber,a.column)),r.store).read(r);const l=this._editorObs.layoutInfo.read(r),c=this._editorObs.scrollLeft.read(r),d=this._editorObs.layoutInfoVerticalScrollbarWidth.read(r),h=l.contentLeft+this._editorMaxContentWidthInRange.read(r)-c,u=this._maxPrefixTrim.read(r).prefixLeftOffset??0,f=l.contentLeft+u-c;if(h<=f)return null;const{topOffset:g,bottomOffset:p}=this._trimVertically.read(r),m=this._editorObs.scrollTop.read(r),b=this._ghostTextView.height.read(r)-g-p,v=this._editor.getTopForLineNumber(a.lineNumber)-m+g,w=v+b,C=new pi(f,v,h,w);return{overlay:C,startsAtContentLeft:u===0,contentLeft:l.contentLeft,minContentWidthRequired:u+C.width+d}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,r=>{const a=Iu(this._overlayLayout).read(r);if(!a)return;const l=a.map(u=>pi.fromLeftTopRightBottom(u.contentLeft-C6-mL,u.overlay.top,u.contentLeft,u.overlay.bottom)).read(r),c=this._input.map(u=>u!=null&&u.inDiffEditor?flt:ult).read(r),d=a.map(u=>u.overlay.withMargin(0,mL,0,u.startsAtContentLeft?0:mL).intersectHorizontal(new Me(l.left,Number.MAX_SAFE_INTEGER))),h=d.map(u=>u.withMargin(c,c));return[ht.div({class:"originalUnderlayInsertion",style:{...h.read(r).toStyles(),borderRadius:C6,border:`${mL+c}px solid ${pe(Ln)}`,boxSizing:"border-box"}}),ht.div({class:"originalOverlayInsertion",style:{...d.read(r).toStyles(),borderRadius:C6,border:TN(this._tabAction).map(u=>`${mL}px solid ${pe(u)}`),boxSizing:"border-box",backgroundColor:pe(FCe)}}),ht.div({class:"originalOverlayHiderInsertion",style:{...l.toStyles(),backgroundColor:pe(Ln)}})]})).keepUpdated(this._store),this._view=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=Ui(this._editor),this._ghostTextView=this._register(s.createInstance(NN,this._editor,{ghostText:this._ghostText,minReservedLineCount:Ci(0),targetTextModel:this._editorObs.model.map(r=>r??void 0),warning:Ci(void 0),handleInlineCompletionShown:Ci(()=>{})},Ze(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(r=>{this._onDidClick.fire(r)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,r=>{const a=this._overlayLayout.read(r);return a===null?0:a.minContentWidthRequired})}))}};oq=hlt([Hle(3,Ae),Hle(4,un)],oq);var glt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vle=function(n,e){return function(t,i){e(t,i,n)}};let rq=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=s,this._languageService=o,this._themeService=r,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((a,l)=>a?XX(a.replacements.flatMap(c=>[c.originalRange,c.modifiedRange]),a.originalRange,a.modifiedLines,this._editor.editor,l):void 0),this._modifiedLineElements=oe(this,a=>{var m;const l=[];let c=0;const d=this._maxPrefixTrim.read(a),h=this._edit.read(a);if(!h||!d)return;const u=d.prefixTrim,f=plt(h.replacements.map(b=>b.modifiedRange)).map(b=>new D(b.startLineNumber,b.startColumn-u,b.endLineNumber,b.endColumn-u)),g=this._editor.model.get(),p=h.modifiedRange.startLineNumber;for(let b=0;bR.startLineNumber===w)){const R=Math.min(I.endColumn,C.length+1);x.push(new Ov(new D(1,I.startColumn,1,R),"inlineCompletions-modified-bubble",0))}const E=MD(new AD([L]),hg.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),x,v,!0);this._editor.getOption(59).read(a),c=Math.max(c,E.minWidthInPx),l.push(v)}return{lines:l,requiredWidth:c}}),this._layout=oe(this,a=>{const l=this._modifiedLineElements.read(a),c=this._maxPrefixTrim.read(a),d=this._edit.read(a);if(!l||!c||!d)return;const{prefixLeftOffset:h}=c,{requiredWidth:u}=l,f=this._editor.observeLineHeightsForLineRange(d.originalRange).read(a),g=(()=>{const V=f.slice(0,d.modifiedRange.length);for(;V.lengththis._editor.editor.getOffsetForColumn(V,C.getLineMaxColumn(V))-h),L=Math.max(...S,u),x=d.originalRange.startLineNumber,E=d.originalRange.endLineNumberExclusive-1,I=this._editor.editor.getTopForLineNumber(x)-v,R=this._editor.editor.getBottomForLineNumber(E)-v,M=pi.fromLeftTopWidthHeight(w+h,I,L,R-I),A=pi.fromLeftTopWidthHeight(M.left,M.bottom,M.width,g.reduce((V,K)=>V+K,0)),W=pi.hull([M,A]),P=W.intersectVertical(new Me(M.bottom,Number.MAX_SAFE_INTEGER)),B=new pi(P.left,P.top,P.right,P.bottom);return{originalLinesOverlay:M,modifiedLinesOverlay:A,background:W,lowerBackground:P,lowerText:B,modifiedLineHeights:g,minContentWidthRequired:h+L+m}}),this._viewZoneInfo=oe(a=>{if(!this._editor.getOption(71).map(f=>f.edits.allowCodeShifting==="always").read(a))return;const c=this._layout.read(a),d=this._edit.read(a);if(!c||!d)return;const h=c.lowerBackground.height,u=d.originalRange.endLineNumberExclusive;return{height:h,lineNumber:u}}),this.minEditorScrollHeight=oe(this,a=>{const l=Iu(this._layout).read(a);return!l||this._viewZoneInfo.read(a)!==void 0?0:l.read(a).lowerText.bottom+this._editor.editor.getScrollTop()}),this._div=ht.div({class:"line-replacement"},[oe(this,a=>{const l=Iu(this._layout).read(a),c=this._modifiedLineElements.read(a);if(!l||!c)return[];const d=l.read(a),h=this._editor.layoutInfoContentLeft.read(a),u=this._isInDiffEditor.read(a)?3:1;c.lines.forEach((p,m)=>{p.style.width=`${d.lowerText.width}px`,p.style.height=`${d.modifiedLineHeights[m]}px`,p.style.position="relative"});const f=TN(this._tabAction).read(a),g=a8(this._tabAction).read(a);return[ht.div({style:{position:"absolute",...ql(p=>JX(this._editor).read(p)),overflow:"hidden",pointerEvents:"none"}},[ht.div({class:"borderAroundLineReplacement",style:{position:"absolute",...ql(p=>l.read(p).background.translateX(-h).withMargin(u)),borderRadius:"4px",border:`${u+1}px solid ${pe(Ln)}`,boxSizing:"border-box",pointerEvents:"none"}}),ht.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...ql(p=>l.read(p).background.translateX(-h)),borderRadius:"4px",border:Dl(g,this._themeService).map(p=>`1px solid ${p.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:pe(tE)}}),ht.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...ql(p=>l.read(p).lowerBackground.translateX(-h)),borderRadius:"0 0 4px 4px",background:pe(Ln),boxShadow:`${pe(l3)} 0 6px 6px -6px`,border:`1px solid ${pe(f)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:p=>{p.preventDefault()},onclick:p=>this._onDidClick.fire(new ao(Oe(p),p))},[ht.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:pe(Oat)}})]),ht.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...ql(p=>l.read(p).lowerText.translateX(-h)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...c.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(a=>this._isMouseOverWidget(a),this._store),this._previousViewZoneInfo=void 0,this._register(Re(()=>this._editor.editor.changeViewZones(a=>this.removePreviousViewZone(a)))),this._register(MOe(this._viewZoneInfo,({lastValue:a,newValue:l})=>{a===l||(a==null?void 0:a.height)===(l==null?void 0:l.height)&&(a==null?void 0:a.lineNumber)===(l==null?void 0:l.lineNumber)||this._editor.editor.changeViewZones(c=>{this.removePreviousViewZone(c),l&&this.addViewZone(l,c)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:oe(this,a=>{var l;return((l=this._layout.read(a))==null?void 0:l.minContentWidthRequired)??0}),position:Ci({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!t||!(e.event instanceof Ig)?!1:t.lowerBackground.containsPoint(new bs(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();t!==null&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:me("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const s=this._editor.cursorLineNumber.get();s!==null&&s>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}};rq=glt([Vle(4,un),Vle(5,en)],rq);function plt(n){const e=[];for(;n.length;){let t=n.shift();t.startLineNumber!==t.endLineNumber&&(n.push(new D(t.startLineNumber+1,1,t.endLineNumber,t.endColumn)),t=new D(t.startLineNumber,t.startColumn,t.startLineNumber,Number.MAX_SAFE_INTEGER)),e.push(t)}return e}var mlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zle=function(n,e){return function(t,i){e(t,i,n)}};const MC=0,_L=0,dd=1,_lt=1,blt=3,tf=4,y6=20,jle=12;let KO=class extends G{static fitsInsideViewport(e,t,i,s){const o=Ui(e),r=o.layoutInfoWidth.read(s),a=o.layoutInfoContentLeft.read(s),l=e.getLayoutInfo().verticalScrollbarWidth,c=o.layoutInfoMinimap.read(s).minimapLeft!==0?o.layoutInfoMinimap.read(s).minimapWidth:0,d=dm(o,i.displayRange,void 0),h=i.lineEdit.newLines.reduce((g,p)=>Math.max(g,QX(p,e,t)),0),u=y6,f=jle+2*dd;return d+h+u+fthis._uiState.read(c)?"block":"none"),this.previewRef=ht.ref();const l=this._uiState.map(c=>c!=null&&c.isInDiffEditor?blt:_lt);this._editorContainer=ht.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new ao(Oe(c),c))}},[ht.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(Pg,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[hi.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=Ui(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=oe(this,c=>{this._editorContainer.readEffect(c),this._previewEditorObs.model.read(c),this._display.read(c),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(c));const d=this._uiState.read(c),h=this._edit.read(c);if(!d||!h)return;const u=h.originalLineRange,f=[];u.startLineNumber>1&&f.push(new D(1,1,u.startLineNumber-1,1)),u.startLineNumber+d.newTextLineCount{g.forEach(b=>m.removeZone(b)),p>0&&this._activeViewZones.push(m.addZone({afterLineNumber:u.startLineNumber+d.newTextLineCount-1,heightInLines:p,showInHiddenAreas:!0,domNode:me("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=oe(this,c=>{const d=this._edit.read(c);return d?(this._updatePreviewEditor.read(c),dm(this._previewEditorObs,d.modifiedLineRange,c)):0}),this._cursorPosIfTouchesEdit=oe(this,c=>{const d=this._editorObs.cursorPosition.read(c),h=this._edit.read(c);if(!(!h||!d))return h.modifiedLineRange.contains(d.lineNumber)?d:void 0}),this._originalStartPosition=oe(this,c=>{const d=this._edit.read(c);return d?new U(d.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=oe(this,c=>{const d=this._edit.read(c);return d?new U(d.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(c=>c==null?void 0:c.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(c=>c==null?void 0:c.y),this._originalDisplayRange=this._edit.map(c=>c==null?void 0:c.displayRange),this._editorMaxContentWidthInRange=oe(this,c=>{const d=this._originalDisplayRange.read(c);return d?(this._editorObs.versionId.read(c),Hg(this,(h,u)=>{const f=dm(this._editorObs,d,h);return Math.max(f,u??0)})):Ci(0)}).map((c,d)=>c.read(d)),this._previewEditorLayoutInfo=oe(this,c=>{const d=this._edit.read(c);if(!d||!this._uiState.read(c))return null;const u=d.originalLineRange,f=this._editorObs.scrollLeft.read(c),g=this._editorMaxContentWidthInRange.read(c),p=this._editorObs.layoutInfo.read(c),m=this._previewEditorWidth.read(c),b=p.contentWidth-p.verticalScrollbarWidth,v=this._editor.getContainerDomNode().getBoundingClientRect(),w=p.contentLeft+p.contentWidth+v.left,C=Oe(this._editor.getContainerDomNode()).innerWidth-w,S=Oe(this._editor.getContainerDomNode()).innerWidth-v.right,L=Math.min(p.contentWidth*.3,m,100),x=0,E=x+C,I=this._cursorPosIfTouchesEdit.read(c),R=Math.max(b+f-x-Math.max(0,L-E),Math.min(I?$at(this._editorObs,I,c)+50:0,b+f)),M=Math.min(g+y6,R),A=g+y6+m+70,W=R-M;let P,B;M>f?(P=0,B=p.contentLeft+M-f):(P=f-M,B=p.contentLeft);const V=this._originalVerticalStartPosition.read(c)??this._editor.getTopForLineNumber(u.startLineNumber)-this._editorObs.scrollTop.read(c),K=this._originalVerticalEndPosition.read(c)??this._editor.getBottomForLineNumber(u.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(c),z=p.contentLeft-f;let j=pi.fromLeftTopRightBottom(z,V,B,K);const Q=j.height===0;Q||(j=j.withMargin(_L,MC));const te=this._previewEditorObs.observeLineHeightsForLineRange(d.modifiedLineRange).read(c).reduce((Ve,ct)=>Ve+ct,0),ce=K-V,Ce=Math.max(ce,te),xe=W===0,je=0,ke=Math.min(m+jle,S+p.width-p.contentLeft-je);let Le=pi.fromLeftTopWidthHeight(j.right+je,V,ke,Ce);return Q?Le=Le.withMargin(_L,MC).translateY(_L):Le=Le.withMargin(_L,MC).translateX(MC+dd),{codeRect:j,editRect:Le,codeScrollLeft:f,contentLeft:p.contentLeft,isInsertion:Q,maxContentWidth:A,shouldShowShadow:xe,desiredPreviewEditorScrollLeft:P,previewEditorWidth:ke}}),this._stickyScrollController=Zc.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?Ut(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):Ci(0),this._shouldOverflow=oe(this,c=>!1),this._originalBackgroundColor=Ut(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(tE)??se.transparent),this._backgroundSvg=ht.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[ht.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:oe(this,c=>{const d=this._previewEditorLayoutInfo.read(c);if(!(!d||this._originalBackgroundColor.read(c).isTransparent()))return new JU().moveTo(d.codeRect.getRightTop()).lineTo(d.codeRect.getRightTop().deltaX(1e3)).lineTo(d.codeRect.getRightBottom().deltaX(1e3)).lineTo(d.codeRect.getRightBottom()).build()}),style:{fill:nme(Ln,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=ht.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(c=>c!=null&&c.isInsertion?"none":"block")}},oe(this,c=>{const d=Iu(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=l.read(c),u=a8(this._tabAction).map(L=>`${dd}px solid ${pe(L)}`),f=`${dd+h}px solid ${pe(Ln)}`,g=d.read(c).codeScrollLeft!==0,p=d.map(L=>L.codeRect.bottompi.fromLeftTopRightBottom(L.contentLeft-tf-dd,L.codeRect.top,L.contentLeft,L.codeRect.bottom+m)).read(c),v=new Me(b.left,Number.MAX_SAFE_INTEGER),w=d.map(L=>L.codeRect.intersectHorizontal(v)),C=w.map(L=>L.withMargin(h,0,h,h).intersectHorizontal(v)),S=w.map(L=>pi.fromLeftTopWidthHeight(L.right-m+dd,L.bottom-dd,m,m).intersectHorizontal(v));return[ht.div({class:"originalSeparatorSideBySide",style:{...C.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${tf}px 0 0 ${tf}px`,borderTop:f,borderBottom:f,borderLeft:g?"none":f}}),ht.div({class:"originalOverlaySideBySide",style:{...w.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${tf}px 0 0 ${tf}px`,borderTop:u,borderBottom:u,borderLeft:g?"none":u,backgroundColor:pe(tE)}}),ht.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:p.map(L=>L?"block":"none"),...S.read(c).toStyles()}},[ht.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:Dl(tE,this._themeService).map(L=>L.toString())}}),ht.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:u,borderRight:u,borderRadius:"0 100% 0 0",backgroundColor:pe(Ln)}})]),ht.div({class:"originalOverlaySideBySideHider",style:{...b.toStyles(),backgroundColor:pe(Ln)}})]})).keepUpdated(this._store),this._modifiedOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,c=>{const d=Iu(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=d.map(w=>w.codeRect.bottom`0 ${tf}px ${tf}px ${w?tf:0}px`),g=Dl(TN(this._tabAction),this._themeService).map(w=>`1px solid ${w.toString()}`),p=`${dd+u}px solid ${pe(Ln)}`,m=d.map(w=>w.editRect.withMargin(0,dd)),b=m.map(w=>w.withMargin(u,u,u,0)),v=oe(this,w=>{const C=m.read(w),S=d.read(w);return!S.isInsertion||S.contentLeft>=C.left?pi.fromLeftTopWidthHeight(C.left,C.top,0,0):new pi(S.contentLeft,C.top,C.left,C.top+dd*2)});return[ht.div({class:"modifiedInsertionSideBySide",style:{...v.read(c).toStyles(),backgroundColor:TN(this._tabAction).map(w=>pe(w))}}),ht.div({class:"modifiedSeparatorSideBySide",style:{...b.read(c).toStyles(),borderRadius:f,borderTop:p,borderBottom:p,borderRight:p,boxSizing:"border-box"}}),ht.div({class:"modifiedOverlaySideBySide",style:{...m.read(c).toStyles(),borderRadius:f,border:g,boxSizing:"border-box",backgroundColor:pe(FCe)}})]})).keepUpdated(this._store),this._nonOverflowView=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,oe(this,c=>this._shouldOverflow.read(c)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:Ci(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,c=>{var h;const d=(h=this._previewEditorLayoutInfo.read(c))==null?void 0:h.maxContentWidth;return d===void 0?0:d})})),this.previewEditor.setModel(this._previewTextModel),this._register(qe(c=>{const d=this._previewEditorLayoutInfo.read(c);if(!d)return;const h=d.editRect.withMargin(-_L,-MC);this.previewEditor.layout({height:h.height,width:d.previewEditorWidth+15}),this._editorContainer.element.style.top=`${h.top}px`,this._editorContainer.element.style.left=`${h.left}px`,this._editorContainer.element.style.width=`${d.previewEditorWidth+MC}px`})),this._register(qe(c=>{const d=this._previewEditorLayoutInfo.read(c);d&&this._previewEditorObs.editor.setScrollLeft(d.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};KO=mlt([zle(5,Ae),zle(6,en)],KO);var vlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wlt=function(n,e){return function(t,i){e(t,i,n)}};const nf=1;var Ay;let E0=(Ay=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=s,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(Ci(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(Ci(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Ze(this,null),this.isHovered=this._hoverableElement.map((r,a)=>(r==null?void 0:r.didMouseMoveDuringHover.read(a))??!1),this._renderTextEffect=oe(this,r=>{var g;const a=this._editor.model.get(),l=a.getLineContent(this._edit.range.startLineNumber),c=zs.replace(new Me(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),d=c.replace(l),h=(g=a.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[d]))==null?void 0:g[0];let u;h?u=rg.fromLineTokens(h).slice(c.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):u=vn.createEmpty(this._edit.text,this._languageService.languageIdCodec);const f=MD(new AD([u]),hg.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${f.minWidthInPx}px`});const o=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=oe(this,r=>{this._renderTextEffect.read(r);const a=this._start.read(r),l=this._end.read(r);if(!a||!l||a.x>l.x||a.y>l.y)return;const c=o.read(r),d=this._editor.scrollLeft.read(r),h=this._editor.getOption(59).read(r).typicalHalfwidthCharacterWidth,u=3*h,f=4,g=new bs(u,f),p=pi.fromPoints(a,l).withHeight(c).translateX(-d),m=pi.fromPointSize(p.getLeftBottom().add(g),new bs(this._edit.text.length*h,p.height)),b=m.withLeft(p.left);return{originalLine:p,modifiedLine:m,lowerBackground:b,lineHeight:c}}),this.minEditorScrollHeight=oe(this,r=>{const a=Iu(this._layout).read(r);return a?a.read(r).modifiedLine.bottom+nf+this._editor.editor.getScrollTop():0}),this._root=ht.div({class:"word-replacement"},[oe(this,r=>{const a=Iu(this._layout).read(r);if(!a)return[];const l=a8(this._tabAction).map(d=>pe(d)).read(r),c=TN(this._tabAction).map(d=>pe(d)).read(r);return[ht.div({style:{position:"absolute",...ql(d=>JX(this._editor).read(d)),overflow:"hidden",pointerEvents:"none"}},[ht.div({style:{position:"absolute",...ql(d=>a.read(d).lowerBackground.withMargin(nf,2*nf,nf,0)),background:pe(Ln),cursor:"pointer",pointerEvents:"auto"},onmousedown:d=>{d.preventDefault()},onmouseup:d=>this._onDidClick.fire(new ao(Oe(d),d)),obsRef:d=>{this._hoverableElement.set(d,void 0)}}),ht.div({style:{position:"absolute",...ql(d=>a.read(d).modifiedLine.withMargin(nf,2*nf)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`${nf}px solid ${c}`,background:pe(Fat),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${pe(Ln)}`}},[this._line]),ht.div({style:{position:"absolute",...ql(d=>a.read(d).originalLine.withMargin(nf)),boxSizing:"border-box",borderRadius:"4px",border:`${nf}px solid ${l}`,background:pe(Pat),pointerEvents:"none"}},[]),ht.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:a.map(d=>d.modifiedLine.left-16),top:a.map(d=>d.modifiedLine.top+Math.round((d.lineHeight-14-5)/2))}},[ht.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:pe(wne)}),ht.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:pe(wne)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:Ci(0),position:Ci({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}},Ay.MAX_LENGTH=100,Ay);E0=vlt([wlt(3,un)],E0);class Clt extends G{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this.isHovered=Ui(this._originalEditor).isTargetHovered(o=>{var r;return o.target.type===6&&((r=o.target.detail.injectedText)==null?void 0:r.options.attachedData)instanceof S6&&o.target.detail.injectedText.options.attachedData.owner===this},this._store),this._tokenizationFinished=xlt(this._modifiedTextModel),this._decorations=oe(this,o=>{var L,x;const r=this._state.read(o);if(!r)return;const a=r.modifiedText,l=r.mode==="insertionInline",c=r.diff.length===1&&((L=r.diff[0].innerChanges)==null?void 0:L.length)===1,d=!0,h=[],u=[],f=nt.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),g=nt.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),p=nt.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),m=nt.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),b=nt.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),v=nt.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),w=nt.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),C=r.mode!=="sideBySide"&&r.mode!=="deletion"&&r.mode!=="insertionInline"&&r.mode!=="lineReplacement",S=r.mode==="lineReplacement";for(const E of r.diff)if(C&&(E.original.isEmpty||h.push({range:E.original.toInclusiveRange(),options:g}),E.modified.isEmpty||u.push({range:E.modified.toInclusiveRange(),options:f})),E.modified.isEmpty||E.original.isEmpty)E.original.isEmpty||h.push({range:E.original.toInclusiveRange(),options:p}),E.modified.isEmpty||u.push({range:E.modified.toInclusiveRange(),options:m});else{const I=l&&ylt(E);for(const R of E.innerChanges||[]){if(E.original.contains(R.originalRange.startLineNumber)&&!(S&&R.originalRange.isEmpty())){const M=(x=this._originalEditor.getModel())==null?void 0:x.getValueInRange(R.originalRange,1);h.push({range:R.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:m6("inlineCompletions-char-delete",R.originalRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",R.originalRange.isEmpty()&&"empty",(R.originalRange.isEmpty()&&c||r.mode==="deletion"&&M===` -`)&&d&&!I&&"diff-range-empty"),inlineClassName:I?m6("strike-through","inlineCompletions"):null,zIndex:1}})}if(E.modified.contains(R.modifiedRange.startLineNumber)&&u.push({range:R.modifiedRange,options:R.modifiedRange.isEmpty()&&d&&!I&&c?v:b}),I){const M=a.getValueOfRange(R.modifiedRange),A=M.length>3?[{text:M.slice(0,1),extraClasses:["start"],offsetRange:new Me(R.modifiedRange.startColumn-1,R.modifiedRange.startColumn)},{text:M.slice(1,-1),extraClasses:[],offsetRange:new Me(R.modifiedRange.startColumn,R.modifiedRange.endColumn-2)},{text:M.slice(-1),extraClasses:["end"],offsetRange:new Me(R.modifiedRange.endColumn-2,R.modifiedRange.endColumn-1)}]:[{text:M,extraClasses:["start","end"],offsetRange:new Me(R.modifiedRange.startColumn-1,R.modifiedRange.endColumn)}];this._tokenizationFinished.read(o);const W=this._modifiedTextModel.tokenization.getLineTokens(R.modifiedRange.startLineNumber);for(const{text:P,extraClasses:B,offsetRange:V}of A)h.push({range:D.fromPositions(R.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:W.getTokensInRange(V),content:P,inlineClassName:m6("inlineCompletions-char-insert",R.modifiedRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",...B),cursorStops:jl.None,attachedData:new S6(this)},zIndex:2,showIfCollapsed:!0}})}}}if(r.isInDiffEditor)for(const E of r.diff)E.original.isEmpty||h.push({range:E.original.toExclusiveRange(),options:w});return{originalDecorations:h,modifiedDecorations:u}}),this._register(Ui(this._originalEditor).setDecorations(this._decorations.map(o=>(o==null?void 0:o.originalDecorations)??[])));const s=this._state.map(o=>o==null?void 0:o.modifiedCodeEditor);this._register(Eo((o,r)=>{const a=s.read(o);a&&r.add(Ui(a).setDecorations(this._decorations.map(l=>(l==null?void 0:l.modifiedDecorations)??[])))})),this._register(this._originalEditor.onMouseUp(o=>{var a;if(o.target.type!==6)return;const r=(a=o.target.detail.injectedText)==null?void 0:a.options.attachedData;r instanceof S6&&r.owner===this&&this._onDidClick.fire(o.event)}))}}class S6{constructor(e){this.owner=e}}function ylt(n){return n.innerChanges?n.innerChanges.every(e=>GP(e.modifiedRange)&&GP(e.originalRange)):!1}let Slt=0;function xlt(n){return Ut(n.onDidChangeTokens,()=>Slt++)}var Llt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},klt=function(n,e){return function(t,i){e(t,i,n)}};let aq=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=s,this._focusIsInMenu=o,this._instantiationService=r,this._editorObs=Ui(this._editor),this._tabAction=oe(d=>{var h;return((h=this._model.read(d))==null?void 0:h.tabAction.read(d))??So.Inactive}),this._constructorDone=Ze(this,!1),this._uiState=oe(this,d=>{var v,w;const h=this._model.read(d);if(!h||!this._constructorDone.read(d))return;const u=h.inlineEdit;let f=lr.fromEdit(u.edit),g=u.edit.apply(u.originalText),p=xA(f,u.originalText,new Yp(g)),m=this.determineRenderState(h,d,p,new Yp(g));if(!m){Je(new Error(`unable to determine view: tried to render ${(v=this._previousView)==null?void 0:v.view}`));return}if(m.kind===jt.SideBySide){const C=Yat(g,u.modifiedLineRange,l.getOptions().tabSize);g=C.applyToString(g),f=Uat(f,C),p=xA(f,u.originalText,new Yp(g))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==g&&this._previewTextModel.setValue(g),h.showCollapsed.read(d)&&!((w=this._indicator.read(d))!=null&&w.isHoverVisible.read(d))&&(m={kind:jt.Collapsed,viewData:m.viewData}),h.handleInlineEditShown(m.kind,m.viewData),{state:m,diff:p,edit:u,newText:g,newTextLineCount:u.modifiedLineRange.length,isInDiffEditor:h.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(aw,"",this._editor.getModel().getLanguageId(),{...aw.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Ze(this,!1),this._indicator=oe(this,d=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(d))return;const h=no({owner:this,equalsFn:rv(KG())},f=>{var m,b,v;const g=this._ghostTextIndicator.read(f);if(g)return g.lineRange;const p=this._uiState.read(f);if(p){if(((m=p.state)==null?void 0:m.kind)==="custom"){const w=(b=p.state.displayLocation)==null?void 0:b.range;if(!w)throw new ze("custom view should have a range");return new Ye(w.startLineNumber,w.endLineNumber)}return((v=p.state)==null?void 0:v.kind)==="insertionMultiLine"?this._insertion.originalLines.read(f):p.edit.displayRange}}),u=oe(this,f=>{const g=this._model.read(f);if(g)return g;const p=this._ghostTextIndicator.read(f);return p?p.model:g});return d.store.add(this._instantiationService.createInstance(tq,this._editorObs,h,this._gutterIndicatorOffset,u,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=oe(this,d=>this._sideBySide.isHovered.read(d)||this._wordReplacementViews.read(d).some(h=>h.isHovered.read(d))||this._deletion.isHovered.read(d)||this._inlineDiffView.isHovered.read(d)||this._lineReplacementView.isHovered.read(d)||this._insertion.isHovered.read(d)||this._customView.isHovered.read(d)),this._gutterIndicatorOffset=oe(this,d=>{var u,f;if(((f=(u=this._uiState.read(d))==null?void 0:u.state)==null?void 0:f.kind)==="insertionMultiLine")return this._insertion.startLineOffset.read(d);const h=this._ghostTextIndicator.read(d);return h?Nlt(h,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(KO,this._editor,this._model.map(d=>d==null?void 0:d.inlineEdit),this._previewTextModel,this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===jt.SideBySide?{newTextLineCount:d.newTextLineCount,isInDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(dlt,this._editor,this._model.map(d=>d==null?void 0:d.inlineEdit),this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===jt.Deletion?{originalRange:d.state.originalRange,deletions:d.state.deletions,inDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(oq,this._editor,this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===jt.InsertionMultiLine?{lineNumber:d.state.lineNumber,startColumn:d.state.column,text:d.state.text,inDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._inlineDiffViewState=oe(this,d=>{const h=this._uiState.read(d);if(!(!h||!h.state)&&!(h.state.kind==="wordReplacements"||h.state.kind==="insertionMultiLine"||h.state.kind==="collapsed"||h.state.kind==="custom"))return{modifiedText:new Yp(h.newText),diff:h.diff,mode:h.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:h.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(nq,this._editor,this._model.map((d,h)=>{var u,f;return((f=(u=this._uiState.read(h))==null?void 0:u.state)==null?void 0:f.kind)==="collapsed"?d==null?void 0:d.inlineEdit:void 0}))),this._customView=this._register(this._instantiationService.createInstance(sq,this._editor,this._model.map((d,h)=>{var u,f;return((f=(u=this._uiState.read(h))==null?void 0:u.state)==null?void 0:f.kind)==="custom"?d==null?void 0:d.displayLocation:void 0}),this._tabAction)),this._inlineDiffView=this._register(new Clt(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=ZG(this,this._uiState.map(d=>{var h;return((h=d==null?void 0:d.state)==null?void 0:h.kind)==="wordReplacements"?d.state.replacements:[]}),(d,h)=>h.add(this._instantiationService.createInstance(E0,this._editorObs,d,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance(rq,this._editorObs,this._uiState.map(d=>{var h;return((h=d==null?void 0:d.state)==null?void 0:h.kind)===jt.LineReplacement?{originalRange:d.state.originalRange,modifiedRange:d.state.modifiedRange,modifiedLines:d.state.modifiedLines,replacements:d.state.replacements}:void 0}),this._uiState.map(d=>(d==null?void 0:d.isInDiffEditor)??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(d=>d.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(d=>d.edits.renderSideBySide),this._register(Eo((d,h)=>{const u=this._model.read(d);u&&h.add(ve.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(d).map(f=>f.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(f=>{this._viewHasBeenShownLongerThan(350)&&(f.preventDefault(),u.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(iq,this._host,this._model,this._indicator,this._inlineCollapsedView));const a=oe(this,d=>Math.max(...this._wordReplacementViews.read(d).map(h=>h.minEditorScrollHeight.read(d)),this._lineReplacementView.minEditorScrollHeight.read(d),this._customView.minEditorScrollHeight.read(d))).recomputeInitiallyAndOnChange(this._store),l=this._editor.getModel();let c;this._register(qe(d=>{const h=a.read(d);this._editor.changeViewZones(u=>{const f=this._editor.getScrollHeight(),g=h-f+1;g!==0&&c&&(u.removeZone(c),c=void 0),!(g<=0)&&(c=u.addZone({afterLineNumber:l.getLineCount(),heightInPx:g,domNode:me("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,s){var u,f,g,p,m;const o=e.inlineEdit,r=((u=this._previousView)==null?void 0:u.id)===this.getCacheId(e)&&!((f=e.displayLocation)!=null&&f.jumpToEdit),a=((g=this._previousView)==null?void 0:g.editorWidth)!==this._editorObs.layoutInfoWidth.read(t)&&(((p=this._previousView)==null?void 0:p.view)===jt.SideBySide||((m=this._previousView)==null?void 0:m.view)===jt.LineReplacement);if(r&&!a)return this._previousView.view;if(e.inlineEdit.inlineCompletion instanceof ky&&e.inlineEdit.inlineCompletion.uri||e.displayLocation&&!e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))return jt.Custom;const l=o.originalLineRange.length,c=o.modifiedLineRange.length,d=i.flatMap(b=>b.innerChanges??[]),h=d.length===1;if(!e.isInDiffEditor){if(h&&this._useCodeShifting.read(t)!=="never"&&jCe(i))return Elt(i,o.cursorPosition)?jt.InsertionInline:jt.LineReplacement;if(Ule(d,o,s))return jt.Deletion;if($le(i)&&this._useCodeShifting.read(t)==="always")return jt.InsertionMultiLine;if(d.every(v=>rs.ofRange(v.originalRange).columnCounts.getValueOfRange(C.modifiedRange)),w=d.map(C=>e.inlineEdit.originalText.getValueOfRange(C.originalRange));if(!v.some(C=>C.includes(" "))&&!w.some(C=>C.includes(" "))&&(!d.some(C=>C.originalRange.isEmpty())||!qle(d.map(C=>new On(C.originalRange,"")),o.originalText).some(C=>C.range.isEmpty()&&rs.ofRange(C.range).columnCount0&&c>0)return l===1&&c===1&&!e.isInDiffEditor?jt.LineReplacement:this._renderSideBySide.read(t)!=="never"&&KO.fitsInsideViewport(this._editor,this._previewTextModel,o,t)?jt.SideBySide:jt.LineReplacement;if(e.isInDiffEditor){if(Ule(d,o,s))return jt.Deletion;if($le(i)&&this._useCodeShifting.read(t)==="always")return jt.InsertionMultiLine}return jt.SideBySide}determineRenderState(e,t,i,s){const o=e.inlineEdit;let r=this.determineView(e,t,i,s);if(this._willRenderAboveCursor(t,o,r))switch(r){case jt.LineReplacement:case jt.WordReplacements:r=jt.SideBySide;break}this._previousView={id:this.getCacheId(e),view:r,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const a=i.flatMap(g=>g.innerChanges??[]),l=this._editor.getModel(),c=a.map(g=>({originalRange:g.originalRange,modifiedRange:g.modifiedRange,original:l.getValueInRange(g.originalRange),modified:s.getValueOfRange(g.modifiedRange)})),d=o.cursorPosition,h=c.length===0?!1:c[0].modified.startsWith(l.getEOL()),u={cursorColumnDistance:o.edit.replacements.length===0?0:o.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:o.lineEdit.lineRange.startLineNumber-d.lineNumber+(h&&o.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:o.lineEdit.lineRange.length,lineCountModified:o.lineEdit.newLines.length,characterCountOriginal:c.reduce((g,p)=>g+p.original.length,0),characterCountModified:c.reduce((g,p)=>g+p.modified.length,0),disjointReplacements:c.length,sameShapeReplacements:c.every(g=>g.original===c[0].original&&g.modified===c[0].modified)};switch(r){case jt.InsertionInline:return{kind:jt.InsertionInline,viewData:u};case jt.SideBySide:return{kind:jt.SideBySide,viewData:u};case jt.Collapsed:return{kind:jt.Collapsed,viewData:u};case jt.Custom:return{kind:jt.Custom,displayLocation:e.displayLocation,viewData:u}}if(r===jt.Deletion)return{kind:jt.Deletion,originalRange:o.originalLineRange,deletions:a.map(g=>g.originalRange),viewData:u};if(r===jt.InsertionMultiLine){const g=a[0];return{kind:jt.InsertionMultiLine,lineNumber:g.originalRange.startLineNumber,column:g.originalRange.startColumn,text:s.getValueOfRange(g.modifiedRange),viewData:u}}const f=c.map(g=>new On(g.originalRange,g.modified));if(f.length!==0){if(r===jt.WordReplacements){let g=Ilt(f,o.originalText);return g.some(p=>p.range.isEmpty())&&(g=qle(f,o.originalText)),{kind:jt.WordReplacements,replacements:g,viewData:u}}if(r===jt.LineReplacement)return{kind:jt.LineReplacement,originalRange:o.originalLineRange,modifiedRange:o.modifiedLineRange,modifiedLines:o.modifiedLineRange.mapToLineArray(g=>s.getLineAt(g)),replacements:a.map(g=>({originalRange:g.originalRange,modifiedRange:g.modifiedRange})),viewData:u}}}_willRenderAboveCursor(e,t,i){if(this._useCodeShifting.read(e)==="always")return!1;for(const o of t.multiCursorPositions)if(i===jt.WordReplacements&&o.lineNumber===t.originalLineRange.startLineNumber+1||i===jt.LineReplacement&&o.lineNumber>=t.originalLineRange.endLineNumberExclusive&&o.lineNumber=e}};aq=Llt([klt(5,Ae)],aq);function jCe(n){return n.every(t=>t.innerChanges.every(i=>e(i)));function e(t){return!(!t.originalRange.isEmpty()||!(t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber))}}function Elt(n,e){if(!e||!jCe(n))return!1;const t=e;return n.every(s=>s.innerChanges.every(o=>i(o)));function i(s){const o=s.originalRange.getStartPosition();return!!(t.isBeforeOrEqual(o)||o.lineNumberi.innerChanges??[]);if(e.length!==1)return!1;const t=e[0];return!(!t.originalRange.isEmpty()||t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber)}function Ule(n,e,t){return n.map(s=>({original:e.originalText.getValueOfRange(s.originalRange),modified:t.getValueOfRange(s.modifiedRange)})).every(({original:s,modified:o})=>o.trim()===""&&s.length>0&&(s.length>o.length||s.trim()!==""))}function Ilt(n,e){return $Ce(n,e,t=>/^[a-zA-Z]$/.test(t))}function qle(n,e){return $Ce(n,e,t=>!/^\s$/.test(t))}function $Ce(n,e,t){const i=[];n.sort((o,r)=>D.compareRangesUsingStarts(o.range,r.range));for(const o of n){let r=o.range.startColumn-1,a=o.range.endColumn-2,l="",c="";const d=e.getLineAt(o.range.startLineNumber),h=e.getLineAt(o.range.endLineNumber);if(s(d[r]))for(;s(d[r-1]);)l=d[r-1]+l,r--;if(s(h[a])||a0&&D.areIntersectingOrTouching(i[i.length-1].range,u.range)&&(u=On.joinReplacements([i.pop(),u],e)),i.push(u)}function s(o){return o===void 0?!1:t(o)}return i}function Nlt(n,e){const t=n.model.inlineEdit.edit.replacements;if(t.length!==1)return 0;const i=e.getModel();if(!i)return 0;const s=i.getEOL(),o=t[0];if(o.range.isEmpty()&&o.text.startsWith(s)){const r=e.getLineHeightForPosition(o.range.getStartPosition());return Dlt(o.text,s)*r}return 0}function Dlt(n,e){if(!e.length)return 0;let t=0,i=0;for(;n.startsWith(e,i);)t++,i+=e.length;return t}var Tlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Rlt=function(n,e){return function(t,i){e(t,i,n)}},k1;let lq=(k1=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=s,this._inlineEdit=oe(this,r=>{var g;const a=this._model.read(r);if(!a)return;const l=this._edit.read(r);if(!l)return;const c=this._editor.getModel();if(!c)return;const d=(g=a.inlineEditState.read(void 0))==null?void 0:g.inlineCompletion.updatedEdit;if(!d)return;const h=d.replacements.map(p=>{const m=D.fromPositions(c.getPositionAt(p.replaceRange.start),c.getPositionAt(p.replaceRange.endExclusive));return new On(m,p.newText)}),u=new fa(h),f=new mw(c);return new RCe(f,u,a.primaryPosition.read(void 0),a.allPositions.read(void 0),l.commands,l.inlineCompletion)}),this._inlineEditModel=oe(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._inlineEdit.read(r);if(!l)return;const c=oe(this,d=>{if(this._editorObs.isFocused.read(d)){if(a.tabShouldJumpToInlineEdit.read(d))return So.Jump;if(a.tabShouldAcceptInlineEdit.read(d))return So.Accept}return So.Inactive});return new MCe(a,l,c)}),this._inlineEditHost=oe(this,r=>{const a=this._model.read(r);if(a)return new kat(a)}),this._ghostTextIndicator=oe(this,r=>{const a=this._model.read(r);if(!a)return;const l=a.inlineCompletionState.read(r);if(!l)return;const c=l.inlineCompletion;if(!c||!c.showInlineEditMenu)return;const d=Ye.ofLength(l.primaryGhostText.lineNumber,1);return new Eat(this._editor,a,d,c)}),this._editorObs=Ui(this._editor),this._register(o.createInstance(aq,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}},k1.hot=j3(k1),k1);lq=Tlt([Rlt(4,Ae)],lq);var Mlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Alt=function(n,e){return function(t,i){e(t,i,n)}};let cq=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=s,this._ghostTexts=oe(this,o=>{const r=this._model.read(o);return(r==null?void 0:r.ghostTexts.read(o))??[]}),this._stablizedGhostTexts=lrt(this._ghostTexts,this._store),this._editorObs=Ui(this._editor),this._ghostTextWidgets=ZG(this,this._stablizedGhostTexts,(o,r)=>Ml(a=>this._instantiationService.createInstance(NN.hot.read(a),this._editor,{ghostText:o,warning:this._model.map((l,c)=>{var h;const d=(h=l==null?void 0:l.warning)==null?void 0:h.read(c);return d?{icon:d.icon}:void 0}),minReservedLineCount:Ci(0),targetTextModel:this._model.map(l=>l==null?void 0:l.textModel),handleInlineCompletionShown:this._model.map((l,c)=>{var h;const d=(h=l==null?void 0:l.inlineCompletionState.read(c))==null?void 0:h.inlineCompletion;return d?u=>l.handleInlineSuggestionShown(d,jt.GhostText,u):()=>{}})},this._editorObs.getOption(71).map(l=>({syntaxHighlightingEnabled:l.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(r)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=oe(this,o=>{var r,a;return(a=(r=this._model.read(o))==null?void 0:r.inlineEditState.read(o))==null?void 0:a.inlineEdit}),this._everHadInlineEdit=Hg(this,(o,r)=>{var a,l,c;return r||!!this._inlineEdit.read(o)||!!((c=(l=(a=this._model.read(o))==null?void 0:a.inlineCompletionState.read(o))==null?void 0:l.inlineCompletion)!=null&&c.showInlineEditMenu)}),this._inlineEditWidget=Ml(o=>{if(this._everHadInlineEdit.read(o))return this._instantiationService.createInstance(lq.hot.read(o),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(o=>o.fontFamily),this._register(t8e(oe(o=>` +`,s=new Co().appendCodeblock("empty",r),i=`Provider: ${e.provider._debugDisplayName}`}if(!t&&!YX(e)){this.clearContents();return}if(this.domNode.classList.remove("no-docs","no-type"),i){const r=i.length>1e5?`${i.substr(0,1e5)}…`:i;this._type.textContent=r,this._type.title=r,ca(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gmi.test(r))}else js(this._type),this._type.title="",cr(this._type),this.domNode.classList.add("no-type");if(js(this._docs),typeof s=="string")this._docs.classList.remove("markdown-docs"),this._docs.textContent=s;else if(s){this._docs.classList.add("markdown-docs"),js(this._docs);const r=this._markdownRendererService.render(s,{context:this._editor,asyncRenderCallback:()=>{this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}});this._docs.appendChild(r.element),this._renderDisposeable.add(r)}this.domNode.classList.toggle("detail-and-doc",!!i&&!!s),this.domNode.style.userSelect="text",this.domNode.tabIndex=-1,this._close.onmousedown=r=>{r.preventDefault(),r.stopPropagation()},this._close.onclick=r=>{r.preventDefault(),r.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get isEmpty(){return this.domNode.classList.contains("no-docs")}get size(){return this._size}layout(e,t){const i=new Jt(e,t);Jt.equals(i,this._size)||(this._size=i,GOe(this.domNode,e,t)),this._scrollbar.scanDomNode()}scrollDown(e=8){this._body.scrollTop+=e}scrollUp(e=8){this._body.scrollTop-=e}scrollTop(){this._body.scrollTop=0}scrollBottom(){this._body.scrollTop=this._body.scrollHeight}pageDown(){this.scrollDown(80)}pageUp(){this.scrollUp(80)}focus(){this.domNode.focus()}};VU=eat([xle(1,en),xle(2,ed)],VU);class tat{constructor(e,t){this.widget=e,this._editor=t,this.allowEditorOverflow=!0,this._disposables=new ne,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new kX,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let i,s,o=0,r=0;this._disposables.add(this._resizable.onDidWillResize(()=>{i=this._topLeft,s=this._resizable.size})),this._disposables.add(this._resizable.onDidResize(a=>{if(i&&s){this.widget.layout(a.dimension.width,a.dimension.height);let l=!1;a.west&&(r=s.width-a.dimension.width,l=!0),a.north&&(o=s.height-a.dimension.height,l=!0),l&&this._applyTopLeft({top:i.top+o,left:i.left+r})}a.done&&(i=void 0,s=void 0,o=0,r=0,this._userSize=a.dimension)})),this._disposables.add(this.widget.onDidChangeContents(()=>{this._anchorBox&&this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,this._preferAlignAtTop)}))}dispose(){this._resizable.dispose(),this._disposables.dispose(),this.hide()}getId(){return"suggest.details"}getDomNode(){return this._resizable.domNode}getPosition(){return this._topLeft?{preference:this._topLeft}:null}show(){this._added||(this._editor.addOverlayWidget(this),this._added=!0)}hide(e=!1){this._resizable.clearSashHoverState(),this._added&&(this._editor.removeOverlayWidget(this),this._added=!1,this._anchorBox=void 0,this._topLeft=void 0),e&&(this._userSize=void 0,this.widget.clearContents())}placeAtAnchor(e,t){const i=e.getBoundingClientRect();this._anchorBox=i,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,this._userSize??this.widget.size,t)}_placeAtAnchor(e,t,i){const s=Jm(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Jt(220,2*o.lineHeight),a=e.top,l=function(){const S=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),L=-o.borderWidth+e.left+e.width,x=new Jt(S,s.height-e.top-o.borderHeight-o.verticalPadding),I=x.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:I,minSize:r.with(Math.min(S,r.width))}}(),c=function(){const S=e.left-o.borderWidth-o.horizontalPadding,L=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),x=new Jt(S,s.height-e.top-o.borderHeight-o.verticalPadding),I=x.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:L,fit:S-t.width,maxSizeTop:x,maxSizeBottom:I,minSize:r.with(Math.min(S,r.width))}}(),d=function(){const S=e.left,L=-o.borderWidth+e.top+e.height,x=new Jt(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:L,left:S,fit:x.height-t.height,maxSizeBottom:x,maxSizeTop:x,minSize:r.with(x.width)}}(),h=[l,c,d],u=h.find(S=>S.fit>=0)??h.sort((S,L)=>L.fit-S.fit)[0],f=e.top+e.height-o.borderHeight;let g,p=t.height;const m=Math.max(u.maxSizeTop.height,u.maxSizeBottom.height);p>m&&(p=m);let b;i?p<=u.maxSizeTop.height?(g=!0,b=u.maxSizeTop):(g=!1,b=u.maxSizeBottom):p<=u.maxSizeBottom.height?(g=!1,b=u.maxSizeBottom):(g=!0,b=u.maxSizeTop);let{top:v,left:w}=u;!g&&p>e.height&&(v=f-p);const C=this._editor.getDomNode();if(C){const S=C.getBoundingClientRect();v-=S.top,w-=S.left}this._applyTopLeft({left:w,top:v}),this._resizable.enableSashes(!g,u===l,g,u!==l),this._resizable.minSize=u.minSize,this._resizable.maxSize=b,this._resizable.layout(p,Math.min(b.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this._editor.layoutOverlayWidget(this)}}const Lle=mt("fileService");var cu;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(cu||(cu={}));const iat=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function $2(n,e,t,i,s){if($e.isThemeIcon(s))return[`codicon-${s.id}`,"predefined-file-icon"];if(He.isUri(s))return[];const o=i===cu.ROOT_FOLDER?["rootfolder-icon"]:i===cu.FOLDER?["folder-icon"]:["file-icon"];if(t){let r;if(t.scheme===Ge.data)r=i_.parseMetaData(t).get(i_.META_DATA_LABEL);else{const a=t.path.match(iat);a?(r=U2(a[2].toLowerCase()),a[1]&&o.push(`${U2(a[1].toLowerCase())}-name-dir-icon`)):r=U2(t.authority.toLowerCase())}if(i===cu.ROOT_FOLDER)o.push(`${r}-root-name-folder-icon`);else if(i===cu.FOLDER)o.push(`${r}-name-folder-icon`);else{if(r){if(o.push(`${r}-name-file-icon`),o.push("name-file-icon"),r.length<=255){const l=r.split(".");for(let c=1;c=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},h6=function(n,e){return function(t,i){e(t,i,n)}};const oat=Ri("suggest-more-info",de.chevronRight,_(1492,"Icon for more information in the suggest widget."));var Md;const rat=new(Md=class{extract(e,t){if(e.textLabel.match(Md._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(Md._regexStrict))return t[0]=e.completion.detail,!0;if(e.completion.documentation){const i=typeof e.completion.documentation=="string"?e.completion.documentation:e.completion.documentation.value,s=Md._regexRelaxed.exec(i);if(s&&(s.index===0||s.index+s[0].length===i.length))return t[0]=s[0],!0}return!1}},Md._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,Md._regexStrict=new RegExp(`^${Md._regexRelaxed.source}$`,"i"),Md);let zU=class{constructor(e,t,i,s){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=s,this._onDidToggleDetails=new q,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new ne,i=e;i.classList.add("show-file-icons");const s=he(e,me(".icon")),o=he(s,me("span.colorspan")),r=he(e,me(".contents")),a=he(r,me(".main")),l=he(a,me(".icon-label.codicon")),c=he(a,me("span.left")),d=he(a,me("span.right")),h=new tN(c,{supportHighlights:!0,supportIcons:!0});t.add(h);const u=he(c,me("span.signature-label")),f=he(c,me("span.qualifier-label")),g=he(d,me("span.details-label")),p=he(d,me("span.readMore"+$e.asCSSSelector(oat)));return p.title=_(1493,"Read More"),{root:i,left:c,right:d,icon:s,colorspan:o,iconLabel:h,iconContainer:l,parametersLabel:u,qualifierLabel:f,detailsLabel:g,readMore:p,disposables:t,configureFont:()=>{const b=this._editor.getOptions(),v=b.get(59),w=v.getMassagedFontFamily(),C=v.fontFeatureSettings,S=v.fontVariationSettings,L=b.get(135)||v.fontSize,x=b.get(136)||v.lineHeight,I=v.fontWeight,E=v.letterSpacing,R=`${L}px`,M=`${x}px`,A=`${E}px`;i.style.fontSize=R,i.style.fontWeight=I,i.style.letterSpacing=A,a.style.fontFamily=w,a.style.fontFeatureSettings=C,a.style.fontVariationSettings=S,a.style.lineHeight=M,s.style.height=M,s.style.width=M,p.style.height=M,p.style.width=M}}}renderElement(e,t,i){i.configureFont();const{completion:s}=e;i.colorspan.style.backgroundColor="";const o={labelEscapeNewLines:!0,matches:xD(e.score)},r=[];if(s.kind===19&&rat.extract(e,r))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=r[0];else if(s.kind===20&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const a=$2(this._modelService,this._languageService,He.from({scheme:"fake",path:e.textLabel}),cu.FILE),l=$2(this._modelService,this._languageService,He.from({scheme:"fake",path:s.detail}),cu.FILE);o.extraClasses=a.length>l.length?a:l}else s.kind===23&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",o.extraClasses=[$2(this._modelService,this._languageService,He.from({scheme:"fake",path:e.textLabel}),cu.FOLDER),$2(this._modelService,this._languageService,He.from({scheme:"fake",path:s.detail}),cu.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...$e.asClassNameArray(nS.toIcon(s.kind))));s.tags&&s.tags.indexOf(1)>=0&&(o.extraClasses=(o.extraClasses||[]).concat(["deprecated"]),o.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,o),typeof s.label=="string"?(i.parametersLabel.textContent="",i.detailsLabel.textContent=u6(s.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=u6(s.label.detail||""),i.detailsLabel.textContent=u6(s.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(134).showInlineDetails?ca(i.detailsLabel):cr(i.detailsLabel),YX(e)?(i.right.classList.add("can-expand-details"),ca(i.readMore),i.readMore.onmousedown=a=>{a.stopPropagation(),a.preventDefault()},i.readMore.onclick=a=>{a.stopPropagation(),a.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),cr(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};zU=sat([h6(1,Ui),h6(2,un),h6(3,en)],zU);function u6(n){return n.replace(/\r\n|\r|\n/g,"")}var aat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q2=function(n,e){return function(t,i){e(t,i,n)}},BC;F("editorSuggestWidget.background",el,_(1473,"Background color of the suggest widget."));F("editorSuggestWidget.border",bY,_(1474,"Border color of the suggest widget."));const lat=F("editorSuggestWidget.foreground",Mu,_(1475,"Foreground color of the suggest widget."));F("editorSuggestWidget.selectedForeground",EE,_(1476,"Foreground color of the selected entry in the suggest widget."));F("editorSuggestWidget.selectedIconForeground",NY,_(1477,"Icon foreground color of the selected entry in the suggest widget."));const cat=F("editorSuggestWidget.selectedBackground",NE,_(1478,"Background color of the selected entry in the suggest widget."));F("editorSuggestWidget.highlightForeground",d0,_(1479,"Color of the match highlights in the suggest widget."));F("editorSuggestWidget.focusHighlightForeground",v7e,_(1480,"Color of the match highlights in the suggest widget when an item is focused."));F("editorSuggestWidgetStatus.foreground",ot(lat,.5),_(1481,"Foreground color of the suggest widget status."));class dat{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof Pg}`}restore(){const e=this._service.get(this._key,0)??"";try{const t=JSON.parse(e);if(Jt.is(t))return Jt.lift(t)}catch{}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}var jm;let jU=(jm=class{constructor(e,t,i,s,o){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new Gt,this._pendingShowDetails=new Gt,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new ya,this._disposables=new ne,this._onDidSelect=new K1,this._onDidFocus=new K1,this._onDidHide=new q,this._onDidShow=new q,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new q,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new kX,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new hat(this,e),this._persistedSize=new dat(t,e);class r{constructor(f,g,p=!1,m=!1){this.persistedSize=f,this.currentSize=g,this.persistHeight=p,this.persistWidth=m}}let a;this._disposables.add(this.element.onDidWillResize(()=>{this._contentWidget.lockPreference(),a=new r(this._persistedSize.restore(),this.element.size)})),this._disposables.add(this.element.onDidResize(u=>{var f,g;if(this._resize(u.dimension.width,u.dimension.height),a&&(a.persistHeight=a.persistHeight||!!u.north||!!u.south,a.persistWidth=a.persistWidth||!!u.east||!!u.west),!!u.done){if(a){const{itemHeight:p,defaultSize:m}=this.getLayoutInfo(),b=Math.round(p/2);let{width:v,height:w}=this.element.size;(!a.persistHeight||Math.abs(a.currentSize.height-w)<=b)&&(w=((f=a.persistedSize)==null?void 0:f.height)??m.height),(!a.persistWidth||Math.abs(a.currentSize.width-v)<=b)&&(v=((g=a.persistedSize)==null?void 0:g.width)??m.width),this._persistedSize.store(new Jt(v,w))}this._contentWidget.unlockPreference(),a=void 0}})),this._messageElement=he(this.element.domNode,me(".message")),this._listElement=he(this.element.domNode,me(".tree"));const l=this._disposables.add(o.createInstance(VU,this.editor));l.onDidClose(()=>this.toggleDetails(),this,this._disposables),this._details=new tat(l,this.editor);const c=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(134).showIcons);c();const d=o.createInstance(zU,this.editor);this._disposables.add(d),this._disposables.add(d.onDidToggleDetails(()=>this.toggleDetails())),this._list=new pl("SuggestWidget",this._listElement,{getHeight:u=>this.getLayoutInfo().itemHeight,getTemplateId:u=>"suggestion"},[d],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>$s?"listitem":"option",getWidgetAriaLabel:()=>_(1484,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:u=>{let f=u.textLabel;const g=nS.toLabel(u.completion.kind);if(typeof u.completion.label!="string"){const{detail:v,description:w}=u.completion.label;v&&w?f=_(1485,"{0} {1}, {2}, {3}",f,v,w,g):v?f=_(1486,"{0} {1}, {2}",f,v,g):w&&(f=_(1487,"{0}, {1}, {2}",f,w,g))}else f=_(1488,"{0}, {1}",f,g);if(!u.isResolved||!this._isDetailsVisible())return f;const{documentation:p,detail:m}=u.completion,b=Z1("{0}{1}",m||"",p?typeof p=="string"?p:p.value:"");return _(1489,"{0}, docs: {1}",f,b)}}}),this._list.style(Ww({listInactiveFocusBackground:cat,listInactiveFocusOutline:Hi})),this._status=o.createInstance(HU,this.element.domNode,Em);const h=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(134).showStatusBar);h(),this._disposables.add(this._list.onMouseDown(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onTap(u=>this._onListMouseDownOrTap(u))),this._disposables.add(this._list.onDidChangeSelection(u=>this._onListSelection(u))),this._disposables.add(this._list.onDidChangeFocus(u=>this._onListFocus(u))),this._disposables.add(this.editor.onDidChangeCursorSelection(()=>this._onCursorSelectionChanged())),this._disposables.add(this.editor.onDidChangeConfiguration(u=>{u.hasChanged(134)&&(h(),c()),this._completionModel&&(u.hasChanged(59)||u.hasChanged(135)||u.hasChanged(136))&&this._list.splice(0,this._list.length,this._completionModel.items)})),this._ctxSuggestWidgetVisible=bt.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=bt.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=bt.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=bt.HasFocusedSuggestion.bindTo(i),this._disposables.add(kn(this._details.widget.domNode,"keydown",u=>{this._onDetailsKeydown.fire(u)})),this._disposables.add(this.editor.onMouseDown(u=>this._onEditorMouseDown(u)))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),(e=this._loadingTimeout)==null||e.dispose(),this._pendingLayout.dispose(),this._pendingShowDetails.dispose(),this._showTimeout.dispose(),this._contentWidget.dispose(),this.element.dispose()}_onEditorMouseDown(e){this._details.widget.domNode.contains(e.target.element)?this._details.widget.domNode.focus():this.element.domNode.contains(e.target.element)&&this.editor.focus()}_onCursorSelectionChanged(){this._state!==0&&this._contentWidget.layout()}_onListMouseDownOrTap(e){typeof e.element>"u"||typeof e.index>"u"||(e.browserEvent.preventDefault(),e.browserEvent.stopPropagation(),this._select(e.element,e.index))}_onListSelection(e){e.elements.length&&this._select(e.elements[0],e.indexes[0])}_select(e,t){const i=this._completionModel;i&&(this._onDidSelect.fire({item:e,index:t,model:i}),this.editor.focus())}_onListFocus(e){var s;if(this._ignoreFocusEvents)return;if(this._state===5&&this._setState(3),!e.elements.length){this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);return}if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const t=e.elements[0],i=e.indexes[0];t!==this._focusedItem&&((s=this._currentSuggestionDetails)==null||s.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=t,this._list.reveal(i),this._currentSuggestionDetails=rs(async o=>{const r=kg(()=>{this._isDetailsVisible()&&this._showDetails(!0,!1)},250),a=o.onCancellationRequested(()=>r.dispose());try{return await t.resolve(o)}finally{r.dispose(),a.dispose()}}),this._currentSuggestionDetails.then(()=>{i>=this._list.length||t!==this._list.element(i)||(this._ignoreFocusEvents=!0,this._list.splice(i,1,[t]),this._list.setFocus([i]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this._showDetails(!1,!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:this._list.getElementID(i)}))}).catch(Je)),this._onDidFocus.fire({item:t,index:i,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",e===4),this.element.domNode.classList.remove("message"),e){case 0:cr(this._messageElement,this._listElement,this._status.element),this._details.hide(!0),this._status.hide(),this._contentWidget.hide(),this._ctxSuggestWidgetVisible.reset(),this._ctxSuggestWidgetMultipleSuggestions.reset(),this._ctxSuggestWidgetHasFocusedSuggestion.reset(),this._showTimeout.cancel(),this.element.domNode.classList.remove("visible"),this._list.splice(0,this._list.length),this._focusedItem=void 0,this._cappedHeight=void 0,this._explainMode=!1;break;case 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=BC.LOADING_MESSAGE,cr(this._listElement,this._status.element),ca(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jd(BC.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=BC.NO_SUGGESTIONS_MESSAGE,cr(this._listElement,this._status.element),ca(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Jd(BC.NO_SUGGESTIONS_MESSAGE);break;case 3:cr(this._messageElement),ca(this._listElement,this._status.element),this._show();break;case 4:cr(this._messageElement),ca(this._listElement,this._status.element),this._show();break;case 5:cr(this._messageElement),ca(this._listElement,this._status.element),this._details.show(),this._show(),this._details.widget.focus();break}}_show(){this._status.show(),this._contentWidget.show(),this._layout(this._persistedSize.restore()),this._ctxSuggestWidgetVisible.set(!0),this._showTimeout.cancelAndSet(()=>{this.element.domNode.classList.add("visible"),this._onDidShow.fire(this)},100)}showTriggered(e,t){this._state===0&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=kg(()=>this._setState(1),t)))}showSuggestions(e,t,i,s,o){var l,c;if(this._contentWidget.setPosition(this.editor.getPosition()),(l=this._loadingTimeout)==null||l.dispose(),(c=this._currentSuggestionDetails)==null||c.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&this._state!==2&&this._state!==0){this._setState(4);return}const r=this._completionModel.items.length,a=r===0;if(this._ctxSuggestWidgetMultipleSuggestions.set(r>1),a){this._setState(s?0:2),this._completionModel=void 0;return}this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0,t===0?0:this.getLayoutInfo().itemHeight*.33),this._list.setFocus(o?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=gA(Pe(this.element.domNode),()=>{this._pendingLayout.clear(),this._layout(this.element.size),this._details.widget.domNode.classList.remove("focused")})}focusSelected(){this._list.length>0&&this._list.setFocus([0])}selectNextPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(this._state!==0&&this._state!==2&&this._state!==1&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){this._state===5?(this._list.setFocus(this._list.getFocus()),this._setState(3)):this._state===3&&(this._setState(5),this._isDetailsVisible()?this._details.widget.focus():this.toggleDetails(!0))}toggleDetails(e=!1){this._isDetailsVisible()?(this._pendingShowDetails.clear(),this._ctxSuggestWidgetDetailsVisible.set(!1),this._setDetailsVisible(!1),this._details.hide(),this.element.domNode.classList.remove("shows-details")):(YX(this._list.getFocusedElements()[0])||this._explainMode)&&(this._state===3||this._state===5||this._state===4)&&(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this._showDetails(!1,e))}_showDetails(e,t){this._pendingShowDetails.value=gA(Pe(this.element.domNode),()=>{this._pendingShowDetails.clear(),this._details.show();let i=!1;e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._details.widget.isEmpty?this._details.hide():(this._positionDetails(),this.element.domNode.classList.add("shows-details"),t&&(this._details.widget.focus(),i=!0)),i||this.editor.focus()})}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this._showDetails(!1,!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var i;this._pendingLayout.clear(),this._pendingShowDetails.clear(),(i=this._loadingTimeout)==null||i.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const e=this._persistedSize.restore(),t=Math.ceil(this.getLayoutInfo().itemHeight*4.3);e&&e.heightl&&(o=l);const c=this._completionModel?this._completionModel.stats.pLabelLen*i.typicalHalfwidthCharacterWidth:o,d=i.statusBarHeight+this._list.contentHeight+i.borderHeight,h=i.itemHeight+i.statusBarHeight,u=dn(this.editor.getDomNode()),f=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),g=u.top+f.top+f.height,p=Math.min(t.height-g-i.verticalPadding,d),m=u.top+f.top-i.verticalPadding,b=Math.min(m,d);let v=Math.min(Math.max(b,p)+i.borderHeight,d);s===((r=this._cappedHeight)==null?void 0:r.capped)&&(s=this._cappedHeight.wanted),sv&&(s=v),s>p&&b>p||this._forceRenderingAbove&&m>150?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=b):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=p),this.element.preferredSize=new Jt(c,i.defaultSize.height),this.element.maxSize=new Jt(l,v),this.element.minSize=new Jt(220,h),this._cappedHeight=s===d?{wanted:((a=this._cappedHeight)==null?void 0:a.wanted)??e.height,capped:s}:void 0}this._resize(o,s)}_resize(e,t){const{width:i,height:s}=this.element.maxSize;e=Math.min(i,e),t=Math.min(s,t);const{statusBarHeight:o}=this.getLayoutInfo();this._list.layout(t-o,e),this._listElement.style.height=`${t-o}px`,this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,((e=this._contentWidget.getPosition())==null?void 0:e.preference[0])===2)}getLayoutInfo(){const e=this.editor.getOption(59),t=lr(this.editor.getOption(136)||e.lineHeight,8,1e3),i=!this.editor.getOption(134).showStatusBar||this._state===2||this._state===1?0:t,s=this._details.widget.getLayoutInfo().borderWidth,o=2*s;return{itemHeight:t,statusBarHeight:i,borderWidth:s,borderHeight:o,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Jt(430,i+12*t)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}},BC=jm,jm.LOADING_MESSAGE=_(1482,"Loading..."),jm.NO_SUGGESTIONS_MESSAGE=_(1483,"No suggestions."),jm);jU=BC=aat([q2(1,Jo),q2(2,Xe),q2(3,en),q2(4,Ae)],jU);class hat{constructor(e,t){this._widget=e,this._editor=t,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._preferenceLocked=!1,this._added=!1,this._hidden=!1}dispose(){this._added&&(this._added=!1,this._editor.removeContentWidget(this))}getId(){return"editor.widget.suggestWidget"}getDomNode(){return this._widget.element.domNode}show(){this._hidden=!1,this._added||(this._added=!0,this._editor.addContentWidget(this))}hide(){this._hidden||(this._hidden=!0,this.layout())}layout(){this._editor.layoutContentWidget(this)}getPosition(){return this._hidden||!this._position||!this._preference?null:{position:this._position,preference:[this._preference]}}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:s}=this._widget.getLayoutInfo();return new Jt(t+2*i+s,e+2*i)}afterRender(e){this._widget._afterRender(e)}setPreference(e){this._preferenceLocked||(this._preference=e)}lockPreference(){this._preferenceLocked=!0}unlockPreference(){this._preferenceLocked=!1}setPosition(e){this._position=e}}var uat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kC=function(n,e){return function(t,i){e(t,i,n)}},$U;class fat{constructor(e,t){if(this._model=e,this._position=t,this._decorationOptions=st.register({description:"suggest-line-suffix",stickiness:1}),e.getLineMaxColumn(t.lineNumber)!==t.column){const s=e.getOffsetAt(t),o=e.getPositionAt(s+1);e.changeDecorations(r=>{this._marker&&r.removeDecoration(this._marker),this._marker=r.addDecoration(D.fromPositions(t,o),this._decorationOptions)})}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.changeDecorations(e=>{e.removeDecoration(this._marker),this._marker=void 0})}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}else return this._model.getLineMaxColumn(e.lineNumber)-e.column}}var w1;let zd=(w1=class{static get(e){return e.getContribution($U.ID)}get onWillInsertSuggestItem(){return this._onWillInsertSuggestItem.event}constructor(e,t,i,s,o,r,a){this._memoryService=t,this._commandService=i,this._contextKeyService=s,this._instantiationService=o,this._logService=r,this._telemetryService=a,this._lineSuffix=new Gt,this._toDispose=new ne,this._selectors=new gat(h=>h.priority),this._onWillInsertSuggestItem=new q,this._wantsForceRenderingAbove=!1,this.editor=e,this.model=o.createInstance(jO,this.editor),this._selectors.register({priority:0,select:(h,u,f)=>this._memoryService.select(h,u,f)});const l=bt.InsertMode.bindTo(s);l.set(e.getOption(134).insertMode),this._toDispose.add(this.model.onDidTrigger(()=>l.set(e.getOption(134).insertMode))),this.widget=this._toDispose.add(new v7(Pe(e.getDomNode()),()=>{const h=this._instantiationService.createInstance(jU,this.editor);this._toDispose.add(h),this._toDispose.add(h.onDidSelect(m=>this._insertSuggestion(m,0),this));const u=new Yrt(this.editor,h,this.model,m=>this._insertSuggestion(m,2));this._toDispose.add(u);const f=bt.MakesTextEdit.bindTo(this._contextKeyService),g=bt.HasInsertAndReplaceRange.bindTo(this._contextKeyService),p=bt.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(Re(()=>{f.reset(),g.reset(),p.reset()})),this._toDispose.add(h.onDidFocus(({item:m})=>{const b=this.editor.getPosition(),v=m.editStart.column,w=b.column;let C=!0;this.editor.getOption(1)==="smart"&&this.model.state===2&&!m.completion.additionalTextEdits&&!(m.completion.insertTextRules&4)&&w-v===m.completion.insertText.length&&(C=this.editor.getModel().getValueInRange({startLineNumber:b.lineNumber,startColumn:v,endLineNumber:b.lineNumber,endColumn:w})!==m.completion.insertText),f.set(C),g.set(!U.equals(m.editInsertEnd,m.editReplaceEnd)),p.set(!!m.provider.resolveCompletionItem||!!m.completion.documentation||m.completion.detail!==m.completion.label)})),this._toDispose.add(h.onDetailsKeyDown(m=>{if(m.toKeyCodeChord().equals(new Lg(!0,!1,!1,!1,33))||yt&&m.toKeyCodeChord().equals(new Lg(!1,!1,!1,!0,33))){m.stopPropagation();return}m.toKeyCodeChord().isModifierKey()||this.editor.focus()})),this._wantsForceRenderingAbove&&h.forceRenderingAbove(),h})),this._overtypingCapturer=this._toDispose.add(new v7(Pe(e.getDomNode()),()=>this._toDispose.add(new WU(this.editor,this.model)))),this._alternatives=this._toDispose.add(new v7(Pe(e.getDomNode()),()=>this._toDispose.add(new OS(this.editor,this._contextKeyService)))),this._toDispose.add(o.createInstance(HO,e)),this._toDispose.add(this.model.onDidTrigger(h=>{this.widget.value.showTriggered(h.auto,h.shy?250:50),this._lineSuffix.value=new fat(this.editor.getModel(),h.position)})),this._toDispose.add(this.model.onDidSuggest(h=>{if(h.triggerOptions.shy)return;let u=-1;for(const g of this._selectors.itemsOrderedByPriorityDesc)if(u=g.select(this.editor.getModel(),this.editor.getPosition(),h.completionModel.items),u!==-1)break;if(u===-1&&(u=0),this.model.state===0)return;let f=!1;if(h.triggerOptions.auto){const g=this.editor.getOption(134);g.selectionMode==="never"||g.selectionMode==="always"?f=g.selectionMode==="never":g.selectionMode==="whenTriggerCharacter"?f=h.triggerOptions.triggerKind!==1:g.selectionMode==="whenQuickSuggestion"&&(f=h.triggerOptions.triggerKind===1&&!h.triggerOptions.refilter)}this.widget.value.showSuggestions(h.completionModel,u,h.isFrozen,h.triggerOptions.auto,f)})),this._toDispose.add(this.model.onDidCancel(h=>{h.retrigger||this.widget.value.hideWidget()})),this._toDispose.add(this.editor.onDidBlurEditorWidget(()=>{this.model.cancel(),this.model.clear()}));const c=bt.AcceptSuggestionsOnEnter.bindTo(s),d=()=>{const h=this.editor.getOption(1);c.set(h==="on"||h==="smart")};this._toDispose.add(this.editor.onDidChangeConfiguration(()=>d())),d()}dispose(){this._alternatives.dispose(),this._toDispose.dispose(),this.widget.dispose(),this.model.dispose(),this._lineSuffix.dispose(),this._onWillInsertSuggestItem.dispose()}_insertSuggestion(e,t){var g;if(!e||!e.item){this._alternatives.value.reset(),this.model.cancel(),this.model.clear();return}if(!this.editor.hasModel())return;const i=Xo.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const s=this.editor.getModel(),o=s.getAlternativeVersionId(),{item:r}=e,a=[],l=new Bi;t&1||this.editor.pushUndoStop();const c=this.getOverwriteInfo(r,!!(t&8));this._memoryService.memorize(s,this.editor.getPosition(),r);const d=r.isResolved;let h=-1,u=-1;if(Array.isArray(r.completion.additionalTextEdits)){this.model.cancel();const p=oh.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",r.completion.additionalTextEdits.map(m=>{let b=D.lift(m.range);if(b.startLineNumber===r.position.lineNumber&&b.startColumn>r.position.column){const v=this.editor.getPosition().column-r.position.column,w=v,C=D.spansMultipleLines(b)?0:v;b=new D(b.startLineNumber,b.startColumn+w,b.endLineNumber,b.endColumn+C)}return ln.replaceMove(b,m.text)})),p.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!d){const p=new Ls;let m;const b=s.onDidChangeContent(S=>{if(S.isFlush){l.cancel(),b.dispose();return}for(const L of S.changes){const x=D.getEndPosition(L.range);(!m||U.isBefore(x,m))&&(m=x)}}),v=t;t|=2;let w=!1;const C=this.editor.onWillType(()=>{C.dispose(),w=!0,v&2||this.editor.pushUndoStop()});a.push(r.resolve(l.token).then(()=>{if(!r.completion.additionalTextEdits||l.token.isCancellationRequested)return;if(m&&r.completion.additionalTextEdits.some(L=>U.isBefore(m,D.getStartPosition(L.range))))return!1;w&&this.editor.pushUndoStop();const S=oh.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",r.completion.additionalTextEdits.map(L=>ln.replaceMove(D.lift(L.range),L.text))),S.restoreRelativeVerticalPositionOfCursor(this.editor),(w||!(v&2))&&this.editor.pushUndoStop(),!0}).then(S=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",p.elapsed(),S),u=S===!0?1:S===!1?0:-2}).finally(()=>{b.dispose(),C.dispose()}))}let{insertText:f}=r.completion;if(r.completion.insertTextRules&4||(f=mw.escape(f)),this.model.cancel(),i.insert(f,{overwriteBefore:c.overwriteBefore,overwriteAfter:c.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(r.completion.insertTextRules&1),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value,reason:vo.suggest({providerId:A5.fromExtensionId((g=r.extensionId)==null?void 0:g.value)})}),t&2||this.editor.pushUndoStop(),r.completion.command)if(r.completion.command.id===$O.id)this.model.trigger({auto:!0,retrigger:!0});else{const p=new Ls;a.push(this._commandService.executeCommand(r.completion.command.id,...r.completion.command.arguments?[...r.completion.command.arguments]:[]).catch(m=>{r.completion.extensionId?On(m):Je(m)}).finally(()=>{h=p.elapsed()}))}t&4&&this._alternatives.value.set(e,p=>{for(l.cancel();s.canUndo();){o!==s.getAlternativeVersionId()&&s.undo(),this._insertSuggestion(p,3|(t&8?8:0));break}}),this._alertCompletionItem(r),Promise.all(a).finally(()=>{this._reportSuggestionAcceptedTelemetry(r,s,d,h,u,e.index,e.model.items),this.model.clear(),l.dispose()})}_reportSuggestionAcceptedTelemetry(e,t,i,s,o,r,a){var u;if(Math.random()>1e-4)return;const l=new Map;for(let f=0;f1?c[0]:-1;this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:((u=e.extensionId)==null?void 0:u.value)??"unknown",providerId:e.provider._debugDisplayName??"unknown",kind:e.completion.kind,basenameHash:dD(ic(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:q4e(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:s,additionalEditsAsync:o,index:r,firstIndex:h})}getOverwriteInfo(e,t){Ft(this.editor.hasModel());let i=this.editor.getOption(134).insertMode==="replace";t&&(i=!i);const s=e.position.column-e.editStart.column,o=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column,r=this.editor.getPosition().column-e.position.column,a=this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0;return{overwriteBefore:s+r,overwriteAfter:o+a}}_alertCompletionItem(e){if(Yo(e.completion.additionalTextEdits)){const t=_(1463,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length);vr(t)}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:t??!1,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),this.editor.focus())}triggerSuggestAndAcceptBest(e){if(!this.editor.hasModel())return;const t=this.editor.getPosition(),i=()=>{t.equals(this.editor.getPosition())&&this._commandService.executeCommand(e.fallback)},s=o=>{if(o.completion.insertTextRules&4||o.completion.additionalTextEdits)return!0;const r=this.editor.getPosition(),a=o.editStart.column,l=r.column;return l-a!==o.completion.insertText.length?!0:this.editor.getModel().getValueInRange({startLineNumber:r.lineNumber,startColumn:a,endLineNumber:r.lineNumber,endColumn:l})!==o.completion.insertText};ve.once(this.model.onDidTrigger)(o=>{const r=[];ve.any(this.model.onDidTrigger,this.model.onDidCancel)(()=>{ei(r),i()},void 0,r),this.model.onDidSuggest(({completionModel:a})=>{if(ei(r),a.items.length===0){i();return}const l=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),a.items),c=a.items[l];if(!s(c)){i();return}this.editor.pushUndoStop(),this._insertSuggestion({index:l,item:c,model:a},7)},void 0,r)}),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let s=0;e&&(s|=4),t&&(s|=8),this._insertSuggestion(i,s)}acceptNextSuggestion(){this._alternatives.value.next()}acceptPrevSuggestion(){this._alternatives.value.prev()}cancelSuggestWidget(){this.model.cancel(),this.model.clear(),this.widget.value.hideWidget()}focusSuggestion(){this.widget.value.focusSelected()}selectNextSuggestion(){this.widget.value.selectNext()}selectNextPageSuggestion(){this.widget.value.selectNextPage()}selectLastSuggestion(){this.widget.value.selectLast()}selectPrevSuggestion(){this.widget.value.selectPrevious()}selectPrevPageSuggestion(){this.widget.value.selectPreviousPage()}selectFirstSuggestion(){this.widget.value.selectFirst()}toggleSuggestionDetails(){this.widget.value.toggleDetails()}toggleExplainMode(){this.widget.value.toggleExplainMode()}toggleSuggestionFocus(){this.widget.value.toggleDetailsFocus()}resetWidgetSize(){this.widget.value.resetPersistedSize()}forceRenderingAbove(){this.widget.isInitialized?this.widget.value.forceRenderingAbove():this._wantsForceRenderingAbove=!0}stopForceRenderingAbove(){this.widget.isInitialized?this.widget.value.stopForceRenderingAbove():this._wantsForceRenderingAbove=!1}registerSelector(e){return this._selectors.register(e)}},$U=w1,w1.ID="editor.contrib.suggestController",w1);zd=$U=uat([kC(1,o8),kC(2,ki),kC(3,Xe),kC(4,Ae),kC(5,Li),kC(6,To)],zd);class gat{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(this._items.indexOf(e)!==-1)throw new Error("Value is already registered");return this._items.push(e),this._items.sort((t,i)=>this.prioritySelector(i)-this.prioritySelector(t)),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}const IF=class IF extends Ne{constructor(){super({id:IF.id,label:ie(1471,"Trigger Suggest"),precondition:le.and(H.writable,H.hasCompletionItemProvider,bt.Visible.toNegated()),kbOpts:{kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const s=zd.get(t);if(!s)return;let o;i&&typeof i=="object"&&i.auto===!0&&(o=!0),s.triggerSuggest(void 0,o,void 0)}};IF.id="editor.action.triggerSuggest";let $O=IF;At(zd.ID,zd,2);we($O);const ul=190,Lr=hs.bindToContribution(zd.get);ye(new Lr({id:"acceptSelectedSuggestion",precondition:le.and(bt.Visible,bt.HasFocusedSuggestion),handler(n){n.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:le.and(bt.Visible,H.textInputFocus),weight:ul},{primary:3,kbExpr:le.and(bt.Visible,H.textInputFocus,bt.AcceptSuggestionsOnEnter,bt.MakesTextEdit),weight:ul}],menuOpts:[{menuId:Em,title:_(1464,"Insert"),group:"left",order:1,when:bt.HasInsertAndReplaceRange.toNegated()},{menuId:Em,title:_(1465,"Insert"),group:"left",order:1,when:le.and(bt.HasInsertAndReplaceRange,bt.InsertMode.isEqualTo("insert"))},{menuId:Em,title:_(1466,"Replace"),group:"left",order:1,when:le.and(bt.HasInsertAndReplaceRange,bt.InsertMode.isEqualTo("replace"))}]}));ye(new Lr({id:"acceptAlternativeSelectedSuggestion",precondition:le.and(bt.Visible,H.textInputFocus,bt.HasFocusedSuggestion),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:1027,secondary:[1026]},handler(n){n.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:Em,group:"left",order:2,when:le.and(bt.HasInsertAndReplaceRange,bt.InsertMode.isEqualTo("insert")),title:_(1467,"Replace")},{menuId:Em,group:"left",order:2,when:le.and(bt.HasInsertAndReplaceRange,bt.InsertMode.isEqualTo("replace")),title:_(1468,"Insert")}]}));Rt.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion");ye(new Lr({id:"hideSuggestWidget",precondition:bt.Visible,handler:n=>n.cancelSuggestWidget(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:9,secondary:[1033]}}));ye(new Lr({id:"selectNextSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}}));ye(new Lr({id:"selectNextPageSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectNextPageSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:12,secondary:[2060]}}));ye(new Lr({id:"selectLastSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectLastSuggestion()}));ye(new Lr({id:"selectPrevSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}}));ye(new Lr({id:"selectPrevPageSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectPrevPageSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:11,secondary:[2059]}}));ye(new Lr({id:"selectFirstSuggestion",precondition:le.and(bt.Visible,le.or(bt.MultipleSuggestions,bt.HasFocusedSuggestion.negate())),handler:n=>n.selectFirstSuggestion()}));ye(new Lr({id:"focusSuggestion",precondition:le.and(bt.Visible,bt.HasFocusedSuggestion.negate()),handler:n=>n.focusSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}}));ye(new Lr({id:"focusAndAcceptSuggestion",precondition:le.and(bt.Visible,bt.HasFocusedSuggestion.negate()),handler:n=>{n.focusSuggestion(),n.acceptSelectedSuggestion(!0,!1)}}));ye(new Lr({id:"toggleSuggestionDetails",precondition:le.and(bt.Visible,bt.HasFocusedSuggestion),handler:n=>n.toggleSuggestionDetails(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:Em,group:"right",order:1,when:le.and(bt.DetailsVisible,bt.CanResolve),title:_(1469,"Show Less")},{menuId:Em,group:"right",order:1,when:le.and(bt.DetailsVisible.toNegated(),bt.CanResolve),title:_(1470,"Show More")}]}));ye(new Lr({id:"toggleExplainMode",precondition:bt.Visible,handler:n=>n.toggleExplainMode(),kbOpts:{weight:100,primary:2138}}));ye(new Lr({id:"toggleSuggestionFocus",precondition:bt.Visible,handler:n=>n.toggleSuggestionFocus(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2570,mac:{primary:778}}}));ye(new Lr({id:"insertBestCompletion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),HO.AtEnd,bt.Visible.toNegated(),OS.OtherSuggestions.toNegated(),Xo.InSnippetMode.toNegated()),handler:(n,e)=>{n.triggerSuggestAndAcceptBest(os(e)?{fallback:"tab",...e}:{fallback:"tab"})},kbOpts:{weight:ul,primary:2}}));ye(new Lr({id:"insertNextSuggestion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),OS.OtherSuggestions,bt.Visible.toNegated(),Xo.InSnippetMode.toNegated()),handler:n=>n.acceptNextSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:2}}));ye(new Lr({id:"insertPrevSuggestion",precondition:le.and(H.textInputFocus,le.equals("config.editor.tabCompletion","on"),OS.OtherSuggestions,bt.Visible.toNegated(),Xo.InSnippetMode.toNegated()),handler:n=>n.acceptPrevSuggestion(),kbOpts:{weight:ul,kbExpr:H.textInputFocus,primary:1026}}));we(class extends Ne{constructor(){super({id:"editor.action.resetSuggestSize",label:ie(1472,"Reset Suggest Widget Size"),precondition:void 0})}run(n,e){var t;(t=zd.get(e))==null||t.resetWidgetSize()}});class pat extends G{get selectedItem(){return this._currentSuggestItemInfo}constructor(e,t,i){super(),this.editor=e,this.suggestControllerPreselector=t,this.onWillAccept=i,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._onDidSelectedItemChange=this._register(new q),this.onDidSelectedItemChange=this._onDidSelectedItemChange.event,this._register(e.onKeyDown(o=>{o.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))})),this._register(e.onKeyUp(o=>{o.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))}));const s=zd.get(this.editor);if(s){this._register(s.registerSelector({priority:100,select:(a,l,c)=>{const d=this.editor.getModel();if(!d)return-1;const h=this.suggestControllerPreselector(),u=h?Gf(h,d):void 0;if(!u)return-1;const f=U.lift(l),g=c.map((m,b)=>{const v=Xk.fromSuggestion(s,d,f,m,this.isShiftKeyPressed),w=Gf(v.getSingleTextEdit(),d),C=yCe(u,w);return{index:b,valid:C,prefixLength:w.text.length,suggestItem:m}}).filter(m=>m&&m.valid&&m.prefixLength>0),p=lY(g,co(m=>m.prefixLength,ma));return p?p.index:-1}}));let o=!1;const r=()=>{o||(o=!0,this._register(s.widget.value.onDidShow(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})),this._register(s.widget.value.onDidHide(()=>{this.isSuggestWidgetVisible=!1,this.update(!1)})),this._register(s.widget.value.onDidFocus(()=>{this.isSuggestWidgetVisible=!0,this.update(!0)})))};this._register(ve.once(s.model.onDidTrigger)(a=>{r()})),this._register(s.onWillInsertSuggestItem(a=>{const l=this.editor.getPosition(),c=this.editor.getModel();if(!l||!c)return;const d=Xk.fromSuggestion(s,c,l,a.item,this.isShiftKeyPressed);this.onWillAccept(d)}))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();(this._isActive!==e||!mat(this._currentSuggestItemInfo,t))&&(this._isActive=e,this._currentSuggestItemInfo=t,this._onDidSelectedItemChange.fire())}getSuggestItemInfo(){const e=zd.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),s=this.editor.getModel();if(!(!t||!i||!s))return Xk.fromSuggestion(e,s,i,t.item,this.isShiftKeyPressed)}stopForceRenderingAbove(){const e=zd.get(this.editor);e==null||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=zd.get(this.editor);e==null||e.forceRenderingAbove()}}class Xk{static fromSuggestion(e,t,i,s,o){let{insertText:r}=s.completion,a=!1;if(s.completion.insertTextRules&4){const c=new mw().parse(r);c.children.length<100&&PO.adjustWhitespace(t,i,!0,c),r=c.toString(),a=!0}const l=e.getOverwriteInfo(s,o);return new Xk(D.fromPositions(i.delta(0,-l.overwriteBefore),i.delta(0,Math.max(l.overwriteAfter,0))),r,s.completion.kind,a,s.container.incomplete??!1)}constructor(e,t,i,s,o){this.range=e,this.insertText=t,this.completionItemKind=i,this.isSnippetText=s,this.listIncomplete=o}equals(e){return this.range.equalsRange(e.range)&&this.insertText===e.insertText&&this.completionItemKind===e.completionItemKind&&this.isSnippetText===e.isSnippetText}toSelectedSuggestionInfo(){return new xge(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}getSingleTextEdit(){return new An(this.range,this.insertText)}}function mat(n,e){return n===e?!0:!n||!e?!1:n.equals(e)}class _at extends G{constructor(e,t,i){super(),this._editorObs=e,this._handleSuggestAccepted=t,this._suggestControllerPreselector=i,this._suggestWidgetAdaptor=this._register(new pat(this._editorObs.editor,()=>(this._editorObs.forceUpdate(),this._suggestControllerPreselector()),s=>this._editorObs.forceUpdate(o=>{this._handleSuggestAccepted(s)}))),this.selectedItem=qt(this,s=>this._suggestWidgetAdaptor.onDidSelectedItemChange(()=>{this._editorObs.forceUpdate(o=>s(void 0))}),()=>this._suggestWidgetAdaptor.selectedItem)}stopForceRenderingAbove(){this._suggestWidgetAdaptor.stopForceRenderingAbove()}forceRenderingAbove(){this._suggestWidgetAdaptor.forceRenderingAbove()}}class bat{constructor(e,t){this.lineNumber=e,this.columnRange=t}}class kle{constructor(e,t){if(this.startColumn=e,this.endColumnExclusive=t,e>t)throw new Ve(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new D(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}toZeroBasedOffsetRange(){return new Me(this.startColumn-1,this.endColumnExclusive-1)}}class _v{static fromLineTokens(e){const t=[];for(let i=0;i({text:i.text,metadata:i.metadata})),e)}map(e){const t=[];let i=0;for(const s of this._tokenInfo){const o=new Me(i,i+s.text.length);t.push(e(o,s)),i+=s.text.length}return t}slice(e){const t=[];let i=0;for(const s of this._tokenInfo){const o=i,r=o+s.text.length;if(r>e.start){if(o>=e.endExclusive)break;const a=Math.max(0,e.start-o),l=Math.max(0,r-e.endExclusive);t.push(new Ile(s.text.slice(a,s.text.length-l),s.metadata))}i+=s.text.length}return _v.create(t)}append(e){const t=this._tokenInfo.concat(e._tokenInfo);return _v.create(t)}}class Ile{constructor(e,t){this.text=e,this.metadata=t}}var vat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wat=function(n,e){return function(t,i){e(t,i,n)}};const ICe="ghost-text";var C1;let NN=(C1=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._model=t,this._options=i,this._shouldKeepCursorStable=s,this._isClickable=o,this._languageService=r,this._isDisposed=Ze(this,!1),this._editorObs=$i(this._editor),this._warningState=oe(a=>{const l=this._model.ghostText.read(a);if(!l)return;const c=this._model.warning.read(a);if(c)return{lineNumber:l.lineNumber,position:new U(l.lineNumber,l.parts[0].column),icon:c.icon}}),this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._useSyntaxHighlighting=this._options.map(a=>a.syntaxHighlightingEnabled),this._extraClassNames=oe(this,a=>{const l=[...this._options.read(a).extraClasses??[]];return this._useSyntaxHighlighting.read(a)&&l.push("syntax-highlighted"),this._warningState.read(a)&&l.push("warning"),l.map(d=>` ${d}`).join("")}),this.uiState=oe(this,a=>{var M,A;if(this._isDisposed.read(a))return;const l=this._editorObs.model.read(a);if(l!==this._model.targetTextModel.read(a))return;const c=this._model.ghostText.read(a);if(!c)return;const d=c instanceof EU?c.columnRange:void 0,h=this._useSyntaxHighlighting.read(a),u=this._extraClassNames.read(a),{inlineTexts:f,additionalLines:g,hiddenRange:p,additionalLinesOriginalSuffix:m}=Cat(c,l,ICe+u),b=l.getLineContent(c.lineNumber),v=new Dg(f.map(W=>zs.insert(W.column-1,W.text))),w=h?l.tokenization.tokenizeLinesAt(c.lineNumber,[v.apply(b),...g.map(W=>W.content)]):void 0,C=v.getNewRanges(),S=f.map((W,P)=>{var B;return{...W,tokens:(B=w==null?void 0:w[0])==null?void 0:B.getTokensInRange(C[P])}}),L=g.map((W,P)=>{let B=(w==null?void 0:w[P+1])??vn.createEmpty(W.content,this._languageService.languageIdCodec);if(P===g.length-1&&m){const K=_v.fromLineTokens(l.tokenization.getLineTokens(m.lineNumber)).slice(m.columnRange.toZeroBasedOffsetRange());B=_v.fromLineTokens(B).append(K).toLineTokens(B.languageIdCodec)}return{content:B,decorations:W.decorations}}),x=(M=this._editor.getSelection())==null?void 0:M.getStartPosition().column,I=S.filter(W=>W.text!==""),E=I.length!==0,R={cursorColumnDistance:(E?I[0].column:1)-x,cursorLineDistance:E?0:g.findIndex(W=>W.content!=="")+1,lineCountOriginal:E?1:0,lineCountModified:g.length+(E?1:0),characterCountOriginal:0,characterCountModified:ZM(I.map(W=>W.text.length))+ZM(L.map(W=>W.content.getTextLength())),disjointReplacements:I.length+(g.length>0?1:0),sameShapeReplacements:I.length>1&&L.length===0?I.every(W=>W.text===I[0].text):void 0};return(A=this._model.handleInlineCompletionShown.read(a))==null||A(R),{replacedRange:d,inlineTexts:S,additionalLines:L,hiddenRange:p,lineNumber:c.lineNumber,additionalReservedLineCount:this._model.minReservedLineCount.read(a),targetTextModel:l,syntaxHighlightingEnabled:h}}),this.decorations=oe(this,a=>{const l=this.uiState.read(a);if(!l)return[];const c=[],d=this._extraClassNames.read(a);l.replacedRange&&c.push({range:l.replacedRange.toRange(l.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace"+d,description:"GhostTextReplacement"}}),l.hiddenRange&&c.push({range:l.hiddenRange.toRange(l.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const h of l.inlineTexts)c.push({range:D.fromPositions(new U(l.lineNumber,h.column)),options:{description:"ghost-text-decoration",after:{content:h.text,tokens:h.tokens,inlineClassName:(h.preview?"ghost-text-decoration-preview":"ghost-text-decoration")+(this._isClickable?" clickable":"")+d+h.lineDecorations.map(u=>" "+u.className).join(" "),cursorStops:Wl.Left,attachedData:new f6(this)},showIfCollapsed:!0}});return c}),this._additionalLinesWidget=this._register(new yat(this._editor,oe(a=>{const l=this.uiState.read(a);return l?{lineNumber:l.lineNumber,additionalLines:l.additionalLines,minReservedLineCount:l.additionalReservedLineCount,targetTextModel:l.targetTextModel}:void 0}),this._shouldKeepCursorStable,this._isClickable)),this._isInlineTextHovered=this._editorObs.isTargetHovered(a=>{var l;return a.target.type===6&&((l=a.target.detail.injectedText)==null?void 0:l.options.attachedData)instanceof f6&&a.target.detail.injectedText.options.attachedData.owner===this},this._store),this.isHovered=oe(this,a=>this._isDisposed.read(a)?!1:this._isInlineTextHovered.read(a)||this._additionalLinesWidget.isHovered.read(a)),this.height=oe(this,a=>this._editorObs.getOption(75).read(a)+(this._additionalLinesWidget.viewZoneHeight.read(a)??0)),this._register(Re(()=>{this._isDisposed.set(!0,void 0)})),this._register(this._editorObs.setDecorations(this.decorations)),this._isClickable&&(this._register(this._additionalLinesWidget.onDidClick(a=>this._onDidClick.fire(a))),this._register(this._editor.onMouseUp(a=>{var c;if(a.target.type!==6)return;const l=(c=a.target.detail.injectedText)==null?void 0:c.options.attachedData;l instanceof f6&&l.owner===this&&this._onDidClick.fire(a.event)}))),this._register(ko((a,l)=>{}))}static getWarningWidgetContext(e){const t=e.ghostTextViewWarningWidgetData;if(t)return t;if(e.parentElement)return this.getWarningWidgetContext(e.parentElement)}ownsViewZone(e){return this._additionalLinesWidget.viewZoneId===e}},C1.hot=j3(C1),C1);NN=vat([wat(5,un)],NN);class f6{constructor(e){this.owner=e}}function Cat(n,e,t){const i=[],s=[];function o(h,u){if(s.length>0){const f=s[s.length-1];u&&f.decorations.push(new Ko(f.content.length+1,f.content.length+1+h[0].line.length,u,0)),f.content+=h[0].line,h=h.slice(1)}for(const f of h)s.push({content:f.line,decorations:u?[new Ko(1,f.line.length+1,u,0),...f.lineDecorations]:[...f.lineDecorations]})}const r=e.getLineContent(n.lineNumber);let a,l=0;for(const h of n.parts){let u=h.lines;a===void 0?(i.push({column:h.column,text:u[0].line,preview:h.preview,lineDecorations:u[0].lineDecorations}),u=u.slice(1)):o([{line:r.substring(l,h.column-1),lineDecorations:[]}],void 0),u.length>0&&(o(u,t),a===void 0&&h.column<=r.length&&(a=h.column)),l=h.column-1}let c;a!==void 0&&(c=new bat(n.lineNumber,new kle(l+1,r.length+1)));const d=a!==void 0?new kle(a,r.length+1):void 0;return{inlineTexts:i,additionalLines:s,hiddenRange:d,additionalLinesOriginalSuffix:c}}class yat extends G{get viewZoneId(){var e;return(e=this._viewZoneInfo)==null?void 0:e.viewZoneId}get viewZoneHeight(){return this._viewZoneHeight}constructor(e,t,i,s){super(),this._editor=e,this._lines=t,this._shouldKeepCursorStable=i,this._isClickable=s,this._viewZoneHeight=Ze("viewZoneHeight",void 0),this.editorOptionsChanged=ha("editorOptionChanged",ve.filter(this._editor.onDidChangeConfiguration,o=>o.hasChanged(40)||o.hasChanged(133)||o.hasChanged(113)||o.hasChanged(108)||o.hasChanged(60)||o.hasChanged(59)||o.hasChanged(75))),this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._viewZoneListener=this._register(new Gt),this.isHovered=$i(this._editor).isTargetHovered(o=>Ele(o.target.element),this._store),this.hasBeenAccepted=!1,this._editor instanceof ow&&this._shouldKeepCursorStable&&this._register(this._editor.onBeforeExecuteEdit(o=>this.hasBeenAccepted=o.source==="inlineSuggestion.accept")),this._register(qe(o=>{const r=this._lines.read(o);this.editorOptionsChanged.read(o),r?(this.hasBeenAccepted=!1,this.updateLines(r.lineNumber,r.additionalLines,r.minReservedLineCount)):this.clear()}))}dispose(){super.dispose(),this.clear()}clear(){this._viewZoneListener.clear(),this._editor.changeViewZones(e=>{this.removeActiveViewZone(e)})}updateLines(e,t,i){const s=this._editor.getModel();if(!s)return;const{tabSize:o}=s.getOptions();this._editor.changeViewZones(r=>{const a=new ne;this.removeActiveViewZone(r);const l=Math.max(t.length,i);if(l>0){const c=document.createElement("div");Sat(c,o,t,this._editor.getOptions(),this._isClickable),this._isClickable&&(a.add(J(c,"mousedown",d=>{d.preventDefault()})),a.add(J(c,"click",d=>{Ele(d.target)&&this._onDidClick.fire(new lo(Pe(d),d))}))),this.addViewZone(r,e,l,c)}this._viewZoneListener.value=a})}addViewZone(e,t,i,s){const o=e.addZone({afterLineNumber:t,heightInLines:i,domNode:s,afterColumnAffinity:1,onComputedHeight:r=>{this._viewZoneHeight.set(r,void 0)}});this.keepCursorStable(t,i),this._viewZoneInfo={viewZoneId:o,heightInLines:i,lineNumber:t}}removeActiveViewZone(e){this._viewZoneInfo&&(e.removeZone(this._viewZoneInfo.viewZoneId),this.hasBeenAccepted||this.keepCursorStable(this._viewZoneInfo.lineNumber,-this._viewZoneInfo.heightInLines),this._viewZoneInfo=void 0,this._viewZoneHeight.set(void 0,void 0))}keepCursorStable(e,t){var s,o;if(!this._shouldKeepCursorStable)return;const i=(o=(s=this._editor.getSelection())==null?void 0:s.getStartPosition())==null?void 0:o.lineNumber;i!==void 0&&e`);for(let m=0,b=t.length;m');const C=w.getLineContent(),S=aD(C),L=oS(C);JS(new Vg(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,C,!1,S,L,0,w,v.decorations,e,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,c!==Cg.OFF,null,null,0),f),f.appendString("")}f.appendString(""),Ms(n,d);const g=f.build(),p=Nle?Nle.createHTML(g):g;n.innerHTML=p}const Nle=Ru("editorGhostText",{createHTML:n=>n}),EF=class EF{constructor(e){this.replacements=e,QI(nD(e,(t,i)=>t.lineRange.endLineNumberExclusive<=i.lineRange.startLineNumber))}toString(){return this.replacements.map(e=>e.toString()).join(",")}getNewLineRanges(){const e=[];let t=0;for(const i of this.replacements)e.push(Ye.ofLength(i.lineRange.startLineNumber+t,i.newLines.length)),t+=i.newLines.length-i.lineRange.length;return e}};EF.empty=new EF([]);let UU=EF;class UO{static fromSingleTextEdit(e,t){const i=Ca(e.text);let s=e.range.startLineNumber;const o=t.getValueOfRange(D.fromPositions(new U(e.range.startLineNumber,1),e.range.getStartPosition()));i[0]=o+i[0];let r=e.range.endLineNumber+1;const a=t.getTransformer().getLineLength(e.range.endLineNumber)+1,l=t.getValueOfRange(D.fromPositions(e.range.getEndPosition(),new U(e.range.endLineNumber,a)));i[i.length-1]=i[i.length-1]+l;const c=e.range.startColumn===t.getTransformer().getLineLength(e.range.startLineNumber)+1,d=e.range.endColumn===1;return c&&i[0].length===o.length&&(s++,i.shift()),i.length>0&&s${JSON.stringify(this.newLines)}`}toLineEdit(){return new UU([this])}}class ECe{get lineEdit(){return this.edit.replacements.length===0?new UO(new Ye(1,1),[]):UO.fromSingleTextEdit(this.edit.toReplacement(this.originalText),this.originalText)}get originalLineRange(){return this.lineEdit.lineRange}get modifiedLineRange(){return this.lineEdit.toLineEdit().getNewLineRanges()[0]}get displayRange(){return this.originalText.lineRange.intersect(this.originalLineRange.join(Ye.ofLength(this.originalLineRange.startLineNumber,this.lineEdit.newLines.length)))}constructor(e,t,i,s,o,r){this.originalText=e,this.edit=t,this.cursorPosition=i,this.multiCursorPositions=s,this.commands=o,this.inlineCompletion=r}}class NCe{constructor(e,t,i){this._model=e,this.inlineEdit=t,this.tabAction=i,this.action=this.inlineEdit.inlineCompletion.action,this.displayName=this.inlineEdit.inlineCompletion.source.provider.displayName??_(1219,"Inline Edit"),this.extensionCommands=this.inlineEdit.inlineCompletion.source.inlineSuggestions.commands??[],this.isInDiffEditor=this._model.isInDiffEditor,this.displayLocation=this.inlineEdit.inlineCompletion.hint,this.showCollapsed=this._model.showCollapsed}accept(){this._model.accept()}jump(){this._model.jump()}handleInlineEditShown(e,t){this._model.handleInlineSuggestionShown(this.inlineEdit.inlineCompletion,e,t)}}class xat{constructor(e){this._model=e,this.onDidAccept=this._model.onDidAccept,this.inAcceptFlow=this._model.inAcceptFlow}}class Lat{constructor(e,t,i,s){this.lineRange=i;const o=$i(e),r=oe(this,a=>o.isFocused.read(a)&&s.showInlineEditMenu?yo.Accept:yo.Inactive);this.model=new NCe(t,new ECe(new Gp(""),new ga([s.getSingleTextEdit()]),t.primaryPosition.get(),t.allPositions.get(),s.source.inlineSuggestions.commands??[],s),r)}}class gi{static fromPoints(e,t){return new gi(e.x,e.y,t.x,t.y)}static fromPointSize(e,t){return new gi(e.x,e.y,e.x+t.x,e.y+t.y)}static fromLeftTopRightBottom(e,t,i,s){return new gi(e,t,i,s)}static fromLeftTopWidthHeight(e,t,i,s){return new gi(e,t,e+i,t+s)}static fromRanges(e,t){return new gi(e.start,t.start,e.endExclusive,t.endExclusive)}static hull(e){let t=Number.MAX_SAFE_INTEGER,i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER,o=Number.MIN_SAFE_INTEGER;for(const r of e)t=Math.min(t,r.left),i=Math.min(i,r.top),s=Math.max(s,r.right),o=Math.max(o,r.bottom);return new gi(t,i,s,o)}get width(){return this.right-this.left}get height(){return this.bottom-this.top}constructor(e,t,i,s){if(this.left=e,this.top=t,this.right=i,this.bottom=s,e>i)throw new Ve("Invalid arguments: Horizontally offset by "+(e-i));if(t>s)throw new Ve("Invalid arguments: Vertically offset by "+(t-s))}withMargin(e,t,i,s){let o,r,a,l;return t===void 0&&i===void 0&&s===void 0?o=r=a=l=e:i===void 0&&s===void 0?(o=r=t,a=l=e):(o=s,r=t,a=e,l=i),new gi(this.left-o,this.top-a,this.right+r,this.bottom+l)}intersectVertical(e){const t=Math.max(this.top,e.start),i=Math.min(this.bottom,e.endExclusive);return new gi(this.left,t,this.right,Math.max(t,i))}intersectHorizontal(e){const t=Math.max(this.left,e.start),i=Math.min(this.right,e.endExclusive);return new gi(t,this.top,Math.max(t,i),this.bottom)}toString(){return`Rect{(${this.left},${this.top}), (${this.right},${this.bottom})}`}intersect(e){const t=Math.max(this.left,e.left),i=Math.min(this.right,e.right),s=Math.max(this.top,e.top),o=Math.min(this.bottom,e.bottom);if(!(t>i||s>o))return new gi(t,s,i,o)}containsRect(e){return this.left<=e.left&&this.top<=e.top&&this.right>=e.right&&this.bottom>=e.bottom}containsPoint(e){return this.left<=e.x&&this.top<=e.y&&this.right>=e.x&&this.bottom>=e.y}moveToBeContainedIn(e){const t=this.width,i=this.height;let s=this.left,o=this.top;return se.right&&(s=e.right-t),oe.bottom&&(o=e.bottom-i),new gi(s,o,s+t,o+i)}withWidth(e){return new gi(this.left,this.top,this.left+e,this.bottom)}withHeight(e){return new gi(this.left,this.top,this.right,this.top+e)}withTop(e){return new gi(this.left,e,this.right,this.bottom)}withLeft(e){return new gi(e,this.top,this.right,this.bottom)}translateX(e){return new gi(this.left+e,this.top,this.right+e,this.bottom)}translateY(e){return new gi(this.left,this.top+e,this.right,this.bottom+e)}getLeftBottom(){return new vs(this.left,this.bottom)}getRightBottom(){return new vs(this.right,this.bottom)}getRightTop(){return new vs(this.right,this.top)}toStyles(){return{position:"absolute",left:`${this.left}px`,top:`${this.top}px`,width:`${this.width}px`,height:`${this.height}px`}}}class Qk{constructor(e,t,i,s=null){this.startLineNumbers=e,this.endLineNumbers=t,this.lastLineRelativePosition=i,this.showEndForLine=s}equals(e){return!!e&&this.lastLineRelativePosition===e.lastLineRelativePosition&&this.showEndForLine===e.showEndForLine&&Fi(this.startLineNumbers,e.startLineNumbers)&&Fi(this.endLineNumbers,e.endLineNumbers)}static get Empty(){return new Qk([],[],0)}}const Dle=Ru("stickyScrollViewLayer",{createHTML:n=>n}),g6="data-sticky-line-index",Tle="data-sticky-is-line",kat="data-sticky-is-line-number",Rle="data-sticky-is-folding-icon";class Iat extends G{get height(){return this._height}constructor(e){super(),this._foldingIconStore=this._register(new ne),this._rootDomNode=document.createElement("div"),this._lineNumbersDomNode=document.createElement("div"),this._linesDomNodeScrollable=document.createElement("div"),this._linesDomNode=document.createElement("div"),this._renderedStickyLines=[],this._lineNumbers=[],this._lastLineRelativePosition=0,this._minContentWidthInPx=0,this._isOnGlyphMargin=!1,this._height=-1,this._onDidChangeStickyScrollHeight=this._register(new q),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._editor=e,this._lineHeight=e.getOption(75),this._lineNumbersDomNode.className="sticky-widget-line-numbers",this._lineNumbersDomNode.setAttribute("role","none"),this._linesDomNode.className="sticky-widget-lines",this._linesDomNode.setAttribute("role","list"),this._linesDomNodeScrollable.className="sticky-widget-lines-scrollable",this._linesDomNodeScrollable.appendChild(this._linesDomNode),this._rootDomNode.className="sticky-widget",this._rootDomNode.classList.toggle("peek",e instanceof Pg),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable),this._setHeight(0);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(131).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(131)&&t(),i.hasChanged(75)&&(this._lineHeight=this._editor.getOption(75))})),this._register(this._editor.onDidScrollChange(i=>{i.scrollLeftChanged&&t(),i.scrollWidthChanged&&this._updateWidgetWidth()})),this._register(this._editor.onDidChangeModel(()=>{t(),this._updateWidgetWidth()})),t(),this._register(this._editor.onDidLayoutChange(i=>{this._updateWidgetWidth()})),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getRenderedStickyLine(e){return this._renderedStickyLines.find(t=>t.lineNumber===e)}getCurrentLines(){return this._lineNumbers}setState(e,t,i){const s=!this._state&&!e,o=this._state&&this._state.equals(e);if(i===void 0&&(s||o))return;const r=this._findRenderingData(e),a=this._lineNumbers;this._lineNumbers=r.lineNumbers,this._lastLineRelativePosition=r.lastLineRelativePosition;const l=this._findIndexToRebuildFrom(a,this._lineNumbers,i);this._renderRootNode(this._lineNumbers,this._lastLineRelativePosition,t,l),this._state=e}_findRenderingData(e){if(!e)return{lineNumbers:[],lastLineRelativePosition:0};const t=[...e.startLineNumbers];e.showEndForLine!==null&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]);let i=0;for(let s=0;s!e.includes(o));return s===-1?0:s}_updateWidgetWidth(){const e=this._editor.getLayoutInfo(),t=e.contentLeft;this._lineNumbersDomNode.style.width=`${t}px`,this._linesDomNodeScrollable.style.setProperty("--vscode-editorStickyScroll-scrollableWidth",`${this._editor.getScrollWidth()-e.verticalScrollbarWidth}px`),this._rootDomNode.style.width=`${e.width-e.verticalScrollbarWidth}px`}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._renderedStickyLines){const i=t.foldingIcon;i&&i.setVisible(e?!0:i.isCollapsed)}}async _renderRootNode(e,t,i,s){const o=this._editor._getViewModel();if(!o){this._clearWidget();return}if(e.length===0){this._clearWidget();return}const r=[],a=e[e.length-1];let l=0;for(let d=0;dd.scrollWidth))+c.verticalScrollbarWidth,this._renderedStickyLines=r,this._setHeight(l+t),this._editor.layoutOverlayWidget(this)}_clearWidget(){for(let e=0;e{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)})),this._foldingIconStore.add(J(this._lineNumbersDomNode,_e.MOUSE_LEAVE,()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)})))}_renderChildNode(e,t,i,s,o,r,a){const l=e.coordinatesConverter.convertModelPositionToViewPosition(new U(i,1)).lineNumber,c=e.getViewLineRenderingData(l),d=this._editor.getOption(76),h=this._editor.getOption(117).verticalScrollbarSize;let u;try{u=Ko.filter(c.inlineDecorations,l,c.minColumn,c.maxColumn)}catch{u=[]}const f=this._editor.getLineHeightForPosition(new U(i,1)),g=e.getTextDirection(i),p=new Vg(!0,!0,c.content,c.continuesWithWrappedLine,c.isBasicASCII,c.containsRTL,0,c.tokens,u,c.tabSize,c.startVisibleColumn,1,1,1,500,"none",!0,!0,null,g,h),m=new v_(2e3),b=JS(p,m);let v;Dle?v=Dle.createHTML(m.build()):v=m.build();const w=document.createElement("span");w.setAttribute(g6,String(t)),w.setAttribute(Tle,""),w.setAttribute("role","listitem"),w.tabIndex=0,w.className="sticky-line-content",w.classList.add(`stickyLine${i}`),w.style.lineHeight=`${f}px`,w.innerHTML=v;const C=document.createElement("span");C.setAttribute(g6,String(t)),C.setAttribute(kat,""),C.className="sticky-line-number",C.style.lineHeight=`${f}px`;const S=a.contentLeft;C.style.width=`${S}px`;const L=document.createElement("span");d.renderType===1||d.renderType===3&&i%10===0?L.innerText=i.toString():d.renderType===2&&(L.innerText=Math.abs(i-this._editor.getPosition().lineNumber).toString()),L.className="sticky-line-number-inner",L.style.width=`${a.lineNumbersWidth}px`,L.style.paddingLeft=`${a.lineNumbersLeft}px`,C.appendChild(L);const x=this._renderFoldingIconForLine(r,i);x&&(C.appendChild(x.domNode),x.domNode.style.left=`${a.lineNumbersWidth+a.lineNumbersLeft}px`,x.domNode.style.lineHeight=`${f}px`),this._editor.applyFontInfo(w),this._editor.applyFontInfo(C),C.style.lineHeight=`${f}px`,w.style.lineHeight=`${f}px`,C.style.height=`${f}px`,w.style.height=`${f}px`;const I=new Eat(t,i,w,C,x,b.characterMapping,w.scrollWidth,f);return this._updatePosition(I,s,o)}_updatePosition(e,t,i){var r;const s=e.lineDomNode,o=e.lineNumberDomNode;if(i){const a="0";s.style.zIndex=a,o.style.zIndex=a;const l=`${t+this._lastLineRelativePosition+((r=e.foldingIcon)!=null&&r.isCollapsed?1:0)}px`;s.style.top=l,o.style.top=l}else{const a="1";s.style.zIndex=a,o.style.zIndex=a,s.style.top=`${t}px`,o.style.top=`${t}px`}return e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(126);if(!e||i==="never")return;const s=e.regions,o=s.findRange(t),r=s.getStartLineNumber(o);if(!(t===r))return;const l=s.isCollapsed(o),c=new Nat(l,r,s.getEndLineNumber(o),this._lineHeight);return c.setVisible(this._isOnGlyphMargin?!0:l||i==="always"),c.domNode.setAttribute(Rle,""),c}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:2,stackOridinal:10}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=_S(t.characterMapping,e,0);return new U(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t;return((t=this._getRenderedStickyLineFromChildDomNode(e))==null?void 0:t.lineNumber)??null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return t===null||t<0||t>=this._renderedStickyLines.length?null:this._renderedStickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,g6);return t?parseInt(t,10):null}isInStickyLine(e){return this._getAttributeValue(e,Tle)!==void 0}isInFoldingIconDomNode(e){return this._getAttributeValue(e,Rle)!==void 0}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(i!==null)return i;e=e.parentElement}}}class Eat{constructor(e,t,i,s,o,r,a,l){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=s,this.foldingIcon=o,this.characterMapping=r,this.scrollWidth=a,this.height=l}}class Nat{constructor(e,t,i,s){this.isCollapsed=e,this.foldingStartLine=t,this.foldingEndLine=i,this.dimension=s,this.domNode=document.createElement("div"),this.domNode.style.width="26px",this.domNode.style.height=`${s}px`,this.domNode.style.lineHeight=`${s}px`,this.domNode.className=$e.asClassName(e?yO:CO)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class Jk{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class qO{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class DCe{constructor(e,t,i,s){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=s}}var r8=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DN=function(n,e){return function(t,i){e(t,i,n)}},eI;(function(n){n.OUTLINE_MODEL="outlineModel",n.FOLDING_PROVIDER_MODEL="foldingProviderModel",n.INDENTATION_MODEL="indentationModel"})(eI||(eI={}));var lm;(function(n){n[n.VALID=0]="VALID",n[n.INVALID=1]="INVALID",n[n.CANCELED=2]="CANCELED"})(lm||(lm={}));let qU=class extends G{constructor(e,t,i,s){switch(super(),this._editor=e,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new ec(300)),this._updateOperation=this._register(new ne),this._editor.getOption(131).defaultModel){case eI.OUTLINE_MODEL:this._modelProviders.push(new KU(this._editor,s));case eI.FOLDING_PROVIDER_MODEL:this._modelProviders.push(new YU(this._editor,t,s));case eI.INDENTATION_MODEL:this._modelProviders.push(new GU(this._editor,i));break}}dispose(){this._modelProviders.forEach(e=>e.dispose()),this._updateOperation.clear(),this._cancelModelPromise(),super.dispose()}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}async update(e){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),await this._updateScheduler.trigger(async()=>{for(const t of this._modelProviders){const{statusPromise:i,modelPromise:s}=t.computeStickyModel(e);this._modelPromise=s;const o=await i;if(this._modelPromise!==s)return null;switch(o){case lm.CANCELED:return this._updateOperation.clear(),null;case lm.VALID:return t.stickyModel}}return null}).catch(t=>(Je(t),null))}};qU=r8([DN(2,Ae),DN(3,De)],qU);class TCe extends G{constructor(e){super(),this._editor=e,this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,lm.INVALID}computeStickyModel(e){if(e.isCancellationRequested||!this.isProviderValid())return{statusPromise:this._invalid(),modelPromise:null};const t=rs(i=>this.createModelFromProvider(i));return{statusPromise:t.then(i=>this.isModelValid(i)?e.isCancellationRequested?lm.CANCELED:(this._stickyModel=this.createStickyModel(e,i),lm.VALID):this._invalid()).then(void 0,i=>(Je(i),lm.CANCELED)),modelPromise:t}}isModelValid(e){return!0}isProviderValid(){return!0}}let KU=class extends TCe{constructor(e,t){super(e),this._languageFeaturesService=t}createModelFromProvider(e){return Nf.create(this._languageFeaturesService.documentSymbolProvider,this._editor.getModel(),e)}createStickyModel(e,t){var r;const{stickyOutlineElement:i,providerID:s}=this._stickyModelFromOutlineModel(t,(r=this._stickyModel)==null?void 0:r.outlineProviderId),o=this._editor.getModel();return new DCe(o.uri,o.getVersionId(),i,s)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(Dt.first(e.children.values())instanceof uCe){const a=Dt.find(e.children.values(),l=>l.id===t);if(a)i=a.children;else{let l="",c=-1,d;for(const[h,u]of e.children.entries()){const f=this._findSumOfRangesOfGroup(u);f>c&&(d=u,c=f,l=u.id)}t=l,i=d.children}}else i=e.children;const s=[],o=Array.from(i.values()).sort((a,l)=>{const c=new Jk(a.symbol.range.startLineNumber,a.symbol.range.endLineNumber),d=new Jk(l.symbol.range.startLineNumber,l.symbol.range.endLineNumber);return this._comparator(c,d)});for(const a of o)s.push(this._stickyModelFromOutlineElement(a,a.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new qO(void 0,s,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const o of e.children.values())if(o.symbol.selectionRange.startLineNumber!==o.symbol.range.endLineNumber)if(o.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));else for(const r of o.children.values())i.push(this._stickyModelFromOutlineElement(r,o.symbol.selectionRange.startLineNumber));i.sort((o,r)=>this._comparator(o.range,r.range));const s=new Jk(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new qO(s,i,void 0)}_comparator(e,t){return e.startLineNumber!==t.startLineNumber?e.startLineNumber-t.startLineNumber:t.endLineNumber-e.endLineNumber}_findSumOfRangesOfGroup(e){let t=0;for(const i of e.children.values())t+=this._findSumOfRangesOfGroup(i);return e instanceof yU?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};KU=r8([DN(1,De)],KU);class RCe extends TCe{constructor(e){super(e),this._foldingLimitReporter=this._register(new cCe(e))}createStickyModel(e,t){const i=this._fromFoldingRegions(t),s=this._editor.getModel();return new DCe(s.uri,s.getVersionId(),i,void 0)}isModelValid(e){return e!==null}_fromFoldingRegions(e){const t=e.length,i=[],s=new qO(void 0,[],void 0);for(let o=0;o{this._updateProvider(e,t)})),this._updateProvider(e,t)}_updateProvider(e,t){const i=h_.getFoldingRangeProviders(this._languageFeaturesService,e.getModel());i.length!==0&&(this.provider.value=new $X(e.getModel(),i,t,this._foldingLimitReporter,void 0))}isProviderValid(){return this.provider!==void 0}async createModelFromProvider(e){var t;return((t=this.provider.value)==null?void 0:t.compute(e))??null}};YU=r8([DN(2,De)],YU);var Dat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Mle=function(n,e){return function(t,i){e(t,i,n)}};class Tat{constructor(e,t,i,s){this.startLineNumber=e,this.endLineNumber=t,this.top=i,this.height=s}}let ZU=class extends G{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new q),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new ne),this._updateSoon=this._register(new ai(()=>this.update(),50)),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(131)&&this.readConfiguration()})),this.readConfiguration()}readConfiguration(){this._sessionStore.clear(),this._editor.getOption(131).enabled&&(this._sessionStore.add(this._editor.onDidChangeModel(()=>{this._model=null,this.updateStickyModelProvider(),this._onDidChangeStickyScroll.fire(),this.update()})),this._sessionStore.add(this._editor.onDidChangeHiddenAreas(()=>this.update())),this._sessionStore.add(this._editor.onDidChangeModelContent(()=>this._updateSoon.schedule())),this._sessionStore.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>this.update())),this._sessionStore.add(Re(()=>{var t;(t=this._stickyModelProvider)==null||t.dispose(),this._stickyModelProvider=null})),this.updateStickyModelProvider(),this.update())}getVersionId(){var e;return(e=this._model)==null?void 0:e.version}updateStickyModelProvider(){var e;(e=this._stickyModelProvider)==null||e.dispose(),this._stickyModelProvider=null,this._editor.hasModel()&&(this._stickyModelProvider=new qU(this._editor,()=>this._updateSoon.schedule(),this._languageConfigurationService,this._languageFeaturesService))}async update(){var e;(e=this._cts)==null||e.dispose(!0),this._cts=new Bi,await this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}async updateStickyModel(e){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization()){this._model=null;return}const t=await this._stickyModelProvider.update(e);e.isCancellationRequested||(this._model=t)}getCandidateStickyLinesIntersecting(e){var i;if(!((i=this._model)!=null&&i.element))return[];const t=[];return this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,t,0,0,-1),this.filterHiddenRanges(t)}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,s,o,r){const a=this._editor.getModel();if(!a||t.children.length===0)return;let l=r;const c=[];for(let u=0;uu-f)),h=this.updateIndex(KM(c,e.endLineNumber,(u,f)=>u-f));for(let u=d;u<=h;u++){const f=t.children[u];if(!f||!f.range)continue;const{startLineNumber:g,endLineNumber:p}=f.range;if(p>g+1&&e.startLineNumber<=p+1&&g-1<=e.endLineNumber&&g!==l&&a.isValidRange(new D(g,1,p,1))){l=g;const m=this._editor.getLineHeightForPosition(new U(g,1));i.push(new Tat(g,p-1,o,m)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,f,i,s+1,o+m,g)}}}filterHiddenRanges(e){var i;const t=(i=this._editor._getViewModel())==null?void 0:i.getHiddenAreas();return t?e.filter(s=>!t.some(o=>s.startLineNumber>=o.startLineNumber&&s.endLineNumber<=o.endLineNumber+1)):e}updateIndex(e){return e===-1?0:e<0?-e-2:e}};ZU=Dat([Mle(1,De),Mle(2,qi)],ZU);var Rat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},IC=function(n,e){return function(t,i){e(t,i,n)}},XU,y1;let Xc=(y1=class extends G{constructor(e,t,i,s,o,r,a){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=s,this._contextKeyService=a,this._sessionStore=new ne,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._mouseTarget=null,this._onDidChangeStickyScrollHeight=this._register(new q),this.onDidChangeStickyScrollHeight=this._onDidChangeStickyScrollHeight.event,this._stickyScrollWidget=new Iat(this._editor),this._stickyLineCandidateProvider=new ZU(this._editor,i,o),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=Qk.Empty;const l=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeLineHeight(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeFont(d=>{d.changes.forEach(h=>{const u=h.lineNumber;this._widgetState.startLineNumbers.includes(u)&&this._renderStickyScroll(u)})})),this._register(this._editor.onDidChangeConfiguration(d=>{this._readConfigurationChange(d)})),this._register(J(l,_e.CONTEXT_MENU,async d=>{this._onContextMenu(Pe(l),d)})),this._stickyScrollFocusedContextKey=H.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=H.stickyScrollVisible.bindTo(this._contextKeyService);const c=this._register(tc(l));this._register(c.onDidBlur(d=>{this._positionRevealed===!1&&l.clientHeight===0?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()})),this._register(c.onDidFocus(d=>{this.focus()})),this._registerMouseListeners(),this._register(J(l,_e.MOUSE_DOWN,d=>{this._onMouseDown=!0})),this._register(this._stickyScrollWidget.onDidChangeStickyScrollHeight(d=>{this._onDidChangeStickyScrollHeight.fire(d)})),this._onDidResize(),this._readConfiguration()}get stickyScrollWidgetHeight(){return this._stickyScrollWidget.height}static get(e){return e.getContribution(XU.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),(e=this._focusDisposableStore)==null||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}isFocused(){return this._focused}focus(){if(this._onMouseDown){this._onMouseDown=!1,this._editor.focus();return}this._stickyScrollFocusedContextKey.get()!==!0&&(this._focused=!0,this._focusDisposableStore=new ne,this._stickyScrollFocusedContextKey.set(!0),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumbers.length-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}focusNext(){this._focusedStickyElementIndex0&&this._focusNav(!1)}selectEditor(){this._editor.focus()}_focusNav(e){this._focusedStickyElementIndex=e?this._focusedStickyElementIndex+1:this._focusedStickyElementIndex-1,this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}goToFocused(){const e=this._stickyScrollWidget.lineNumbers;this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:e[this._focusedStickyElementIndex],column:1})}_revealPosition(e){this._reveaInEditor(e,()=>this._editor.revealPosition(e))}_revealLineInCenterIfOutsideViewport(e){this._reveaInEditor(e,()=>this._editor.revealLineInCenterIfOutsideViewport(e.lineNumber,0))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(D.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new ne),t=this._register(new Z3(this._editor,{extractLineNumberFromMouseEvent:o=>{const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);return r?r.lineNumber:0}})),i=o=>{if(!this._editor.hasModel()||o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return null;const r=o.target.element;if(!r||r.innerText!==r.innerHTML)return null;const a=this._stickyScrollWidget.getEditorPositionFromNode(r);return a?{range:new D(a.lineNumber,a.column,a.lineNumber,a.column+r.innerText.length),textElement:r}:null},s=this._stickyScrollWidget.getDomNode();this._register(kn(s,_e.CLICK,o=>{if(o.ctrlKey||o.altKey||o.metaKey||!o.leftButton)return;if(o.shiftKey){const c=this._stickyScrollWidget.getLineIndexFromChildDomNode(o.target);if(c===null)return;const d=new U(this._endLineNumbers[c],1);this._revealLineInCenterIfOutsideViewport(d);return}if(this._stickyScrollWidget.isInFoldingIconDomNode(o.target)){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);this._toggleFoldingRegionForLine(c);return}if(!this._stickyScrollWidget.isInStickyLine(o.target))return;let l=this._stickyScrollWidget.getEditorPositionFromNode(o.target);if(!l){const c=this._stickyScrollWidget.getLineNumberFromChildDomNode(o.target);if(c===null)return;l=new U(c,1)}this._revealPosition(l)})),this._register(J(ri,_e.MOUSE_MOVE,o=>{this._mouseTarget=o.target,this._onMouseMoveOrKeyDown(o)})),this._register(J(ri,_e.KEY_DOWN,o=>{this._onMouseMoveOrKeyDown(o)})),this._register(J(ri,_e.KEY_UP,()=>{this._showEndForLine!==void 0&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._register(t.onMouseMoveOrRelevantKeyDown(([o,r])=>{const a=i(o);if(!a||!o.hasTriggerModifier||!this._editor.hasModel()){e.clear();return}const{range:l,textElement:c}=a;if(!l.equalsRange(this._stickyRangeProjectedOnEditor))this._stickyRangeProjectedOnEditor=l,e.clear();else if(c.style.textDecoration==="underline")return;const d=new Bi;e.add(Re(()=>d.dispose(!0)));let h;HD(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new U(l.startLineNumber,l.startColumn+1),!1,d.token).then(u=>{if(!d.token.isCancellationRequested)if(u.length!==0){this._candidateDefinitionsLength=u.length;const f=c;h!==f?(e.clear(),h=f,h.style.textDecoration="underline",e.add(Re(()=>{h.style.textDecoration="none"}))):h||(h=f,h.style.textDecoration="underline",e.add(Re(()=>{h.style.textDecoration="none"})))}else e.clear()})})),this._register(t.onCancel(()=>{e.clear()})),this._register(t.onExecute(async o=>{if(o.target.type!==12||o.target.detail!==this._stickyScrollWidget.getId())return;const r=this._stickyScrollWidget.getEditorPositionFromNode(o.target.element);r&&(!this._editor.hasModel()||!this._stickyRangeProjectedOnEditor||(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:r.lineNumber,column:1})),this._instaService.invokeFunction(Gwe,o,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor})))}))}_onContextMenu(e,t){const i=new lo(e,t);this._contextMenuService.showContextMenu({menuId:Te.StickyScrollContext,getAnchor:()=>i})}_onMouseMoveOrKeyDown(e){if(!e.shiftKey||!this._mouseTarget||!hn(this._mouseTarget))return;const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(this._mouseTarget);t===null||this._showEndForLine===t||(this._showEndForLine=t,this._renderStickyScroll())}_toggleFoldingRegionForLine(e){if(!this._foldingModel||e===null)return;const t=this._stickyScrollWidget.getRenderedStickyLine(e),i=t==null?void 0:t.foldingIcon;if(!i)return;HX(this._foldingModel,1,[e]),i.isCollapsed=!i.isCollapsed;const s=(i.isCollapsed?this._editor.getTopForLineNumber(i.foldingEndLine):this._editor.getTopForLineNumber(i.foldingStartLine))-this._editor.getOption(75)*t.index+1;this._editor.setScrollTop(s),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(131);if(e.enabled===!1){this._editor.removeOverlayWidget(this._stickyScrollWidget),this._resetState(),this._sessionStore.clear(),this._enabled=!1;return}else e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange(i=>{i.scrollTopChanged&&(this._showEndForLine=void 0,this._renderStickyScroll())})),this._sessionStore.add(this._editor.onDidLayoutChange(()=>this._onDidResize())),this._sessionStore.add(this._editor.onDidChangeModelTokens(i=>this._onTokensChange(i))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll(()=>{this._showEndForLine=void 0,this._renderStickyScroll()})),this._enabled=!0);this._editor.getOption(76).renderType===2&&this._sessionStore.add(this._editor.onDidChangeCursorPosition(()=>{this._showEndForLine=void 0,this._renderStickyScroll(0)}))}_readConfigurationChange(e){(e.hasChanged(131)||e.hasChanged(81)||e.hasChanged(75)||e.hasChanged(126)||e.hasChanged(76))&&this._readConfiguration(),(e.hasChanged(76)||e.hasChanged(52)||e.hasChanged(126))&&this._renderStickyScroll(0)}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const s of e.ranges)if(i>=s.fromLineNumber&&i<=s.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(0)}_onDidResize(){const t=this._editor.getLayoutInfo().height/this._editor.getOption(75);this._maxStickyLines=Math.round(t*.25),this._renderStickyScroll(0)}async _renderStickyScroll(e){const t=this._editor.getModel();if(!t||t.isTooLargeForTokenization()){this._resetState();return}const i=this._updateAndGetMinRebuildFromLine(e),s=this._stickyLineCandidateProvider.getVersionId();if(s===void 0||s===t.getVersionId())if(!this._focused)await this._updateState(i);else if(this._focusedStickyElementIndex===-1)await this._updateState(i),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,this._focusedStickyElementIndex!==-1&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const r=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];await this._updateState(i),this._stickyScrollWidget.lineNumberCount===0?this._focusedStickyElementIndex=-1:(this._stickyScrollWidget.lineNumbers.includes(r)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex))}}_updateAndGetMinRebuildFromLine(e){if(e!==void 0){const t=this._minRebuildFromLine!==void 0?this._minRebuildFromLine:1/0;this._minRebuildFromLine=Math.min(e,t)}return this._minRebuildFromLine}async _updateState(e){var i;this._minRebuildFromLine=void 0,this._foldingModel=await((i=h_.get(this._editor))==null?void 0:i.getFoldingModel())??void 0,this._widgetState=this.findScrollWidgetState();const t=this._widgetState.startLineNumbers.length>0;this._stickyScrollVisibleContextKey.set(t),this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}async _resetState(){this._minRebuildFromLine=void 0,this._foldingModel=void 0,this._widgetState=Qk.Empty,this._stickyScrollVisibleContextKey.set(!1),this._stickyScrollWidget.setState(void 0,void 0)}findScrollWidgetState(){const e=Math.min(this._maxStickyLines,this._editor.getOption(131).maxLineCount),t=this._editor.getScrollTop();let i=0;const s=[],o=[],r=this._editor.getVisibleRanges();if(r.length!==0){const a=new Jk(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const c of l){const d=c.startLineNumber,h=c.endLineNumber,u=c.top,f=u+c.height,g=this._editor.getTopForLineNumber(d)-t,p=this._editor.getBottomForLineNumber(h)-t;if(u>g&&u<=p&&(s.push(d),o.push(h+1),f>p&&(i=p-f)),s.length===e)break}}return this._endLineNumbers=o,new Qk(s,o,i,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}},XU=y1,y1.ID="store.contrib.stickyScrollController",y1);Xc=XU=Rat([IC(1,gl),IC(2,De),IC(3,Ae),IC(4,qi),IC(5,hc),IC(6,Xe)],Xc);const tI=F("inlineEdit.originalBackground",ot(Qp,.2),_(1220,"Background color for the original text in inline edits."),!0),MCe=F("inlineEdit.modifiedBackground",ot(av,.3),_(1221,"Background color for the modified text in inline edits."),!0);F("inlineEdit.originalChangedLineBackground",ot(Qp,.8),_(1222,"Background color for the changed lines in the original text of inline edits."),!0);const Mat=F("inlineEdit.originalChangedTextBackground",ot(Qp,.8),_(1223,"Overlay color for the changed text in the original text of inline edits."),!0),Aat=F("inlineEdit.modifiedChangedLineBackground",{light:ot(jT,.7),dark:ot(jT,.7),hcDark:jT,hcLight:jT},_(1224,"Background color for the changed lines in the modified text of inline edits."),!0),Pat=F("inlineEdit.modifiedChangedTextBackground",ot(av,.7),_(1225,"Overlay color for the changed text in the modified text of inline edits."),!0),Oat=F("inlineEdit.gutterIndicator.primaryForeground",f3,_(1226,"Foreground color for the primary inline edit gutter indicator.")),x0=F("inlineEdit.gutterIndicator.primaryBorder",lv,_(1227,"Border color for the primary inline edit gutter indicator.")),ACe=F("inlineEdit.gutterIndicator.primaryBackground",{light:ot(x0,.5),dark:ot(x0,.4),hcDark:ot(x0,.4),hcLight:ot(x0,.5)},_(1228,"Background color for the primary inline edit gutter indicator.")),Fat=F("inlineEdit.gutterIndicator.secondaryForeground",ume,_(1229,"Foreground color for the secondary inline edit gutter indicator.")),PCe=F("inlineEdit.gutterIndicator.secondaryBorder",FA,_(1230,"Border color for the secondary inline edit gutter indicator.")),OCe=F("inlineEdit.gutterIndicator.secondaryBackground",PCe,_(1231,"Background color for the secondary inline edit gutter indicator.")),Bat=F("inlineEdit.gutterIndicator.successfulForeground",f3,_(1232,"Foreground color for the successful inline edit gutter indicator.")),FCe=F("inlineEdit.gutterIndicator.successfulBorder",lv,_(1233,"Border color for the successful inline edit gutter indicator.")),BCe=F("inlineEdit.gutterIndicator.successfulBackground",FCe,_(1234,"Background color for the successful inline edit gutter indicator.")),Wat=F("inlineEdit.gutterIndicator.background",{hcDark:ot("tab.inactiveBackground",.5),hcLight:ot("tab.inactiveBackground",.5),dark:ot("tab.inactiveBackground",.5),light:"#5f5f5f18"},_(1235,"Background color for the inline edit gutter indicator.")),zL=F("inlineEdit.originalBorder",{light:Qp,dark:Qp,hcDark:Qp,hcLight:Qp},_(1236,"Border color for the original text in inline edits.")),jL=F("inlineEdit.modifiedBorder",{light:Vr(av,.6),dark:av,hcDark:av,hcLight:av},_(1237,"Border color for the modified text in inline edits.")),Hat=F("inlineEdit.tabWillAcceptModifiedBorder",{light:Vr(jL,0),dark:Vr(jL,0),hcDark:Vr(jL,0),hcLight:Vr(jL,0)},_(1238,"Modified border color for the inline edits widget when tab will accept it.")),Vat=F("inlineEdit.tabWillAcceptOriginalBorder",{light:Vr(zL,0),dark:Vr(zL,0),hcDark:Vr(zL,0),hcLight:Vr(zL,0)},_(1239,"Original border color for the inline edits widget over the original text when tab will accept it."));function TN(n){return n.map(e=>e===yo.Accept?Hat:jL)}function a8(n){return n.map(e=>e===yo.Accept?Vat:zL)}function kl(n,e){let t;typeof n=="string"?t=p6(n,e):t=n.map((s,o)=>p6(s,e).read(o));const i=p6(In,e);return t.map((s,o)=>s.makeOpaque(i.read(o)))}function p6(n,e){return Kge({owner:{observeColor:n},equalsFn:(t,i)=>t.equals(i),debugName:()=>`observeColor(${n})`},e.onDidColorThemeChange,()=>{const t=e.getColorTheme().getColor(n);if(!t)throw new Ve(`Missing color: ${n}`);return t})}function cm(n,e,t){n.layoutInfo.read(t),n.value.read(t);const i=n.model.read(t);if(!i)return 0;let s=0;n.scrollTop.read(t);for(let r=e.startLineNumber;ri.getLineContent(r));return s<5&&o.some(r=>r.length>0)&&i.uri.scheme!=="file"&&console.error("unexpected width"),s}function zat(n,e,t){return n.layoutInfo.read(t),n.value.read(t),n.model.read(t)?(n.scrollTop.read(t),n.editor.getOffsetForColumn(e.lineNumber,e.column)):0}function ZX(n,e,t,i,s=void 0){const o=i.getModel();if(!o)return{prefixTrim:0,prefixLeftOffset:0};const r=n.map(u=>u.isSingleLine()?u.startColumn-1:0),a=e.mapToLineArray(u=>VV(o.getLineContent(u))),l=t.filter(u=>u!=="").map(u=>VV(u)),c=Math.min(...r,...a,...l);let d;if(o.getLineIndentColumn(e.startLineNumber)>=c+1)$i(i).scrollTop.read(s),d=i.getOffsetForColumn(e.startLineNumber,c+1);else if(t.length>0)d=XX(t[0].slice(0,c),i,o);else return{prefixTrim:0,prefixLeftOffset:0};return{prefixTrim:c,prefixLeftOffset:d}}function XX(n,e,t){const i=e.getOption(59).typicalHalfwidthCharacterWidth,s=t.getOptions().tabSize*i,o=n.split(" ").length-1;return(n.length-o)*i+o*s}function QX(n){const e=n.layoutInfoContentLeft,t=oe({name:"editor.validOverlay.width"},s=>{const o=n.layoutInfoMinimap.read(s).minimapLeft!==0,r=n.layoutInfoWidth.read(s)-e.read(s);if(o){const a=n.layoutInfoMinimap.read(s).minimapWidth+n.layoutInfoVerticalScrollbarWidth.read(s);return r-a}return r}),i=oe({name:"editor.validOverlay.height"},s=>n.layoutInfoHeight.read(s)+n.contentHeight.read(s));return oe({name:"editor.validOverlay"},s=>gi.fromLeftTopWidthHeight(e.read(s),0,t.read(s),i.read(s)))}function jat(n,e){const t=[];for(const i of n){const s=e.mapRange(i.modifiedRange);t.push(new dr(i.originalRange,s))}return t}function m6(...n){return n.filter(e=>typeof e=="string").join(" ")}function $at(n,e){return new D(e.lineNumber,e.column+n.start,e.lineNumber,e.column+n.endExclusive)}function Uat(n,e){let t=0;e:for(let i=0,s=n.length;iUat(i[r-1],t)),ma);return e.forEach(r=>{const a=qat(i[r-1],o,t);s.push(new An($at(new Me(0,a),new U(r,1)),""))}),new ga(s)}class QU{constructor(){this._data=""}moveTo(e){return this._data+=`M ${e.x} ${e.y} `,this}lineTo(e){return this._data+=`L ${e.x} ${e.y} `,this}build(){return this._data}}function Nu(n){const e=Hg(void 0,(t,i)=>n.read(t)||i);return so({debugName:()=>`${n.debugName}.mapOutFalsy`},t=>{if(e.read(t),!!n.read(t))return e})}function zl(n,e=ds.ofCaller()){return{left:oe({name:"editor.validOverlay.left"},t=>n(t).left,e),top:oe({name:"editor.validOverlay.top"},t=>n(t).top,e),width:oe({name:"editor.validOverlay.width"},t=>n(t).right-n(t).left,e),height:oe({name:"editor.validOverlay.height"},t=>n(t).bottom-n(t).top,e)}}var Gat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_6=function(n,e){return function(t,i){e(t,i,n)}};let JU=class{constructor(e,t,i,s,o,r){this._model=e,this._close=t,this._editorObs=i,this._contextKeyService=s,this._keybindingService=o,this._commandService=r,this._inlineEditsShowCollapsed=this._editorObs.getOption(71).map(a=>a.edits.showCollapsed)}toDisposableLiveElement(){return this._createHoverContent().toDisposableLiveElement()}_createHoverContent(){const e=Ze("active",void 0),t=u=>({title:u.title,icon:u.icon,keybinding:typeof u.commandId=="string"?this._getKeybinding(u.commandArgs?void 0:u.commandId):oe(this,f=>typeof u.commandId=="string"?void 0:this._getKeybinding(u.commandArgs?void 0:u.commandId.read(f)).read(f)),isActive:e.map(f=>f===u.id),onHoverChange:f=>e.set(f?u.id:void 0,void 0),onAction:()=>(this._close(!0),this._commandService.executeCommand(typeof u.commandId=="string"?u.commandId:u.commandId.get(),...u.commandArgs??[]))}),i=Zat(this._model.displayName),s=tb(t({id:"gotoAndAccept",title:`${_(1212,"Go To")} / ${_(1213,"Accept")}`,icon:de.check,commandId:bN})),o=tb(t({id:"reject",title:_(1214,"Reject"),icon:de.close,commandId:vwe})),r=this._model.extensionCommands.map((u,f)=>tb(t({id:u.command.id+"_"+f,title:u.command.title,icon:u.icon??de.symbolEvent,commandId:u.command.id,commandArgs:u.command.arguments}))),a=this._inlineEditsShowCollapsed.map(u=>tb(t(u?{id:"showExpanded",title:_(1215,"Show Expanded"),icon:de.expandAll,commandId:E$}:{id:"showCollapsed",title:_(1216,"Show Collapsed"),icon:de.collapseAll,commandId:E$}))),l=tb(t({id:"snooze",title:_(1217,"Snooze"),icon:de.bellSlash,commandId:"editor.action.inlineSuggest.snooze"})),c=tb(t({id:"settings",title:_(1218,"Settings"),icon:de.gear,commandId:"workbench.action.openSettings",commandArgs:["@tag:nextEditSuggestions"]})),d=this._model.action?[this._model.action]:[],h=d.length>0?Xat(d.map(u=>({id:u.id,label:u.title+"...",enabled:!0,run:()=>this._commandService.executeCommand(u.id,...u.arguments??[]),class:void 0,tooltip:u.tooltip??u.title})),{hoverDelegate:wje}):void 0;return Yat([i,s,o,a,r.length?Ale():void 0,l,c,...r,h?Ale():void 0,h])}_getKeybinding(e){return e?qt(this._contextKeyService.onDidChangeContext,()=>this._keybindingService.lookupKeybinding(e)):wi(void 0)}};JU=Gat([_6(3,Xe),_6(4,Vt),_6(5,ki)],JU);function Yat(n){return ht.div({class:"content",style:{margin:4,minWidth:180}},n)}function Zat(n){return ht.div({class:"header",style:{color:ge(nme),fontSize:"13px",fontWeight:"600",padding:"0 4px",lineHeight:28}},[n])}function tb(n){return oe({name:"inlineEdits.option"},e=>{var t;return ht.div({class:["monaco-menu-option",(t=n.isActive)==null?void 0:t.map(i=>i&&"active")],onmouseenter:()=>{var i;return(i=n.onHoverChange)==null?void 0:i.call(n,!0)},onmouseleave:()=>{var i;return(i=n.onHoverChange)==null?void 0:i.call(n,!1)},onclick:n.onAction,onkeydown:i=>{var s;i.key==="Enter"&&((s=n.onAction)==null||s.call(n))},tabIndex:0,style:{borderRadius:3}},[ht.elem("span",{style:{fontSize:16,display:"flex"}},[$e.isThemeIcon(n.icon)?ih(n.icon):n.icon.map(i=>ih(i))]),ht.elem("span",{},[n.title]),ht.div({style:{marginLeft:"auto"},ref:i=>{const s=e.store.add(new cx(i,ua,{disableTitle:!0,...tve,keybindingLabelShadow:void 0,keybindingLabelForeground:ge(nme),keybindingLabelBackground:"transparent",keybindingLabelBorder:"transparent",keybindingLabelBottomBorder:void 0}));e.store.add(qe(o=>{s.set(n.keybinding.read(o))}))}})])})}function Xat(n,e){return oe({name:"inlineEdits.actionBar"},t=>ht.div({class:["action-widget-action-bar"],style:{padding:"3px 24px"}},[ht.div({ref:i=>{t.store.add(new jr(i,e)).push(n,{icon:!1,label:!0})}})]))}function Ale(){return ht.div({id:"inline-edit-gutter-indicator-menu-separator",class:"menu-separator",style:{color:ge(I7e),padding:"2px 0"}},ht.div({style:{borderBottom:`1px solid ${ge(wY)}`}}))}var Qat=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},K2=function(n,e){return function(t,i){e(t,i,n)}};let eq=class extends G{get model(){const e=this._model.get();if(!e)throw new Ve("Inline Edit Model not available");return e}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._editorObs=e,this._originalRange=t,this._verticalOffset=i,this._model=s,this._isHoveringOverInlineEdit=o,this._focusIsInMenu=r,this._hoverService=a,this._instantiationService=l,this._accessibilityService=c,this._tabAction=oe(this,h=>{const u=this._model.read(h);return u?u.tabAction.read(h):yo.Inactive}),this._hoverVisible=Ze(this,!1),this.isHoverVisible=this._hoverVisible,this._isHoveredOverIcon=Ze(this,!1),this._isHoveredOverIconDebounced=oie(this._isHoveredOverIcon,100),this.isHoveredOverIcon=this._isHoveredOverIconDebounced,this._isHoveredOverInlineEditDebounced=oie(this._isHoveringOverInlineEdit,100),this._gutterIndicatorStyles=this._tabAction.map(this,(h,u)=>{switch(h){case yo.Inactive:return{background:kl(OCe,d).read(u).toString(),foreground:kl(Fat,d).read(u).toString(),border:kl(PCe,d).read(u).toString()};case yo.Jump:return{background:kl(ACe,d).read(u).toString(),foreground:kl(Oat,d).read(u).toString(),border:kl(x0,d).read(u).toString()};case yo.Accept:return{background:kl(BCe,d).read(u).toString(),foreground:kl(Bat,d).read(u).toString(),border:kl(FCe,d).read(u).toString()};default:iD()}}),this._originalRangeObs=Nu(this._originalRange),this._state=oe(this,h=>{const u=this._originalRangeObs.read(h);if(u)return{range:u,lineOffsetRange:this._editorObs.observeLineOffsetRange(u,h.store)}}),this._stickyScrollController=Xc.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?qt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):wi(0),this._lineNumberToRender=oe(this,h=>{var g;if(this._verticalOffset.read(h)!==0)return"";const u=(g=this._originalRange.read(h))==null?void 0:g.startLineNumber,f=this._editorObs.getOption(76).read(h);if(u===void 0||f.renderType===0)return"";if(f.renderType===3){const p=this._editorObs.cursorPosition.read(h);return u%10===0||p&&p.lineNumber===u?u.toString():""}if(f.renderType===2){const p=this._editorObs.cursorPosition.read(h);if(!p)return"";const m=Math.abs(u-p.lineNumber);return m===0?u.toString():m.toString()}return f.renderType===4?f.renderFn?f.renderFn(u):"":u.toString()}),this._availableWidthForIcon=oe(this,h=>{const u=this._editorObs.editor.getModel(),f=this._editorObs.editor,g=this._editorObs.layoutInfo.read(h),p=g.decorationsLeft+g.decorationsWidth-g.glyphMarginLeft;if(!u||p<=0)return()=>0;if(g.lineNumbersLeft===0)return()=>p;const m=this._editorObs.getOption(76).read(h);if(m.renderType===2||m.renderType===0)return()=>p;const b=f.getOption(59).typicalHalfwidthCharacterWidth,v=g.lineNumbersLeft+g.lineNumbersWidth,C=(u.getLineCount()+1).toString().length,S=[];for(let L=1;L<=C;L++){const x=10**(L-1),I=f.getTopForLineNumber(x),E=L*b,R=Math.min(p,Math.max(0,v-E-g.glyphMarginLeft));S.push({firstLineNumberWithDigitCount:x,topOfLineNumber:I,usableWidthLeftOfLineNumber:R})}return L=>{for(let x=S.length-1;x>=0;x--)if(L>=S[x].topOfLineNumber)return S[x].usableWidthLeftOfLineNumber;throw new Ve("Could not find avilable width for icon")}}),this._layout=oe(this,h=>{const u=this._state.read(h);if(!u)return;const f=this._editorObs.layoutInfo.read(h),g=this._editorObs.observeLineHeightForLine(u.range.map(te=>te.startLineNumber)).read(h),p=2,m=f.decorationsLeft+f.decorationsWidth-f.glyphMarginLeft-2*p,b=f.height-2*p,v=gi.fromLeftTopWidthHeight(p,p,m,b),w=v.withTop(this._stickyScrollHeight.read(h)),C=v.withTop(w.top+p),S=u.lineOffsetRange.read(h),L=gi.fromRanges(Me.fromTo(C.left,C.right),S),x=g,I=this._verticalOffset.read(h),E=L.withHeight(x).translateY(I),R=w.containsRect(E),M=this._tabAction.map(te=>te===yo.Accept?de.keyboardTab:de.arrowRight),A=oe(this,te=>{if(this._isHoveredOverIconDebounced.read(te)||this._isHoveredOverInlineEditDebounced.read(te))return de.check;if(this._tabAction.read(te)===yo.Accept)return de.keyboardTab;const ce=this._editorObs.cursorLineNumber.read(te)??0,Ce=u.range.read(te).startLineNumber;return ce<=Ce?de.keyboardTabAbove:de.keyboardTabBelow}),W=22,P=16,B=te=>{const ce=this._availableWidthForIcon.read(void 0)(te.bottom+this._editorObs.editor.getScrollTop())-p;return Math.max(Math.min(ce,W),P)};if(R){const te=E;let ce;f.lineNumbersWidth===0?ce=Math.min(Math.max(f.lineNumbersLeft-v.left,0),te.width-W):ce=Math.max(f.lineNumbersLeft+f.lineNumbersWidth-v.left,0);const Ce=te.withWidth(ce),xe=Math.max(Math.min(f.decorationsWidth,W),P),Be=te.withWidth(xe).translateX(ce);return{gutterEditArea:L,icon:A,iconDirection:"right",iconRect:Be,pillRect:te,lineNumberRect:Ce}}const V=v.intersect(L);if(V&&V.height>=x){const te=E.moveToBeContainedIn(C).moveToBeContainedIn(V),ce=te.withWidth(B(te));return{gutterEditArea:L,icon:A,iconDirection:"right",iconRect:ce,pillRect:ce}}const z=E.moveToBeContainedIn(v),j=z.withWidth(B(z)),X=j,Y=j.top!!h),this._indicator=ht.div({class:"inline-edits-view-gutter-indicator",onclick:()=>{const h=this._layout.get(),u=(h==null?void 0:h.icon.get())===de.check;this._editorObs.editor.focus(),u?this.model.accept():this.model.jump()},tabIndex:0,style:{position:"absolute",overflow:"visible"}},Nu(this._layout).map(h=>h?[ht.div({style:{position:"absolute",background:ge(Wat),borderRadius:"4px",...zl(u=>h.read(u).gutterEditArea)}}),ht.div({class:"icon",ref:this._iconRef,onmouseenter:()=>{this._showHover()},style:{cursor:"pointer",zIndex:"20",position:"absolute",backgroundColor:this._gutterIndicatorStyles.map(u=>u.background),"--vscodeIconForeground":this._gutterIndicatorStyles.map(u=>u.foreground),border:this._gutterIndicatorStyles.map(u=>`1px solid ${u.border}`),boxSizing:"border-box",borderRadius:"4px",display:"flex",justifyContent:"flex-end",transition:"background-color 0.2s ease-in-out, width 0.2s ease-in-out",...zl(u=>h.read(u).pillRect)}},[ht.div({className:"line-number",style:{lineHeight:h.map(u=>u.lineNumberRect?u.lineNumberRect.height:0),display:h.map(u=>u.lineNumberRect?"flex":"none"),alignItems:"center",justifyContent:"flex-end",width:h.map(u=>u.lineNumberRect?u.lineNumberRect.width:0),height:"100%",color:this._gutterIndicatorStyles.map(u=>u.foreground)}},this._lineNumberToRender),ht.div({style:{rotate:h.map(u=>`${Jat(u.iconDirection)}deg`),transition:"rotate 0.2s ease-in-out",display:"flex",alignItems:"center",justifyContent:"center",height:"100%",marginRight:h.map(u=>{var f;return u.pillRect.width-u.iconRect.width-(((f=u.lineNumberRect)==null?void 0:f.width)??0)}),width:h.map(u=>u.iconRect.width)}},[h.map((u,f)=>ih(u.icon.read(f)))])])]:[])).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._indicator.element,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:wi(0)})),this._register(this._editorObs.editor.onMouseMove(h=>{if(this._state.get()===void 0)return;const g=this._iconRef.element.getBoundingClientRect(),p=gi.fromLeftTopWidthHeight(g.left,g.top,g.width,g.height),m=new vs(h.event.posx,h.event.posy);this._isHoveredOverIcon.set(p.containsPoint(m),void 0)})),this._register(this._editorObs.editor.onDidScrollChange(()=>{this._isHoveredOverIcon.set(!1,void 0)})),this._register(Yd(this._isHoveredOverInlineEditDebounced,h=>{h&&this.triggerAnimation()})),this._register(qe(h=>{this._indicator.readEffect(h),this._indicator.element&&this._editorObs.editor.applyFontInfo(this._indicator.element)}))}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{outline:`2px solid ${this._gutterIndicatorStyles.map(t=>t.border).get()}`,outlineOffset:"-1px",offset:0},{outline:"2px solid transparent",outlineOffset:"10px",offset:1}],{duration:500}).finished}_showHover(){if(this._hoverVisible.get())return;const e=new ne,t=e.add(this._instantiationService.createInstance(JU,this.model,o=>{o&&this._editorObs.editor.focus(),s==null||s.dispose()},this._editorObs).toDisposableLiveElement()),i=e.add(tc(t.element));e.add(i.onDidBlur(()=>this._focusIsInMenu.set(!1,void 0))),e.add(i.onDidFocus(()=>this._focusIsInMenu.set(!0,void 0))),e.add(Re(()=>this._focusIsInMenu.set(!1,void 0)));const s=this._hoverService.showInstantHover({target:this._iconRef.element,content:t.element});s?(this._hoverVisible.set(!0,void 0),e.add(this._editorObs.editor.onDidScrollChange(()=>s.dispose())),e.add(s.onDispose(()=>{this._hoverVisible.set(!1,void 0),e.dispose()}))):e.dispose()}};eq=Qat([K2(6,Sr),K2(7,Ae),K2(8,Us),K2(9,en)],eq);function Jat(n){switch(n){case"top":return 90;case"bottom":return-90;case"right":return 0}}var elt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ple=function(n,e){return function(t,i){e(t,i,n)}},Fa;(function(n){n.FirstTime="firstTime",n.SecondTime="secondTime",n.Active="active"})(Fa||(Fa={}));let tq=class extends G{constructor(e,t,i,s,o,r){super(),this._host=e,this._model=t,this._indicator=i,this._collapsedView=s,this._storageService=o,this._configurationService=r,this._disposables=this._register(new Gt),this._setupDone=Ze({name:"setupDone"},!1),this._activeCompletionId=oe(a=>{const l=this._model.read(a);if(!l||!this._setupDone.read(a))return;const c=this._indicator.read(a);if(!(!c||!c.isVisible.read(a)))return l.inlineEdit.inlineCompletion.identity.id}),this._register(this._initializeDebugSetting()),this._disposables.value=this.setupNewUserExperience(),this._setupDone.set(!0,void 0)}setupNewUserExperience(){if(this.getNewUserType()===Fa.Active)return;const e=new ne;let t=!1,i=!1,s=0,o=0;return e.add(tWe(this._activeCompletionId,async(r,a,l,c)=>{var h,u;if(r===void 0)return;let d=this.getNewUserType();switch(d){case Fa.FirstTime:{(s++>=5||t)&&(d=Fa.SecondTime,this.setNewUserType(d));break}case Fa.SecondTime:{o++>=3&&i&&(d=Fa.Active,this.setNewUserType(d));break}}switch(d){case Fa.FirstTime:{for(let f=0;f<3&&!c.isCancellationRequested;f++)await((h=this._indicator.get())==null?void 0:h.triggerAnimation()),await wu(500);break}case Fa.SecondTime:{(u=this._indicator.get())==null||u.triggerAnimation();break}}})),e.add(qe(r=>{this._collapsedView.isVisible.read(r)&&this.getNewUserType()!==Fa.Active&&this._collapsedView.triggerAnimation()})),e.add(ko((r,a)=>{const l=this._indicator.read(r);l&&a.add(Yd(l.isHoveredOverIcon,async c=>{c&&(t=!0)}))})),e.add(ko((r,a)=>{const l=this._host.read(r);l&&a.add(l.onDidAccept(()=>{i=!0}))})),e}getNewUserType(){return this._storageService.get("inlineEditsGutterIndicatorUserKind",-1,Fa.FirstTime)}setNewUserType(e){switch(e){case Fa.FirstTime:throw new Ve("UserKind should not be set to first time");case Fa.SecondTime:break;case Fa.Active:this._disposables.clear();break}this._storageService.store("inlineEditsGutterIndicatorUserKind",e,-1,0)}_initializeDebugSetting(){const e="editor.inlineSuggest.edits.resetNewUserExperience";return this._configurationService.getValue(e)&&this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._configurationService.onDidChangeConfiguration(i=>{i.affectsConfiguration(e)&&this._configurationService.getValue(e)&&(this._storageService.remove("inlineEditsGutterIndicatorUserKind",-1),this._disposables.value=this.setupNewUserExperience())})}};tq=elt([Ple(4,Jo),Ple(5,lt)],tq);var tlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ilt=function(n,e){return function(t,i){e(t,i,n)}};let iq=class extends G{constructor(e,t,i){super(),this._editor=e,this._edit=t,this._accessibilityService=i,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._iconRef=ht.ref(),this.isHovered=wi(!1),this._editorObs=$i(this._editor);const o=this._edit.map(c=>(c==null?void 0:c.edit.replacements[0])??null).map(c=>c?Gf(c,this._editor.getModel()).range.getStartPosition():null),r=this._editorObs.observePosition(o,this._store),a=oe(c=>{const d=r.read(c);if(!d)return null;const h=this._editorObs.layoutInfoContentLeft.read(c),u=this._editorObs.scrollLeft.read(c);return new vs(h+d.x-u,d.y)}),l=ht.div({class:"inline-edits-collapsed-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[[this.getCollapsedIndicator(a)]]).keepUpdated(this._store).element;this._register(this._editorObs.createOverlayWidget({domNode:l,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:wi(0)})),this.isVisible=this._edit.map((c,d)=>!!c&&a.read(d)!==null)}triggerAnimation(){return this._accessibilityService.isMotionReduced()?new Animation(null,null).finished:this._iconRef.element.animate([{offset:0,transform:"translateY(-3px)"},{offset:.2,transform:"translateY(1px)"},{offset:.36,transform:"translateY(-1px)"},{offset:.52,transform:"translateY(1px)"},{offset:.68,transform:"translateY(-1px)"},{offset:.84,transform:"translateY(1px)"},{offset:1,transform:"translateY(0px)"}],{duration:2e3}).finished}getCollapsedIndicator(e){const t=this._editorObs.layoutInfoContentLeft,i=e.map((o,r)=>o?o.deltaX(-t.read(r)):null),s=this.createIconPath(i);return ht.svg({class:"collapsedView",ref:this._iconRef,style:{position:"absolute",...zl(o=>QX(this._editorObs).read(o)),overflow:"hidden",pointerEvents:"none"}},[ht.svgElem("path",{class:"collapsedViewPath",d:s,fill:ge(x0)})])}createIconPath(e){return e.map(o=>{if(!o)return new QU().build();const r=o.deltaX(-6/2).deltaY(-1),a=r.deltaX(6),l=r.deltaY(1),c=a.deltaY(1),d=l.deltaX(6/2).deltaY(3);return new QU().moveTo(r).lineTo(a).lineTo(c).lineTo(d).lineTo(l).lineTo(r).build()})}};iq=tlt([ilt(2,Us)],iq);var nlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ole=function(n,e){return function(t,i){e(t,i,n)}};const G2=14,b6=0,Ju=4,Y2=4,Fle=2;let nq=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._languageService=o,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._isHovered=Ze(this,!1),this.isHovered=this._isHovered,this._viewRef=ht.ref(),this._editorObs=$i(this._editor);const r=i.map((d,h)=>{let u;switch(d){case yo.Inactive:u=OCe;break;case yo.Jump:u=ACe;break;case yo.Accept:u=BCe;break}return{border:kl(u,s).read(h).toString(),background:ge(In)}}),a=t.map(d=>d?this.getState(d):void 0),l=a.map(d=>d?this.getRendering(d,r):void 0);this.minEditorScrollHeight=oe(this,d=>{const h=a.read(d);return h?h.rect.read(d).bottom+this._editor.getScrollTop():0});const c=ht.div({class:"inline-edits-custom-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:"block"}},[l]).keepUpdated(this._store);this._register(this._editorObs.createOverlayWidget({domNode:c.element,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:Hg(this,(d,h)=>{const u=a.read(d);if(!u)return h??0;const f=u.rect.map(g=>g.right).read(d)+this._editorObs.layoutInfoVerticalScrollbarWidth.read(d)+Ju-this._editorObs.layoutInfoContentLeft.read(d);return Math.max(h??0,f)}).recomputeInitiallyAndOnChange(this._store)})),this._register(qe(d=>{if(!l.read(d)){this._isHovered.set(!1,void 0);return}this._isHovered.set(c.isHovered.read(d),void 0)}))}fitsInsideViewport(e,t,i){const s=this._editorObs.layoutInfoWidth.read(i),o=this._editorObs.layoutInfoContentLeft.read(i),r=this._editor.getLayoutInfo().verticalScrollbarWidth,a=this._editorObs.layoutInfoMinimap.read(i).minimapLeft!==0?this._editorObs.layoutInfoMinimap.read(i).minimapWidth:0,l=cm(this._editorObs,e,void 0),c=XX(t,this._editor,this._editor.getModel()),d=Ju+G2;return l+c+d{var v;const l=e.range.startLineNumber,c=e.range.endLineNumber,d=e.range.startColumn,h=e.range.endColumn,u=((v=this._editor.getModel())==null?void 0:v.getLineCount())??0,f=cm(this._editorObs,new Ye(l,l+1),a),g=l+1<=u?cm(this._editorObs,new Ye(l+1,l+2),a):void 0,p=l-1>=1?cm(this._editorObs,new Ye(l-1,l),a):void 0,m=this._editor.getOffsetForColumn(l,d),b=this._editor.getOffsetForColumn(c,h);return{lineWidth:f,lineWidthBelow:g,lineWidthAbove:p,startContentLeftOffset:m,endContentLeftOffset:b}}),i=e.range.startLineNumber,s=e.range.endLineNumber,o=this.fitsInsideViewport(new Ye(i,s+1),e.content,void 0);return{rect:oe(this,a=>{const l=this._editorObs.getOption(59).read(a).typicalHalfwidthCharacterWidth,{lineWidth:c,lineWidthBelow:d,lineWidthAbove:h,startContentLeftOffset:u,endContentLeftOffset:f}=t.read(a),g=this._editorObs.layoutInfoContentLeft.read(a),p=this._editorObs.observeLineHeightForLine(i).recomputeInitiallyAndOnChange(a.store).read(a),m=this._editorObs.scrollTop.read(a),b=this._editorObs.scrollLeft.read(a);let v;i===s&&f+5*l>=c&&o?v="end":d!==void 0&&d+G2-Y2-Juc.withMargin(0,Ju));return ht.div({class:"collapsedView",ref:this._viewRef,style:{position:"absolute",...zl(c=>a.read(c)),overflow:"hidden",boxSizing:"border-box",cursor:"pointer",border:t.map(c=>`1px solid ${c.border}`),borderRadius:"4px",backgroundColor:t.map(c=>c.background),display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"nowrap"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new lo(Pe(c),c))}},[i])}};nq=nlt([Ole(3,en),Ole(4,un)],nq);const slt=0,olt=0,v6=1,rlt=1,alt=3,w6=4;class llt extends G{constructor(e,t,i,s){super(),this._editor=e,this._edit=t,this._uiState=i,this._tabAction=s,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._display=oe(this,a=>this._uiState.read(a)?"block":"none"),this._editorMaxContentWidthInRange=oe(this,a=>{const l=this._originalDisplayRange.read(a);return l?(this._editorObs.versionId.read(a),Hg(this,(c,d)=>{const h=cm(this._editorObs,l,c);return Math.max(h,d??0)})):wi(0)}).map((a,l)=>a.read(l)),this._maxPrefixTrim=oe(this,a=>{const l=this._uiState.read(a);return l?ZX(l.deletions,l.originalRange,[],this._editor):{prefixTrim:0,prefixLeftOffset:0}}),this._editorLayoutInfo=oe(this,a=>{const l=this._edit.read(a);if(!l||!this._uiState.read(a))return null;const d=this._editorObs.layoutInfo.read(a),h=this._editorObs.scrollLeft.read(a),u=this._editorObs.getOption(59).map(w=>w.typicalHalfwidthCharacterWidth).read(a),f=d.contentLeft+Math.max(this._editorMaxContentWidthInRange.read(a),u)-h,g=l.originalLineRange,p=this._originalVerticalStartPosition.read(a)??this._editor.getTopForLineNumber(g.startLineNumber)-this._editorObs.scrollTop.read(a),m=this._originalVerticalEndPosition.read(a)??this._editor.getTopForLineNumber(g.endLineNumberExclusive)-this._editorObs.scrollTop.read(a),b=d.contentLeft+this._maxPrefixTrim.read(a).prefixLeftOffset-h;return f<=b?null:{codeRect:gi.fromLeftTopRightBottom(b,p,f,m).withMargin(olt,slt),contentLeft:d.contentLeft}}).recomputeInitiallyAndOnChange(this._store),this._originalOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,a=>{const l=Nu(this._editorLayoutInfo).read(a);if(!l)return;const c=l.map(f=>gi.fromLeftTopRightBottom(f.contentLeft-w6-v6,f.codeRect.top,f.contentLeft,f.codeRect.bottom)),d=oe(this,f=>{const g=l.read(f).codeRect,p=c.read(f);return g.intersectHorizontal(new Me(p.left,Number.MAX_SAFE_INTEGER))}),h=this._uiState.map(f=>f!=null&&f.inDiffEditor?alt:rlt).read(a),u=d.map(f=>f.withMargin(h,h));return[ht.div({class:"originalSeparatorDeletion",style:{...u.read(a).toStyles(),borderRadius:`${w6}px`,border:`${v6+h}px solid ${ge(In)}`,boxSizing:"border-box"}}),ht.div({class:"originalOverlayDeletion",style:{...d.read(a).toStyles(),borderRadius:`${w6}px`,border:a8(this._tabAction).map(f=>`${v6}px solid ${ge(f)}`),boxSizing:"border-box",backgroundColor:ge(tI)}}),ht.div({class:"originalOverlayHiderDeletion",style:{...c.read(a).toStyles(),backgroundColor:ge(In)}})]})).keepUpdated(this._store),this._nonOverflowView=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._originalOverlay]]).keepUpdated(this._store),this.isHovered=wi(!1),this._editorObs=$i(this._editor);const o=oe(this,a=>{const l=this._edit.read(a);return l?new U(l.originalLineRange.startLineNumber,1):null}),r=oe(this,a=>{const l=this._edit.read(a);return l?new U(l.originalLineRange.endLineNumberExclusive,1):null});this._originalDisplayRange=this._uiState.map(a=>a==null?void 0:a.originalRange),this._originalVerticalStartPosition=this._editorObs.observePosition(o,this._store).map(a=>a==null?void 0:a.y),this._originalVerticalEndPosition=this._editorObs.observePosition(r,this._store).map(a=>a==null?void 0:a.y),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,a=>{const l=this._editorLayoutInfo.read(a);return l===null?0:l.codeRect.width})}))}}var clt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ble=function(n,e){return function(t,i){e(t,i,n)}};const mL=1,dlt=1,hlt=3,C6=4;let sq=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._input=t,this._tabAction=i,this._languageService=o,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._state=oe(this,r=>{const a=this._input.read(r);if(!a)return;const l=this._editor.getModel(),c=l.getEOL();if(a.startColumn===1&&a.lineNumber>1&&l.getLineLength(a.lineNumber)!==0&&a.text.endsWith(c)&&!a.text.startsWith(c)){const d=l.getLineLength(a.lineNumber-1)+1;return{lineNumber:a.lineNumber-1,column:d,text:c+a.text.slice(0,-c.length)}}return{lineNumber:a.lineNumber,column:a.startColumn,text:a.text}}),this._trimVertically=oe(this,r=>{const a=this._state.read(r),l=a==null?void 0:a.text;if(!l||l.trim()==="")return{topOffset:0,bottomOffset:0,linesTop:0,linesBottom:0};const c=this._editor.getLineHeightForPosition(new U(a.lineNumber,1)),d=this._editor.getModel().getEOL();let h=0,u=0,f=0;for(;ff&&l.endsWith(d,g);g-=d.length)u+=1;return{topOffset:h*c,bottomOffset:u*c,linesTop:h,linesBottom:u}}),this._maxPrefixTrim=oe(this,r=>{const a=this._state.read(r);if(!a)return{prefixLeftOffset:0,prefixTrim:0};const l=this._editor.getModel(),c=l.getEOL(),d=this._trimVertically.read(r),h=a.text.split(c),u=h.slice(d.linesTop,h.length-d.linesBottom);d.linesTop===0&&(u[0]=l.getLineContent(a.lineNumber)+u[0]);const f=new Ye(a.lineNumber,a.lineNumber+(d.linesTop>0?0:1));return ZX([],f,u,this._editor)}),this._ghostText=oe(r=>{const a=this._state.read(r),l=this._maxPrefixTrim.read(r);if(!a)return;const d=this._editor.getModel().getEOL(),u=a.text.split(d).map((f,g)=>new Mv(new D(g+1,g===0?1:l.prefixTrim+1,g+1,f.length+1),"modified-background",0));return new IN(a.lineNumber,[new FO(a.column,a.text,!1,u)])}),this._display=oe(this,r=>this._state.read(r)?"block":"none"),this._editorMaxContentWidthInRange=oe(this,r=>{const a=this._state.read(r);if(!a)return 0;this._editorObs.versionId.read(r);const l=this._editor.getModel(),c=l.getEOL(),d=a.text.startsWith(c)?"":l.getValueInRange(new D(a.lineNumber,1,a.lineNumber,a.column)),h=l.getValueInRange(new D(a.lineNumber,a.column,a.lineNumber,l.getLineLength(a.lineNumber)+1)),f=(d+a.text+h).split(c),g=hg.fromEditor(this._editor).withSetWidth(!1).withScrollBeyondLastColumn(0),p=f.map(m=>{var w;const b=(w=l.tokenization.tokenizeLinesAt(a.lineNumber,[m]))==null?void 0:w[0];let v;return b?v=rg.fromLineTokens(b).toLineTokens(m,this._languageService.languageIdCodec):v=vn.createEmpty(m,this._languageService.languageIdCodec),MD(new AD([v]),g,[],me("div"),!0).minWidthInPx});return Math.max(...p)}),this.startLineOffset=this._trimVertically.map(r=>r.topOffset),this.originalLines=this._state.map(r=>r?new Ye(r.lineNumber,Math.min(r.lineNumber+2,this._editor.getModel().getLineCount()+1)):void 0),this._overlayLayout=oe(this,r=>{this._ghostText.read(r);const a=this._state.read(r);if(!a)return null;this._editorObs.observePosition(Ze(this,new U(a.lineNumber,a.column)),r.store).read(r);const l=this._editorObs.layoutInfo.read(r),c=this._editorObs.scrollLeft.read(r),d=this._editorObs.layoutInfoVerticalScrollbarWidth.read(r),h=l.contentLeft+this._editorMaxContentWidthInRange.read(r)-c,u=this._maxPrefixTrim.read(r).prefixLeftOffset??0,f=l.contentLeft+u-c;if(h<=f)return null;const{topOffset:g,bottomOffset:p}=this._trimVertically.read(r),m=this._editorObs.scrollTop.read(r),b=this._ghostTextView.height.read(r)-g-p,v=this._editor.getTopForLineNumber(a.lineNumber)-m+g,w=v+b,C=new gi(f,v,h,w);return{overlay:C,startsAtContentLeft:u===0,contentLeft:l.contentLeft,minContentWidthRequired:u+C.width+d}}).recomputeInitiallyAndOnChange(this._store),this._modifiedOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,r=>{const a=Nu(this._overlayLayout).read(r);if(!a)return;const l=a.map(u=>gi.fromLeftTopRightBottom(u.contentLeft-C6-mL,u.overlay.top,u.contentLeft,u.overlay.bottom)).read(r),c=this._input.map(u=>u!=null&&u.inDiffEditor?hlt:dlt).read(r),d=a.map(u=>u.overlay.withMargin(0,mL,0,u.startsAtContentLeft?0:mL).intersectHorizontal(new Me(l.left,Number.MAX_SAFE_INTEGER))),h=d.map(u=>u.withMargin(c,c));return[ht.div({class:"originalUnderlayInsertion",style:{...h.read(r).toStyles(),borderRadius:C6,border:`${mL+c}px solid ${ge(In)}`,boxSizing:"border-box"}}),ht.div({class:"originalOverlayInsertion",style:{...d.read(r).toStyles(),borderRadius:C6,border:TN(this._tabAction).map(u=>`${mL}px solid ${ge(u)}`),boxSizing:"border-box",backgroundColor:ge(MCe)}}),ht.div({class:"originalOverlayHiderInsertion",style:{...l.toStyles(),backgroundColor:ge(In)}})]})).keepUpdated(this._store),this._view=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[[this._modifiedOverlay]]).keepUpdated(this._store),this._editorObs=$i(this._editor),this._ghostTextView=this._register(s.createInstance(NN,this._editor,{ghostText:this._ghostText,minReservedLineCount:wi(0),targetTextModel:this._editorObs.model.map(r=>r??void 0),warning:wi(void 0),handleInlineCompletionShown:wi(()=>{})},Ze(this,{syntaxHighlightingEnabled:!0,extraClasses:["inline-edit"]}),!0,!0)),this.isHovered=this._ghostTextView.isHovered,this._register(this._ghostTextView.onDidClick(r=>{this._onDidClick.fire(r)})),this._register(this._editorObs.createOverlayWidget({domNode:this._view.element,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,r=>{const a=this._overlayLayout.read(r);return a===null?0:a.minContentWidthRequired})}))}};sq=clt([Ble(3,Ae),Ble(4,un)],sq);var ult=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Wle=function(n,e){return function(t,i){e(t,i,n)}};let oq=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._edit=t,this._isInDiffEditor=i,this._tabAction=s,this._languageService=o,this._themeService=r,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._maxPrefixTrim=this._edit.map((a,l)=>a?ZX(a.replacements.flatMap(c=>[c.originalRange,c.modifiedRange]),a.originalRange,a.modifiedLines,this._editor.editor,l):void 0),this._modifiedLineElements=oe(this,a=>{var m;const l=[];let c=0;const d=this._maxPrefixTrim.read(a),h=this._edit.read(a);if(!h||!d)return;const u=d.prefixTrim,f=flt(h.replacements.map(b=>b.modifiedRange)).map(b=>new D(b.startLineNumber,b.startColumn-u,b.endLineNumber,b.endColumn-u)),g=this._editor.model.get(),p=h.modifiedRange.startLineNumber;for(let b=0;bR.startLineNumber===w)){const R=Math.min(E.endColumn,C.length+1);x.push(new Mv(new D(1,E.startColumn,1,R),"inlineCompletions-modified-bubble",0))}const I=MD(new AD([L]),hg.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),x,v,!0);this._editor.getOption(59).read(a),c=Math.max(c,I.minWidthInPx),l.push(v)}return{lines:l,requiredWidth:c}}),this._layout=oe(this,a=>{const l=this._modifiedLineElements.read(a),c=this._maxPrefixTrim.read(a),d=this._edit.read(a);if(!l||!c||!d)return;const{prefixLeftOffset:h}=c,{requiredWidth:u}=l,f=this._editor.observeLineHeightsForLineRange(d.originalRange).read(a),g=(()=>{const V=f.slice(0,d.modifiedRange.length);for(;V.lengththis._editor.editor.getOffsetForColumn(V,C.getLineMaxColumn(V))-h),L=Math.max(...S,u),x=d.originalRange.startLineNumber,I=d.originalRange.endLineNumberExclusive-1,E=this._editor.editor.getTopForLineNumber(x)-v,R=this._editor.editor.getBottomForLineNumber(I)-v,M=gi.fromLeftTopWidthHeight(w+h,E,L,R-E),A=gi.fromLeftTopWidthHeight(M.left,M.bottom,M.width,g.reduce((V,K)=>V+K,0)),W=gi.hull([M,A]),P=W.intersectVertical(new Me(M.bottom,Number.MAX_SAFE_INTEGER)),B=new gi(P.left,P.top,P.right,P.bottom);return{originalLinesOverlay:M,modifiedLinesOverlay:A,background:W,lowerBackground:P,lowerText:B,modifiedLineHeights:g,minContentWidthRequired:h+L+m}}),this._viewZoneInfo=oe(a=>{if(!this._editor.getOption(71).map(f=>f.edits.allowCodeShifting==="always").read(a))return;const c=this._layout.read(a),d=this._edit.read(a);if(!c||!d)return;const h=c.lowerBackground.height,u=d.originalRange.endLineNumberExclusive;return{height:h,lineNumber:u}}),this.minEditorScrollHeight=oe(this,a=>{const l=Nu(this._layout).read(a);return!l||this._viewZoneInfo.read(a)!==void 0?0:l.read(a).lowerText.bottom+this._editor.editor.getScrollTop()}),this._div=ht.div({class:"line-replacement"},[oe(this,a=>{const l=Nu(this._layout).read(a),c=this._modifiedLineElements.read(a);if(!l||!c)return[];const d=l.read(a),h=this._editor.layoutInfoContentLeft.read(a),u=this._isInDiffEditor.read(a)?3:1;c.lines.forEach((p,m)=>{p.style.width=`${d.lowerText.width}px`,p.style.height=`${d.modifiedLineHeights[m]}px`,p.style.position="relative"});const f=TN(this._tabAction).read(a),g=a8(this._tabAction).read(a);return[ht.div({style:{position:"absolute",...zl(p=>QX(this._editor).read(p)),overflow:"hidden",pointerEvents:"none"}},[ht.div({class:"borderAroundLineReplacement",style:{position:"absolute",...zl(p=>l.read(p).background.translateX(-h).withMargin(u)),borderRadius:"4px",border:`${u+1}px solid ${ge(In)}`,boxSizing:"border-box",pointerEvents:"none"}}),ht.div({class:"originalOverlayLineReplacement",style:{position:"absolute",...zl(p=>l.read(p).background.translateX(-h)),borderRadius:"4px",border:kl(g,this._themeService).map(p=>`1px solid ${p.toString()}`),pointerEvents:"none",boxSizing:"border-box",background:ge(tI)}}),ht.div({class:"modifiedOverlayLineReplacement",style:{position:"absolute",...zl(p=>l.read(p).lowerBackground.translateX(-h)),borderRadius:"0 0 4px 4px",background:ge(In),boxShadow:`${ge(l3)} 0 6px 6px -6px`,border:`1px solid ${ge(f)}`,boxSizing:"border-box",overflow:"hidden",cursor:"pointer",pointerEvents:"auto"},onmousedown:p=>{p.preventDefault()},onclick:p=>this._onDidClick.fire(new lo(Pe(p),p))},[ht.div({style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:ge(Aat)}})]),ht.div({class:"modifiedLinesLineReplacement",style:{position:"absolute",boxSizing:"border-box",...zl(p=>l.read(p).lowerText.translateX(-h)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",whiteSpace:"nowrap",borderRadius:"0 0 4px 4px",overflow:"hidden"}},[...c.lines])])]})]).keepUpdated(this._store),this.isHovered=this._editor.isTargetHovered(a=>this._isMouseOverWidget(a),this._store),this._previousViewZoneInfo=void 0,this._register(Re(()=>this._editor.editor.changeViewZones(a=>this.removePreviousViewZone(a)))),this._register(TOe(this._viewZoneInfo,({lastValue:a,newValue:l})=>{a===l||(a==null?void 0:a.height)===(l==null?void 0:l.height)&&(a==null?void 0:a.lineNumber)===(l==null?void 0:l.lineNumber)||this._editor.editor.changeViewZones(c=>{this.removePreviousViewZone(c),l&&this.addViewZone(l,c)})})),this._register(this._editor.createOverlayWidget({domNode:this._div.element,minContentWidthInPx:oe(this,a=>{var l;return((l=this._layout.read(a))==null?void 0:l.minContentWidthRequired)??0}),position:wi({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}_isMouseOverWidget(e){const t=this._layout.get();return!t||!(e.event instanceof Eg)?!1:t.lowerBackground.containsPoint(new vs(e.event.relativePos.x,e.event.relativePos.y))}removePreviousViewZone(e){if(!this._previousViewZoneInfo)return;e.removeZone(this._previousViewZoneInfo.id);const t=this._editor.cursorLineNumber.get();t!==null&&t>=this._previousViewZoneInfo.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()-this._previousViewZoneInfo.height),this._previousViewZoneInfo=void 0}addViewZone(e,t){const i=t.addZone({afterLineNumber:e.lineNumber-1,heightInPx:e.height,domNode:me("div")});this._previousViewZoneInfo={height:e.height,lineNumber:e.lineNumber,id:i};const s=this._editor.cursorLineNumber.get();s!==null&&s>=e.lineNumber&&this._editor.editor.setScrollTop(this._editor.scrollTop.get()+e.height)}};oq=ult([Wle(4,un),Wle(5,en)],oq);function flt(n){const e=[];for(;n.length;){let t=n.shift();t.startLineNumber!==t.endLineNumber&&(n.push(new D(t.startLineNumber+1,1,t.endLineNumber,t.endColumn)),t=new D(t.startLineNumber,t.startColumn,t.startLineNumber,Number.MAX_SAFE_INTEGER)),e.push(t)}return e}var glt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hle=function(n,e){return function(t,i){e(t,i,n)}};const EC=0,_L=0,ud=1,plt=1,mlt=3,ef=4,y6=20,Vle=12;let KO=class extends G{static fitsInsideViewport(e,t,i,s){const o=$i(e),r=o.layoutInfoWidth.read(s),a=o.layoutInfoContentLeft.read(s),l=e.getLayoutInfo().verticalScrollbarWidth,c=o.layoutInfoMinimap.read(s).minimapLeft!==0?o.layoutInfoMinimap.read(s).minimapWidth:0,d=cm(o,i.displayRange,void 0),h=i.lineEdit.newLines.reduce((g,p)=>Math.max(g,XX(p,e,t)),0),u=y6,f=Vle+2*ud;return d+h+u+fthis._uiState.read(c)?"block":"none"),this.previewRef=ht.ref();const l=this._uiState.map(c=>c!=null&&c.isInDiffEditor?mlt:plt);this._editorContainer=ht.div({class:["editorContainer"],style:{position:"absolute",overflow:"hidden",cursor:"pointer"},onmousedown:c=>{c.preventDefault()},onclick:c=>{this._onDidClick.fire(new lo(Pe(c),c))}},[ht.div({class:"preview",style:{pointerEvents:"none"},ref:this.previewRef})]).keepUpdated(this._store),this.isHovered=this._editorContainer.didMouseMoveDuringHover,this.previewEditor=this._register(this._instantiationService.createInstance(Pg,this.previewRef.element,{glyphMargin:!1,lineNumbers:"off",minimap:{enabled:!1},guides:{indentation:!1,bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveIndentation:!1},rulers:[],padding:{top:0,bottom:0},folding:!1,selectOnLineNumbers:!1,selectionHighlight:!1,columnSelection:!1,overviewRulerBorder:!1,overviewRulerLanes:0,lineDecorationsWidth:0,lineNumbersMinChars:0,revealHorizontalRightPadding:0,bracketPairColorization:{enabled:!0,independentColorPoolPerBracketType:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden",handleMouseWheel:!1},readOnly:!0,wordWrap:"off",wordWrapOverride1:"off",wordWrapOverride2:"off"},{contextKeyValues:{[hi.inInlineEditsPreviewEditor.key]:!0},contributions:[]},this._editor)),this._previewEditorObs=$i(this.previewEditor),this._activeViewZones=[],this._updatePreviewEditor=oe(this,c=>{this._editorContainer.readEffect(c),this._previewEditorObs.model.read(c),this._display.read(c),this._nonOverflowView&&(this._nonOverflowView.element.style.display=this._display.read(c));const d=this._uiState.read(c),h=this._edit.read(c);if(!d||!h)return;const u=h.originalLineRange,f=[];u.startLineNumber>1&&f.push(new D(1,1,u.startLineNumber-1,1)),u.startLineNumber+d.newTextLineCount{g.forEach(b=>m.removeZone(b)),p>0&&this._activeViewZones.push(m.addZone({afterLineNumber:u.startLineNumber+d.newTextLineCount-1,heightInLines:p,showInHiddenAreas:!0,domNode:me("div.diagonal-fill.inline-edits-view-zone")}))})}),this._previewEditorWidth=oe(this,c=>{const d=this._edit.read(c);return d?(this._updatePreviewEditor.read(c),cm(this._previewEditorObs,d.modifiedLineRange,c)):0}),this._cursorPosIfTouchesEdit=oe(this,c=>{const d=this._editorObs.cursorPosition.read(c),h=this._edit.read(c);if(!(!h||!d))return h.modifiedLineRange.contains(d.lineNumber)?d:void 0}),this._originalStartPosition=oe(this,c=>{const d=this._edit.read(c);return d?new U(d.originalLineRange.startLineNumber,1):null}),this._originalEndPosition=oe(this,c=>{const d=this._edit.read(c);return d?new U(d.originalLineRange.endLineNumberExclusive,1):null}),this._originalVerticalStartPosition=this._editorObs.observePosition(this._originalStartPosition,this._store).map(c=>c==null?void 0:c.y),this._originalVerticalEndPosition=this._editorObs.observePosition(this._originalEndPosition,this._store).map(c=>c==null?void 0:c.y),this._originalDisplayRange=this._edit.map(c=>c==null?void 0:c.displayRange),this._editorMaxContentWidthInRange=oe(this,c=>{const d=this._originalDisplayRange.read(c);return d?(this._editorObs.versionId.read(c),Hg(this,(h,u)=>{const f=cm(this._editorObs,d,h);return Math.max(f,u??0)})):wi(0)}).map((c,d)=>c.read(d)),this._previewEditorLayoutInfo=oe(this,c=>{const d=this._edit.read(c);if(!d||!this._uiState.read(c))return null;const u=d.originalLineRange,f=this._editorObs.scrollLeft.read(c),g=this._editorMaxContentWidthInRange.read(c),p=this._editorObs.layoutInfo.read(c),m=this._previewEditorWidth.read(c),b=p.contentWidth-p.verticalScrollbarWidth,v=this._editor.getContainerDomNode().getBoundingClientRect(),w=p.contentLeft+p.contentWidth+v.left,C=Pe(this._editor.getContainerDomNode()).innerWidth-w,S=Pe(this._editor.getContainerDomNode()).innerWidth-v.right,L=Math.min(p.contentWidth*.3,m,100),x=0,I=x+C,E=this._cursorPosIfTouchesEdit.read(c),R=Math.max(b+f-x-Math.max(0,L-I),Math.min(E?zat(this._editorObs,E,c)+50:0,b+f)),M=Math.min(g+y6,R),A=g+y6+m+70,W=R-M;let P,B;M>f?(P=0,B=p.contentLeft+M-f):(P=f-M,B=p.contentLeft);const V=this._originalVerticalStartPosition.read(c)??this._editor.getTopForLineNumber(u.startLineNumber)-this._editorObs.scrollTop.read(c),K=this._originalVerticalEndPosition.read(c)??this._editor.getBottomForLineNumber(u.endLineNumberExclusive-1)-this._editorObs.scrollTop.read(c),z=p.contentLeft-f;let j=gi.fromLeftTopRightBottom(z,V,B,K);const X=j.height===0;X||(j=j.withMargin(_L,EC));const te=this._previewEditorObs.observeLineHeightsForLineRange(d.modifiedLineRange).read(c).reduce((ze,Ct)=>ze+Ct,0),ce=K-V,Ce=Math.max(ce,te),xe=W===0,Be=0,Ee=Math.min(m+Vle,S+p.width-p.contentLeft-Be);let Le=gi.fromLeftTopWidthHeight(j.right+Be,V,Ee,Ce);return X?Le=Le.withMargin(_L,EC).translateY(_L):Le=Le.withMargin(_L,EC).translateX(EC+ud),{codeRect:j,editRect:Le,codeScrollLeft:f,contentLeft:p.contentLeft,isInsertion:X,maxContentWidth:A,shouldShowShadow:xe,desiredPreviewEditorScrollLeft:P,previewEditorWidth:Ee}}),this._stickyScrollController=Xc.get(this._editorObs.editor),this._stickyScrollHeight=this._stickyScrollController?qt(this._stickyScrollController.onDidChangeStickyScrollHeight,()=>this._stickyScrollController.stickyScrollWidgetHeight):wi(0),this._shouldOverflow=oe(this,c=>!1),this._originalBackgroundColor=qt(this,this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme().getColor(tI)??se.transparent),this._backgroundSvg=ht.svg({transform:"translate(-0.5 -0.5)",style:{overflow:"visible",pointerEvents:"none",position:"absolute"}},[ht.svgElem("path",{class:"rightOfModifiedBackgroundCoverUp",d:oe(this,c=>{const d=this._previewEditorLayoutInfo.read(c);if(!(!d||this._originalBackgroundColor.read(c).isTransparent()))return new QU().moveTo(d.codeRect.getRightTop()).lineTo(d.codeRect.getRightTop().deltaX(1e3)).lineTo(d.codeRect.getRightBottom().deltaX(1e3)).lineTo(d.codeRect.getRightBottom()).build()}),style:{fill:Jpe(In,"transparent")}})]).keepUpdated(this._store),this._originalOverlay=ht.div({style:{pointerEvents:"none",display:this._previewEditorLayoutInfo.map(c=>c!=null&&c.isInsertion?"none":"block")}},oe(this,c=>{const d=Nu(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=l.read(c),u=a8(this._tabAction).map(L=>`${ud}px solid ${ge(L)}`),f=`${ud+h}px solid ${ge(In)}`,g=d.read(c).codeScrollLeft!==0,p=d.map(L=>L.codeRect.bottomgi.fromLeftTopRightBottom(L.contentLeft-ef-ud,L.codeRect.top,L.contentLeft,L.codeRect.bottom+m)).read(c),v=new Me(b.left,Number.MAX_SAFE_INTEGER),w=d.map(L=>L.codeRect.intersectHorizontal(v)),C=w.map(L=>L.withMargin(h,0,h,h).intersectHorizontal(v)),S=w.map(L=>gi.fromLeftTopWidthHeight(L.right-m+ud,L.bottom-ud,m,m).intersectHorizontal(v));return[ht.div({class:"originalSeparatorSideBySide",style:{...C.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${ef}px 0 0 ${ef}px`,borderTop:f,borderBottom:f,borderLeft:g?"none":f}}),ht.div({class:"originalOverlaySideBySide",style:{...w.read(c).toStyles(),boxSizing:"border-box",borderRadius:`${ef}px 0 0 ${ef}px`,borderTop:u,borderBottom:u,borderLeft:g?"none":u,backgroundColor:ge(tI)}}),ht.div({class:"originalCornerCutoutSideBySide",style:{pointerEvents:"none",display:p.map(L=>L?"block":"none"),...S.read(c).toStyles()}},[ht.div({class:"originalCornerCutoutBackground",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",backgroundColor:kl(tI,this._themeService).map(L=>L.toString())}}),ht.div({class:"originalCornerCutoutBorder",style:{position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",boxSizing:"border-box",borderTop:u,borderRight:u,borderRadius:"0 100% 0 0",backgroundColor:ge(In)}})]),ht.div({class:"originalOverlaySideBySideHider",style:{...b.toStyles(),backgroundColor:ge(In)}})]})).keepUpdated(this._store),this._modifiedOverlay=ht.div({style:{pointerEvents:"none"}},oe(this,c=>{const d=Nu(this._previewEditorLayoutInfo).read(c);if(!d)return;const h=d.map(w=>w.codeRect.bottom`0 ${ef}px ${ef}px ${w?ef:0}px`),g=kl(TN(this._tabAction),this._themeService).map(w=>`1px solid ${w.toString()}`),p=`${ud+u}px solid ${ge(In)}`,m=d.map(w=>w.editRect.withMargin(0,ud)),b=m.map(w=>w.withMargin(u,u,u,0)),v=oe(this,w=>{const C=m.read(w),S=d.read(w);return!S.isInsertion||S.contentLeft>=C.left?gi.fromLeftTopWidthHeight(C.left,C.top,0,0):new gi(S.contentLeft,C.top,C.left,C.top+ud*2)});return[ht.div({class:"modifiedInsertionSideBySide",style:{...v.read(c).toStyles(),backgroundColor:TN(this._tabAction).map(w=>ge(w))}}),ht.div({class:"modifiedSeparatorSideBySide",style:{...b.read(c).toStyles(),borderRadius:f,borderTop:p,borderBottom:p,borderRight:p,boxSizing:"border-box"}}),ht.div({class:"modifiedOverlaySideBySide",style:{...m.read(c).toStyles(),borderRadius:f,border:g,boxSizing:"border-box",backgroundColor:ge(MCe)}})]})).keepUpdated(this._store),this._nonOverflowView=ht.div({class:"inline-edits-view",style:{position:"absolute",overflow:"visible",top:"0px",left:"0px",display:this._display}},[this._backgroundSvg,oe(this,c=>this._shouldOverflow.read(c)?[]:[this._editorContainer,this._originalOverlay,this._modifiedOverlay])]).keepUpdated(this._store),this._register(this._editorObs.createOverlayWidget({domNode:this._nonOverflowView.element,position:wi(null),allowEditorOverflow:!1,minContentWidthInPx:oe(this,c=>{var h;const d=(h=this._previewEditorLayoutInfo.read(c))==null?void 0:h.maxContentWidth;return d===void 0?0:d})})),this.previewEditor.setModel(this._previewTextModel),this._register(qe(c=>{const d=this._previewEditorLayoutInfo.read(c);if(!d)return;const h=d.editRect.withMargin(-_L,-EC);this.previewEditor.layout({height:h.height,width:d.previewEditorWidth+15}),this._editorContainer.element.style.top=`${h.top}px`,this._editorContainer.element.style.left=`${h.left}px`,this._editorContainer.element.style.width=`${d.previewEditorWidth+EC}px`})),this._register(qe(c=>{const d=this._previewEditorLayoutInfo.read(c);d&&this._previewEditorObs.editor.setScrollLeft(d.desiredPreviewEditorScrollLeft)})),this._updatePreviewEditor.recomputeInitiallyAndOnChange(this._store)}};KO=glt([Hle(5,Ae),Hle(6,en)],KO);var _lt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},blt=function(n,e){return function(t,i){e(t,i,n)}};const tf=1;var Ry;let L0=(Ry=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._edit=t,this._tabAction=i,this._languageService=s,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this._start=this._editor.observePosition(wi(this._edit.range.getStartPosition()),this._store),this._end=this._editor.observePosition(wi(this._edit.range.getEndPosition()),this._store),this._line=document.createElement("div"),this._hoverableElement=Ze(this,null),this.isHovered=this._hoverableElement.map((r,a)=>(r==null?void 0:r.didMouseMoveDuringHover.read(a))??!1),this._renderTextEffect=oe(this,r=>{var g;const a=this._editor.model.get(),l=a.getLineContent(this._edit.range.startLineNumber),c=zs.replace(new Me(this._edit.range.startColumn-1,this._edit.range.endColumn-1),this._edit.text),d=c.replace(l),h=(g=a.tokenization.tokenizeLinesAt(this._edit.range.startLineNumber,[d]))==null?void 0:g[0];let u;h?u=rg.fromLineTokens(h).slice(c.getRangeAfterReplace()).toLineTokens(this._edit.text,this._languageService.languageIdCodec):u=vn.createEmpty(this._edit.text,this._languageService.languageIdCodec);const f=MD(new AD([u]),hg.fromEditor(this._editor.editor).withSetWidth(!1).withScrollBeyondLastColumn(0),[],this._line,!0);this._line.style.width=`${f.minWidthInPx}px`});const o=this._editor.observeLineHeightForPosition(this._edit.range.getStartPosition());this._layout=oe(this,r=>{this._renderTextEffect.read(r);const a=this._start.read(r),l=this._end.read(r);if(!a||!l||a.x>l.x||a.y>l.y)return;const c=o.read(r),d=this._editor.scrollLeft.read(r),h=this._editor.getOption(59).read(r).typicalHalfwidthCharacterWidth,u=3*h,f=4,g=new vs(u,f),p=gi.fromPoints(a,l).withHeight(c).translateX(-d),m=gi.fromPointSize(p.getLeftBottom().add(g),new vs(this._edit.text.length*h,p.height)),b=m.withLeft(p.left);return{originalLine:p,modifiedLine:m,lowerBackground:b,lineHeight:c}}),this.minEditorScrollHeight=oe(this,r=>{const a=Nu(this._layout).read(r);return a?a.read(r).modifiedLine.bottom+tf+this._editor.editor.getScrollTop():0}),this._root=ht.div({class:"word-replacement"},[oe(this,r=>{const a=Nu(this._layout).read(r);if(!a)return[];const l=a8(this._tabAction).map(d=>ge(d)).read(r),c=TN(this._tabAction).map(d=>ge(d)).read(r);return[ht.div({style:{position:"absolute",...zl(d=>QX(this._editor).read(d)),overflow:"hidden",pointerEvents:"none"}},[ht.div({style:{position:"absolute",...zl(d=>a.read(d).lowerBackground.withMargin(tf,2*tf,tf,0)),background:ge(In),cursor:"pointer",pointerEvents:"auto"},onmousedown:d=>{d.preventDefault()},onmouseup:d=>this._onDidClick.fire(new lo(Pe(d),d)),obsRef:d=>{this._hoverableElement.set(d,void 0)}}),ht.div({style:{position:"absolute",...zl(d=>a.read(d).modifiedLine.withMargin(tf,2*tf)),fontFamily:this._editor.getOption(58),fontSize:this._editor.getOption(61),fontWeight:this._editor.getOption(62),pointerEvents:"none",boxSizing:"border-box",borderRadius:"4px",border:`${tf}px solid ${c}`,background:ge(Pat),display:"flex",justifyContent:"center",alignItems:"center",outline:`2px solid ${ge(In)}`}},[this._line]),ht.div({style:{position:"absolute",...zl(d=>a.read(d).originalLine.withMargin(tf)),boxSizing:"border-box",borderRadius:"4px",border:`${tf}px solid ${l}`,background:ge(Mat),pointerEvents:"none"}},[]),ht.svg({width:11,height:14,viewBox:"0 0 11 14",fill:"none",style:{position:"absolute",left:a.map(d=>d.modifiedLine.left-16),top:a.map(d=>d.modifiedLine.top+Math.round((d.lineHeight-14-5)/2))}},[ht.svgElem("path",{d:"M1 0C1 2.98966 1 5.92087 1 8.49952C1 9.60409 1.89543 10.5 3 10.5H10.5",stroke:ge(bne)}),ht.svgElem("path",{d:"M6 7.5L9.99999 10.49998L6 13.5",stroke:ge(bne)})])])]})]).keepUpdated(this._store),this._register(this._editor.createOverlayWidget({domNode:this._root.element,minContentWidthInPx:wi(0),position:wi({preference:{top:0,left:0}}),allowEditorOverflow:!1}))}},Ry.MAX_LENGTH=100,Ry);L0=_lt([blt(3,un)],L0);class vlt extends G{constructor(e,t,i){super(),this._originalEditor=e,this._state=t,this._modifiedTextModel=i,this._onDidClick=this._register(new q),this.onDidClick=this._onDidClick.event,this.isHovered=$i(this._originalEditor).isTargetHovered(o=>{var r;return o.target.type===6&&((r=o.target.detail.injectedText)==null?void 0:r.options.attachedData)instanceof S6&&o.target.detail.injectedText.options.attachedData.owner===this},this._store),this._tokenizationFinished=ylt(this._modifiedTextModel),this._decorations=oe(this,o=>{var L,x;const r=this._state.read(o);if(!r)return;const a=r.modifiedText,l=r.mode==="insertionInline",c=r.diff.length===1&&((L=r.diff[0].innerChanges)==null?void 0:L.length)===1,d=!0,h=[],u=[],f=st.register({className:"inlineCompletions-line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),g=st.register({className:"inlineCompletions-line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),p=st.register({className:"inlineCompletions-char-delete",description:"char-delete",isWholeLine:!1,zIndex:1}),m=st.register({className:"inlineCompletions-char-insert",description:"char-insert",isWholeLine:!0}),b=st.register({className:"inlineCompletions-char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),v=st.register({className:"inlineCompletions-char-insert diff-range-empty",description:"char-insert diff-range-empty"}),w=st.register({className:"inlineCompletions-original-lines",description:"inlineCompletions-original-lines",isWholeLine:!1,shouldFillLineOnLineBreak:!0}),C=r.mode!=="sideBySide"&&r.mode!=="deletion"&&r.mode!=="insertionInline"&&r.mode!=="lineReplacement",S=r.mode==="lineReplacement";for(const I of r.diff)if(C&&(I.original.isEmpty||h.push({range:I.original.toInclusiveRange(),options:g}),I.modified.isEmpty||u.push({range:I.modified.toInclusiveRange(),options:f})),I.modified.isEmpty||I.original.isEmpty)I.original.isEmpty||h.push({range:I.original.toInclusiveRange(),options:p}),I.modified.isEmpty||u.push({range:I.modified.toInclusiveRange(),options:m});else{const E=l&&wlt(I);for(const R of I.innerChanges||[]){if(I.original.contains(R.originalRange.startLineNumber)&&!(S&&R.originalRange.isEmpty())){const M=(x=this._originalEditor.getModel())==null?void 0:x.getValueInRange(R.originalRange,1);h.push({range:R.originalRange,options:{description:"char-delete",shouldFillLineOnLineBreak:!1,className:m6("inlineCompletions-char-delete",R.originalRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",R.originalRange.isEmpty()&&"empty",(R.originalRange.isEmpty()&&c||r.mode==="deletion"&&M===` +`)&&d&&!E&&"diff-range-empty"),inlineClassName:E?m6("strike-through","inlineCompletions"):null,zIndex:1}})}if(I.modified.contains(R.modifiedRange.startLineNumber)&&u.push({range:R.modifiedRange,options:R.modifiedRange.isEmpty()&&d&&!E&&c?v:b}),E){const M=a.getValueOfRange(R.modifiedRange),A=M.length>3?[{text:M.slice(0,1),extraClasses:["start"],offsetRange:new Me(R.modifiedRange.startColumn-1,R.modifiedRange.startColumn)},{text:M.slice(1,-1),extraClasses:[],offsetRange:new Me(R.modifiedRange.startColumn,R.modifiedRange.endColumn-2)},{text:M.slice(-1),extraClasses:["end"],offsetRange:new Me(R.modifiedRange.endColumn-2,R.modifiedRange.endColumn-1)}]:[{text:M,extraClasses:["start","end"],offsetRange:new Me(R.modifiedRange.startColumn-1,R.modifiedRange.endColumn)}];this._tokenizationFinished.read(o);const W=this._modifiedTextModel.tokenization.getLineTokens(R.modifiedRange.startLineNumber);for(const{text:P,extraClasses:B,offsetRange:V}of A)h.push({range:D.fromPositions(R.originalRange.getEndPosition()),options:{description:"inserted-text",before:{tokens:W.getTokensInRange(V),content:P,inlineClassName:m6("inlineCompletions-char-insert",R.modifiedRange.isSingleLine()&&r.mode==="insertionInline"&&"single-line-inline",...B),cursorStops:Wl.None,attachedData:new S6(this)},zIndex:2,showIfCollapsed:!0}})}}}if(r.isInDiffEditor)for(const I of r.diff)I.original.isEmpty||h.push({range:I.original.toExclusiveRange(),options:w});return{originalDecorations:h,modifiedDecorations:u}}),this._register($i(this._originalEditor).setDecorations(this._decorations.map(o=>(o==null?void 0:o.originalDecorations)??[])));const s=this._state.map(o=>o==null?void 0:o.modifiedCodeEditor);this._register(ko((o,r)=>{const a=s.read(o);a&&r.add($i(a).setDecorations(this._decorations.map(l=>(l==null?void 0:l.modifiedDecorations)??[])))})),this._register(this._originalEditor.onMouseUp(o=>{var a;if(o.target.type!==6)return;const r=(a=o.target.detail.injectedText)==null?void 0:a.options.attachedData;r instanceof S6&&r.owner===this&&this._onDidClick.fire(o.event)}))}}class S6{constructor(e){this.owner=e}}function wlt(n){return n.innerChanges?n.innerChanges.every(e=>GP(e.modifiedRange)&&GP(e.originalRange)):!1}let Clt=0;function ylt(n){return qt(n.onDidChangeTokens,()=>Clt++)}var Slt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xlt=function(n,e){return function(t,i){e(t,i,n)}};let rq=class extends G{constructor(e,t,i,s,o,r){super(),this._editor=e,this._host=t,this._model=i,this._ghostTextIndicator=s,this._focusIsInMenu=o,this._instantiationService=r,this._editorObs=$i(this._editor),this._tabAction=oe(d=>{var h;return((h=this._model.read(d))==null?void 0:h.tabAction.read(d))??yo.Inactive}),this._constructorDone=Ze(this,!1),this._uiState=oe(this,d=>{var v,w;const h=this._model.read(d);if(!h||!this._constructorDone.read(d))return;const u=h.inlineEdit;let f=dr.fromEdit(u.edit),g=u.edit.apply(u.originalText),p=xA(f,u.originalText,new Gp(g)),m=this.determineRenderState(h,d,p,new Gp(g));if(!m){Je(new Error(`unable to determine view: tried to render ${(v=this._previousView)==null?void 0:v.view}`));return}if(m.kind===$t.SideBySide){const C=Kat(g,u.modifiedLineRange,l.getOptions().tabSize);g=C.applyToString(g),f=jat(f,C),p=xA(f,u.originalText,new Gp(g))}return this._previewTextModel.setLanguage(this._editor.getModel().getLanguageId()),this._previewTextModel.getValue()!==g&&this._previewTextModel.setValue(g),h.showCollapsed.read(d)&&!((w=this._indicator.read(d))!=null&&w.isHoverVisible.read(d))&&(m={kind:$t.Collapsed,viewData:m.viewData}),h.handleInlineEditShown(m.kind,m.viewData),{state:m,diff:p,edit:u,newText:g,newTextLineCount:u.modifiedLineRange.length,isInDiffEditor:h.isInDiffEditor}}),this._previewTextModel=this._register(this._instantiationService.createInstance(sw,"",this._editor.getModel().getLanguageId(),{...sw.DEFAULT_CREATION_OPTIONS,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},null)),this._indicatorCyclicDependencyCircuitBreaker=Ze(this,!1),this._indicator=oe(this,d=>{if(!this._indicatorCyclicDependencyCircuitBreaker.read(d))return;const h=so({owner:this,equalsFn:nv(qG())},f=>{var m,b,v;const g=this._ghostTextIndicator.read(f);if(g)return g.lineRange;const p=this._uiState.read(f);if(p){if(((m=p.state)==null?void 0:m.kind)==="custom"){const w=(b=p.state.displayLocation)==null?void 0:b.range;if(!w)throw new Ve("custom view should have a range");return new Ye(w.startLineNumber,w.endLineNumber)}return((v=p.state)==null?void 0:v.kind)==="insertionMultiLine"?this._insertion.originalLines.read(f):p.edit.displayRange}}),u=oe(this,f=>{const g=this._model.read(f);if(g)return g;const p=this._ghostTextIndicator.read(f);return p?p.model:g});return d.store.add(this._instantiationService.createInstance(eq,this._editorObs,h,this._gutterIndicatorOffset,u,this._inlineEditsIsHovered,this._focusIsInMenu))}),this._inlineEditsIsHovered=oe(this,d=>this._sideBySide.isHovered.read(d)||this._wordReplacementViews.read(d).some(h=>h.isHovered.read(d))||this._deletion.isHovered.read(d)||this._inlineDiffView.isHovered.read(d)||this._lineReplacementView.isHovered.read(d)||this._insertion.isHovered.read(d)||this._customView.isHovered.read(d)),this._gutterIndicatorOffset=oe(this,d=>{var u,f;if(((f=(u=this._uiState.read(d))==null?void 0:u.state)==null?void 0:f.kind)==="insertionMultiLine")return this._insertion.startLineOffset.read(d);const h=this._ghostTextIndicator.read(d);return h?Ilt(h,this._editor):0}),this._sideBySide=this._register(this._instantiationService.createInstance(KO,this._editor,this._model.map(d=>d==null?void 0:d.inlineEdit),this._previewTextModel,this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===$t.SideBySide?{newTextLineCount:d.newTextLineCount,isInDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._deletion=this._register(this._instantiationService.createInstance(llt,this._editor,this._model.map(d=>d==null?void 0:d.inlineEdit),this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===$t.Deletion?{originalRange:d.state.originalRange,deletions:d.state.deletions,inDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._insertion=this._register(this._instantiationService.createInstance(sq,this._editor,this._uiState.map(d=>{var h;return d&&((h=d.state)==null?void 0:h.kind)===$t.InsertionMultiLine?{lineNumber:d.state.lineNumber,startColumn:d.state.column,text:d.state.text,inDiffEditor:d.isInDiffEditor}:void 0}),this._tabAction)),this._inlineDiffViewState=oe(this,d=>{const h=this._uiState.read(d);if(!(!h||!h.state)&&!(h.state.kind==="wordReplacements"||h.state.kind==="insertionMultiLine"||h.state.kind==="collapsed"||h.state.kind==="custom"))return{modifiedText:new Gp(h.newText),diff:h.diff,mode:h.state.kind,modifiedCodeEditor:this._sideBySide.previewEditor,isInDiffEditor:h.isInDiffEditor}}),this._inlineCollapsedView=this._register(this._instantiationService.createInstance(iq,this._editor,this._model.map((d,h)=>{var u,f;return((f=(u=this._uiState.read(h))==null?void 0:u.state)==null?void 0:f.kind)==="collapsed"?d==null?void 0:d.inlineEdit:void 0}))),this._customView=this._register(this._instantiationService.createInstance(nq,this._editor,this._model.map((d,h)=>{var u,f;return((f=(u=this._uiState.read(h))==null?void 0:u.state)==null?void 0:f.kind)==="custom"?d==null?void 0:d.displayLocation:void 0}),this._tabAction)),this._inlineDiffView=this._register(new vlt(this._editor,this._inlineDiffViewState,this._previewTextModel)),this._wordReplacementViews=YG(this,this._uiState.map(d=>{var h;return((h=d==null?void 0:d.state)==null?void 0:h.kind)==="wordReplacements"?d.state.replacements:[]}),(d,h)=>h.add(this._instantiationService.createInstance(L0,this._editorObs,d,this._tabAction))),this._lineReplacementView=this._register(this._instantiationService.createInstance(oq,this._editorObs,this._uiState.map(d=>{var h;return((h=d==null?void 0:d.state)==null?void 0:h.kind)===$t.LineReplacement?{originalRange:d.state.originalRange,modifiedRange:d.state.modifiedRange,modifiedLines:d.state.modifiedLines,replacements:d.state.replacements}:void 0}),this._uiState.map(d=>(d==null?void 0:d.isInDiffEditor)??!1),this._tabAction)),this._useCodeShifting=this._editorObs.getOption(71).map(d=>d.edits.allowCodeShifting),this._renderSideBySide=this._editorObs.getOption(71).map(d=>d.edits.renderSideBySide),this._register(ko((d,h)=>{const u=this._model.read(d);u&&h.add(ve.any(this._sideBySide.onDidClick,this._deletion.onDidClick,this._lineReplacementView.onDidClick,this._insertion.onDidClick,...this._wordReplacementViews.read(d).map(f=>f.onDidClick),this._inlineDiffView.onDidClick,this._customView.onDidClick)(f=>{this._viewHasBeenShownLongerThan(350)&&(f.preventDefault(),u.accept())}))})),this._indicator.recomputeInitiallyAndOnChange(this._store),this._wordReplacementViews.recomputeInitiallyAndOnChange(this._store),this._indicatorCyclicDependencyCircuitBreaker.set(!0,void 0),this._register(this._instantiationService.createInstance(tq,this._host,this._model,this._indicator,this._inlineCollapsedView));const a=oe(this,d=>Math.max(...this._wordReplacementViews.read(d).map(h=>h.minEditorScrollHeight.read(d)),this._lineReplacementView.minEditorScrollHeight.read(d),this._customView.minEditorScrollHeight.read(d))).recomputeInitiallyAndOnChange(this._store),l=this._editor.getModel();let c;this._register(qe(d=>{const h=a.read(d);this._editor.changeViewZones(u=>{const f=this._editor.getScrollHeight(),g=h-f+1;g!==0&&c&&(u.removeZone(c),c=void 0),!(g<=0)&&(c=u.addZone({afterLineNumber:l.getLineCount(),heightInPx:g,domNode:me("div.minScrollHeightViewZone")}))})})),this._constructorDone.set(!0,void 0)}getCacheId(e){return e.inlineEdit.inlineCompletion.identity.id}determineView(e,t,i,s){var u,f,g,p,m;const o=e.inlineEdit,r=((u=this._previousView)==null?void 0:u.id)===this.getCacheId(e)&&!((f=e.displayLocation)!=null&&f.jumpToEdit),a=((g=this._previousView)==null?void 0:g.editorWidth)!==this._editorObs.layoutInfoWidth.read(t)&&(((p=this._previousView)==null?void 0:p.view)===$t.SideBySide||((m=this._previousView)==null?void 0:m.view)===$t.LineReplacement);if(r&&!a)return this._previousView.view;if(e.inlineEdit.inlineCompletion instanceof xy&&e.inlineEdit.inlineCompletion.uri||e.displayLocation&&!e.inlineEdit.inlineCompletion.identity.jumpedTo.read(t))return $t.Custom;const l=o.originalLineRange.length,c=o.modifiedLineRange.length,d=i.flatMap(b=>b.innerChanges??[]),h=d.length===1;if(!e.isInDiffEditor){if(h&&this._useCodeShifting.read(t)!=="never"&&WCe(i))return Llt(i,o.cursorPosition)?$t.InsertionInline:$t.LineReplacement;if(jle(d,o,s))return $t.Deletion;if(zle(i)&&this._useCodeShifting.read(t)==="always")return $t.InsertionMultiLine;if(d.every(v=>ls.ofRange(v.originalRange).columnCounts.getValueOfRange(C.modifiedRange)),w=d.map(C=>e.inlineEdit.originalText.getValueOfRange(C.originalRange));if(!v.some(C=>C.includes(" "))&&!w.some(C=>C.includes(" "))&&(!d.some(C=>C.originalRange.isEmpty())||!$le(d.map(C=>new An(C.originalRange,"")),o.originalText).some(C=>C.range.isEmpty()&&ls.ofRange(C.range).columnCount0&&c>0)return l===1&&c===1&&!e.isInDiffEditor?$t.LineReplacement:this._renderSideBySide.read(t)!=="never"&&KO.fitsInsideViewport(this._editor,this._previewTextModel,o,t)?$t.SideBySide:$t.LineReplacement;if(e.isInDiffEditor){if(jle(d,o,s))return $t.Deletion;if(zle(i)&&this._useCodeShifting.read(t)==="always")return $t.InsertionMultiLine}return $t.SideBySide}determineRenderState(e,t,i,s){const o=e.inlineEdit;let r=this.determineView(e,t,i,s);if(this._willRenderAboveCursor(t,o,r))switch(r){case $t.LineReplacement:case $t.WordReplacements:r=$t.SideBySide;break}this._previousView={id:this.getCacheId(e),view:r,editorWidth:this._editor.getLayoutInfo().width,timestamp:Date.now()};const a=i.flatMap(g=>g.innerChanges??[]),l=this._editor.getModel(),c=a.map(g=>({originalRange:g.originalRange,modifiedRange:g.modifiedRange,original:l.getValueInRange(g.originalRange),modified:s.getValueOfRange(g.modifiedRange)})),d=o.cursorPosition,h=c.length===0?!1:c[0].modified.startsWith(l.getEOL()),u={cursorColumnDistance:o.edit.replacements.length===0?0:o.edit.replacements[0].range.getStartPosition().column-d.column,cursorLineDistance:o.lineEdit.lineRange.startLineNumber-d.lineNumber+(h&&o.lineEdit.lineRange.startLineNumber>=d.lineNumber?1:0),lineCountOriginal:o.lineEdit.lineRange.length,lineCountModified:o.lineEdit.newLines.length,characterCountOriginal:c.reduce((g,p)=>g+p.original.length,0),characterCountModified:c.reduce((g,p)=>g+p.modified.length,0),disjointReplacements:c.length,sameShapeReplacements:c.every(g=>g.original===c[0].original&&g.modified===c[0].modified)};switch(r){case $t.InsertionInline:return{kind:$t.InsertionInline,viewData:u};case $t.SideBySide:return{kind:$t.SideBySide,viewData:u};case $t.Collapsed:return{kind:$t.Collapsed,viewData:u};case $t.Custom:return{kind:$t.Custom,displayLocation:e.displayLocation,viewData:u}}if(r===$t.Deletion)return{kind:$t.Deletion,originalRange:o.originalLineRange,deletions:a.map(g=>g.originalRange),viewData:u};if(r===$t.InsertionMultiLine){const g=a[0];return{kind:$t.InsertionMultiLine,lineNumber:g.originalRange.startLineNumber,column:g.originalRange.startColumn,text:s.getValueOfRange(g.modifiedRange),viewData:u}}const f=c.map(g=>new An(g.originalRange,g.modified));if(f.length!==0){if(r===$t.WordReplacements){let g=klt(f,o.originalText);return g.some(p=>p.range.isEmpty())&&(g=$le(f,o.originalText)),{kind:$t.WordReplacements,replacements:g,viewData:u}}if(r===$t.LineReplacement)return{kind:$t.LineReplacement,originalRange:o.originalLineRange,modifiedRange:o.modifiedLineRange,modifiedLines:o.modifiedLineRange.mapToLineArray(g=>s.getLineAt(g)),replacements:a.map(g=>({originalRange:g.originalRange,modifiedRange:g.modifiedRange})),viewData:u}}}_willRenderAboveCursor(e,t,i){if(this._useCodeShifting.read(e)==="always")return!1;for(const o of t.multiCursorPositions)if(i===$t.WordReplacements&&o.lineNumber===t.originalLineRange.startLineNumber+1||i===$t.LineReplacement&&o.lineNumber>=t.originalLineRange.endLineNumberExclusive&&o.lineNumber=e}};rq=Slt([xlt(5,Ae)],rq);function WCe(n){return n.every(t=>t.innerChanges.every(i=>e(i)));function e(t){return!(!t.originalRange.isEmpty()||!(t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber))}}function Llt(n,e){if(!e||!WCe(n))return!1;const t=e;return n.every(s=>s.innerChanges.every(o=>i(o)));function i(s){const o=s.originalRange.getStartPosition();return!!(t.isBeforeOrEqual(o)||o.lineNumberi.innerChanges??[]);if(e.length!==1)return!1;const t=e[0];return!(!t.originalRange.isEmpty()||t.modifiedRange.startLineNumber===t.modifiedRange.endLineNumber)}function jle(n,e,t){return n.map(s=>({original:e.originalText.getValueOfRange(s.originalRange),modified:t.getValueOfRange(s.modifiedRange)})).every(({original:s,modified:o})=>o.trim()===""&&s.length>0&&(s.length>o.length||s.trim()!==""))}function klt(n,e){return HCe(n,e,t=>/^[a-zA-Z]$/.test(t))}function $le(n,e){return HCe(n,e,t=>!/^\s$/.test(t))}function HCe(n,e,t){const i=[];n.sort((o,r)=>D.compareRangesUsingStarts(o.range,r.range));for(const o of n){let r=o.range.startColumn-1,a=o.range.endColumn-2,l="",c="";const d=e.getLineAt(o.range.startLineNumber),h=e.getLineAt(o.range.endLineNumber);if(s(d[r]))for(;s(d[r-1]);)l=d[r-1]+l,r--;if(s(h[a])||a0&&D.areIntersectingOrTouching(i[i.length-1].range,u.range)&&(u=An.joinReplacements([i.pop(),u],e)),i.push(u)}function s(o){return o===void 0?!1:t(o)}return i}function Ilt(n,e){const t=n.model.inlineEdit.edit.replacements;if(t.length!==1)return 0;const i=e.getModel();if(!i)return 0;const s=i.getEOL(),o=t[0];if(o.range.isEmpty()&&o.text.startsWith(s)){const r=e.getLineHeightForPosition(o.range.getStartPosition());return Elt(o.text,s)*r}return 0}function Elt(n,e){if(!e.length)return 0;let t=0,i=0;for(;n.startsWith(e,i);)t++,i+=e.length;return t}var Nlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Dlt=function(n,e){return function(t,i){e(t,i,n)}},S1;let aq=(S1=class extends G{constructor(e,t,i,s,o){super(),this._editor=e,this._edit=t,this._model=i,this._focusIsInMenu=s,this._inlineEdit=oe(this,r=>{var g;const a=this._model.read(r);if(!a)return;const l=this._edit.read(r);if(!l)return;const c=this._editor.getModel();if(!c)return;const d=(g=a.inlineEditState.read(void 0))==null?void 0:g.inlineCompletion.updatedEdit;if(!d)return;const h=d.replacements.map(p=>{const m=D.fromPositions(c.getPositionAt(p.replaceRange.start),c.getPositionAt(p.replaceRange.endExclusive));return new An(m,p.newText)}),u=new ga(h),f=new fw(c);return new ECe(f,u,a.primaryPosition.read(void 0),a.allPositions.read(void 0),l.commands,l.inlineCompletion)}),this._inlineEditModel=oe(this,r=>{const a=this._model.read(r);if(!a)return;const l=this._inlineEdit.read(r);if(!l)return;const c=oe(this,d=>{if(this._editorObs.isFocused.read(d)){if(a.tabShouldJumpToInlineEdit.read(d))return yo.Jump;if(a.tabShouldAcceptInlineEdit.read(d))return yo.Accept}return yo.Inactive});return new NCe(a,l,c)}),this._inlineEditHost=oe(this,r=>{const a=this._model.read(r);if(a)return new xat(a)}),this._ghostTextIndicator=oe(this,r=>{const a=this._model.read(r);if(!a)return;const l=a.inlineCompletionState.read(r);if(!l)return;const c=l.inlineCompletion;if(!c||!c.showInlineEditMenu)return;const d=Ye.ofLength(l.primaryGhostText.lineNumber,1);return new Lat(this._editor,a,d,c)}),this._editorObs=$i(this._editor),this._register(o.createInstance(rq,this._editor,this._inlineEditHost,this._inlineEditModel,this._ghostTextIndicator,this._focusIsInMenu))}},S1.hot=j3(S1),S1);aq=Nlt([Dlt(4,Ae)],aq);var Tlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Rlt=function(n,e){return function(t,i){e(t,i,n)}};let lq=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._model=t,this._focusIsInMenu=i,this._instantiationService=s,this._ghostTexts=oe(this,o=>{const r=this._model.read(o);return(r==null?void 0:r.ghostTexts.read(o))??[]}),this._stablizedGhostTexts=rrt(this._ghostTexts,this._store),this._editorObs=$i(this._editor),this._ghostTextWidgets=YG(this,this._stablizedGhostTexts,(o,r)=>Nl(a=>this._instantiationService.createInstance(NN.hot.read(a),this._editor,{ghostText:o,warning:this._model.map((l,c)=>{var h;const d=(h=l==null?void 0:l.warning)==null?void 0:h.read(c);return d?{icon:d.icon}:void 0}),minReservedLineCount:wi(0),targetTextModel:this._model.map(l=>l==null?void 0:l.textModel),handleInlineCompletionShown:this._model.map((l,c)=>{var h;const d=(h=l==null?void 0:l.inlineCompletionState.read(c))==null?void 0:h.inlineCompletion;return d?u=>l.handleInlineSuggestionShown(d,$t.GhostText,u):()=>{}})},this._editorObs.getOption(71).map(l=>({syntaxHighlightingEnabled:l.syntaxHighlightingEnabled})),!1,!1)).recomputeInitiallyAndOnChange(r)).recomputeInitiallyAndOnChange(this._store),this._inlineEdit=oe(this,o=>{var r,a;return(a=(r=this._model.read(o))==null?void 0:r.inlineEditState.read(o))==null?void 0:a.inlineEdit}),this._everHadInlineEdit=Hg(this,(o,r)=>{var a,l,c;return r||!!this._inlineEdit.read(o)||!!((c=(l=(a=this._model.read(o))==null?void 0:a.inlineCompletionState.read(o))==null?void 0:l.inlineCompletion)!=null&&c.showInlineEditMenu)}),this._inlineEditWidget=Nl(o=>{if(this._everHadInlineEdit.read(o))return this._instantiationService.createInstance(aq.hot.read(o),this._editor,this._inlineEdit,this._model,this._focusIsInMenu)}).recomputeInitiallyAndOnChange(this._store),this._fontFamily=this._editorObs.getOption(71).map(o=>o.fontFamily),this._register(J3e(oe(o=>` .monaco-editor .ghost-text-decoration, .monaco-editor .ghost-text-decoration-preview, .monaco-editor .ghost-text { font-family: ${this._fontFamily.read(o)}; -}`))),this._register(new D$(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.get().ownsViewZone(e))??!1}};cq=Mlt([Alt(3,Ae)],cq);var Plt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sf=function(n,e){return function(t,i){e(t,i,n)}},Dh,nu;let ka=(nu=class extends G{static getInFocusedEditorOrParent(e){const t=Hwe(e);return t?Dh.get(t):null}static get(e){return aot(e.getContribution(Dh.ID))}constructor(e,t,i,s,o,r,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=Ui(this.editor),this._positions=oe(this,p=>{var m;return((m=this._editorObs.selections.read(p))==null?void 0:m.map(b=>b.getEndPosition()))??[new U(1,1)]}),this._suggestWidgetAdapter=this._register(new vat(this._editorObs,p=>{var m;return(m=this.model.get())==null?void 0:m.handleSuggestAccepted(p)},()=>{var p,m;return(m=(p=this.model.get())==null?void 0:p.selectedInlineCompletion.get())==null?void 0:m.getSingleTextEdit()})),this._enabledInConfig=Ut(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=Ut(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=Ut(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=oe(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Ze(this,!1),this._focusIsInEditorOrMenu=oe(this,p=>{const m=this._editorObs.isFocused.read(p),b=this._focusIsInMenu.read(p);return m||b}),this._cursorIsInIndentation=oe(this,p=>{const m=this._editorObs.cursorPosition.read(p);if(m===null)return!1;const b=this._editorObs.model.read(p);if(!b)return!1;this._editorObs.versionId.read(p);const v=b.getLineIndentColumn(m.lineNumber);return m.column<=v}),this.model=Ml(this,p=>{if(this._editorObs.isReadonly.read(p))return;const m=this._editorObs.model.read(p);return m?this._instantiationService.createInstance(OU,m,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Ul(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(p=>!0),this._view=this._register(this._instantiationService.createInstance(cq,this.editor,this.model,this._focusIsInMenu)),Dh._instances.add(this),this._register(Re(()=>Dh._instances.delete(this))),this._register(qe(p=>{var w,C;const m=this.model.read(p);if(!m)return;const b=m.state.read(p);if(!b||!this._focusIsInEditorOrMenu.read(void 0))return;const v=b.kind==="inlineEdit"?b.nextEditUri:void 0;for(const S of Dh._instances)S!==this&&(v&&i_(v,(w=S.editor.getModel())==null?void 0:w.uri)?(C=S.model.read(void 0))==null||C.trigger():S.reject())})),this._register(qe(p=>{var v;const m=this.model.read(p),b=(v=this.editor.getModel())==null?void 0:v.uri;!m||!b||p.store.add(m.onDidAccept(()=>{var w,C;for(const S of Dh._instances){if(S===this)continue;const L=(w=S.model.read(void 0))==null?void 0:w.state.read(void 0);(L==null?void 0:L.kind)==="inlineEdit"&&i_(L.nextEditUri,b)&&((C=S.model.read(void 0))==null||C.stop("automatic"))}}))})),this._register(Kd(this._editorObs.onDidType,(p,m)=>{var b;this._enabled.get()&&((b=this.model.get())==null||b.trigger())})),this._register(Kd(this._editorObs.onDidPaste,(p,m)=>{var b;this._enabled.get()&&((b=this.model.get())==null||b.trigger())}));const h=new Set([cy.Tab.id,cy.DeleteLeft.id,cy.DeleteRight.id,bN,"acceptSelectedSuggestion",EO.ID,kO.ID,xi.NextMatchFindAction,..._A.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(p=>{if(h.has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()){let m=!1;p.commandId===bN&&(m=!0),this._editorObs.forceUpdate(b=>{var v;(v=this.model.get())==null||v.trigger(b,{noDelay:m})})}})),this._register(Kd(this._editorObs.selections,(p,m,b)=>{var v,w,C,S;if(b.some(L=>L.reason===3||L.source==="api")){if(!this._hideInlineEditOnSelectionChange.get()&&((w=(v=this.model.get())==null?void 0:v.state.get())==null?void 0:w.kind)==="inlineEdit")return;const L=this.model.get();if(!L)return;((C=L.state.get())==null?void 0:C.kind)==="ghostText"&&((S=this.model.get())==null||S.stop())}})),this._register(qe(p=>{var v,w;const m=this._focusIsInEditorOrMenu.read(p),b=this.model.read(void 0);if(m){const C=b==null?void 0:b.state.read(void 0);(!C||C.kind!=="inlineEdit"||!C.nextEditUri)&&wi(S=>{var L;for(const x of Dh._instances)x!==this&&((L=x.model.read(void 0))==null||L.stop("automatic",S))});return}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||RS.dropDownVisible||b&&((w=(v=b.state.read(void 0))==null?void 0:v.inlineCompletion)!=null&&w.isFromExplicitRequest&&b.inlineEditAvailable.read(void 0)||wi(C=>{b.stop("automatic",C)}))})),this._register(qe(p=>{var b;const m=(b=this.model.read(p))==null?void 0:b.inlineCompletionState.read(p);m!=null&&m.suggestItem?m.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(Re(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const u=Hg(this,(p,m)=>{var w;const b=this.model.read(p),v=b==null?void 0:b.state.read(p);return this._suggestWidgetAdapter.selectedItem.get()?m:(w=v==null?void 0:v.inlineCompletion)==null?void 0:w.semanticId});this._register(c_e(oe(p=>(this._playAccessibilitySignal.read(p),u.read(p),{})),async(p,m,b,v)=>{let w=this.model.get(),C=w==null?void 0:w.state.get();if(!C||!w||(await vu(50,sW(v)),await d1e(this._suggestWidgetAdapter.selectedItem,ko,()=>!1,sW(v)),w=this.model.get(),C=w==null?void 0:w.state.get(),!C||!w))return;const S=C.kind==="ghostText"?w.textModel.getLineContent(C.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal(C.kind==="ghostText"?dr.inlineSuggestion:dr.nextEditSuggestion),this.editor.getOption(12)&&(C.kind==="ghostText"?this._provideScreenReaderUpdate(C.primaryGhostText.renderForScreenReader(S)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const f=new crt(this._contextKeyService);this._register(f.bind(hi.cursorInIndentation,this._cursorIsInIndentation)),this._register(f.bind(hi.hasSelection,p=>{var m;return!((m=this._editorObs.cursorSelection.read(p))!=null&&m.isEmpty())})),this._register(f.bind(hi.cursorAtInlineEdit,this.model.map((p,m)=>{var b,v;return(v=(b=p==null?void 0:p.inlineEditState)==null?void 0:b.read(m))==null?void 0:v.cursorAtInlineEdit.read(m)}))),this._register(f.bind(hi.tabShouldAcceptInlineEdit,this.model.map((p,m)=>!!(p!=null&&p.tabShouldAcceptInlineEdit.read(m))))),this._register(f.bind(hi.tabShouldJumpToInlineEdit,this.model.map((p,m)=>!!(p!=null&&p.tabShouldJumpToInlineEdit.read(m))))),this._register(f.bind(hi.inlineEditVisible,p=>{var m;return((m=this.model.read(p))==null?void 0:m.inlineEditState.read(p))!==void 0})),this._register(f.bind(hi.inlineSuggestionHasIndentation,p=>{var m,b;return(b=(m=this.model.read(p))==null?void 0:m.getIndentationInfo(p))==null?void 0:b.startsWithIndentation})),this._register(f.bind(hi.inlineSuggestionHasIndentationLessThanTabSize,p=>{var m,b;return(b=(m=this.model.read(p))==null?void 0:m.getIndentationInfo(p))==null?void 0:b.startsWithIndentationLessThanTabSize})),this._register(f.bind(hi.suppressSuggestions,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p);return b!=null&&b.primaryGhostText&&(b!=null&&b.inlineCompletion)?b.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(f.bind(hi.inlineSuggestionVisible,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p);return!!(b!=null&&b.inlineCompletion)&&(b==null?void 0:b.primaryGhostText)!==void 0&&!(b!=null&&b.primaryGhostText.isEmpty())}));const g=oe(this,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p),v=b==null?void 0:b.primaryGhostText;return!v||v.isEmpty()?void 0:new U(v.lineNumber,v.parts[0].column)});this._register(f.bind(hi.cursorBeforeGhostText,p=>{const m=g.read(p);if(!m)return!1;const b=this._editorObs.cursorPosition.read(p);return b?m.equals(b):!1})),this._register(this._instantiationService.createInstance(IU,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(169)&&(s=_(1204,"Inspect this in the accessible view ({0})",i.getAriaLabel())),_r(s?e+", "+s:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(s=>e.containsPosition(new U(t.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){wi(e=>{var i;const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const s of Dh._instances)s!==this&&((i=s.model.get())==null||i.stop("automatic",e))})}jump(){const e=this.model.get();e&&e.jump()}},Dh=nu,nu._instances=new Set,nu.hot=j3(nu),nu.ID="editor.contrib.inlineCompletionsController",nu);ka=Dh=Plt([sf(1,Ae),sf(2,Xe),sf(3,lt),sf(4,Ei),sf(5,pc),sf(6,De),sf(7,Kg),sf(8,Ht),sf(9,Us)],ka);const NF=class NF extends Ne{constructor(){super({id:NF.ID,label:ie(1183,"Show Next Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var s;const i=ka.get(t);(s=i==null?void 0:i.model.get())==null||s.next()}};NF.ID=ywe;let dq=NF;const DF=class DF extends Ne{constructor(){super({id:DF.ID,label:ie(1184,"Show Previous Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var s;const i=ka.get(t);(s=i==null?void 0:i.model.get())==null||s.previous()}};DF.ID=Cwe;let hq=DF;const Olt="vscode://schemas/inlineCompletionProviderIdArgs";function Flt(n){const e=[];return n.providerId&&(e.push(n.providerId.toStringWithoutVersion()),e.push(n.providerId.extensionId+":*")),e}const Kle=mot(got({showNoResultNotification:l6(ile()),providerId:l6(bot(Olt,dot())),explicit:l6(ile())}),uot());class Blt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:ie(1185,"Trigger Inline Suggestion"),precondition:H.writable,metadata:{description:_(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:_(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:Kle.getJSONSchema()}]}})}async run(e,t,i){var c;const s=e.get(fn),o=e.get(De),r=ka.get(t),a=Kle.validateOrThrow(i),l=a!=null&&a.providerId?o.inlineCompletionsProvider.all(t.getModel()).find(d=>Flt(d).some(h=>h===a.providerId)):void 0;await AOe(async d=>{var h;await((h=r==null?void 0:r.model.get())==null?void 0:h.trigger(d,{provider:l,explicit:(a==null?void 0:a.explicit)??!0})),r==null||r.playAccessibilitySignal(d)}),a!=null&&a.showNoResultNotification&&((c=r==null?void 0:r.model.get())!=null&&c.state.get()||s.notify({severity:lx.Info,message:_(1174,"No inline suggestion is available.")}))}}class Wlt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:ie(1186,"Accept Next Word Of Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:le.and(H.writable,hi.inlineSuggestionVisible,hi.cursorBeforeGhostText,ix.negate())},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1175,"Accept Word"),group:"primary",order:2}]})}async run(e,t){var s;const i=ka.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextWord())}}class Hlt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:ie(1187,"Accept Next Line Of Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1176,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){var s;const i=ka.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextLine())}}class Vlt extends Ne{constructor(){super({id:bN,label:ie(1188,"Accept Inline Suggestion"),precondition:le.or(hi.inlineSuggestionVisible,hi.inlineEditVisible),menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1177,"Accept"),group:"primary",order:2},{menuId:Te.InlineEditsActions,title:_(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:le.or(le.and(hi.inlineSuggestionVisible,H.tabMovesFocus.toNegated(),_t.Visible.toNegated(),H.hoverFocused.toNegated(),hi.hasSelection.toNegated(),hi.inlineSuggestionHasIndentationLessThanTabSize),le.and(hi.inlineEditVisible,H.tabMovesFocus.toNegated(),_t.Visible.toNegated(),H.hoverFocused.toNegated(),hi.tabShouldAcceptInlineEdit))}]})}async run(e,t){var s;const i=ka.getInFocusedEditorOrParent(e);i&&((s=i.model.get())==null||s.accept(i.editor),i.editor.focus())}}As.registerKeybindingRule({id:bN,weight:202,primary:2,when:le.and(hi.inInlineEditsPreviewEditor)});class zlt extends Ne{constructor(){super({id:Itt,label:ie(1189,"Jump to next inline edit"),precondition:hi.inlineEditVisible,menuOpts:[{menuId:Te.InlineEditsActions,title:_(1179,"Jump"),group:"primary",order:1,when:hi.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:le.and(hi.inlineEditVisible,H.tabMovesFocus.toNegated(),_t.Visible.toNegated(),H.hoverFocused.toNegated(),hi.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=ka.get(t);i&&i.jump()}}const TF=class TF extends Ne{constructor(){super({id:TF.ID,label:ie(1190,"Hide Inline Suggestion"),precondition:le.or(hi.inlineSuggestionVisible,hi.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:Te.InlineEditsActions,title:_(1180,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=ka.getInFocusedEditorOrParent(e);wi(s=>{var o;(o=i==null?void 0:i.model.get())==null||o.stop("explicitCancel",s)}),i==null||i.editor.focus()}};TF.ID=Swe;let GO=TF;const RF=class RF extends Ne{constructor(){super({id:RF.ID,label:ie(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:le.true()})}async run(e,t){const i=e.get(lt),s=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!s)}};RF.ID=N$;let uq=RF;As.registerKeybindingRule({id:GO.ID,weight:-1,primary:9,secondary:[1033],when:le.and(hi.inInlineEditsPreviewEditor)});const MF=class MF extends Ps{constructor(){super({id:MF.ID,title:_(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Te.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:le.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(lt),s=t.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",s)}};MF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let fq=MF;class jlt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:_(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:le.or(hi.inlineEditVisible,hi.inlineSuggestionVisible)})}async run(e,t){const i=e.get(xa),s=ka.get(t),o=s==null?void 0:s.model.get();if(!o)return;const r=o.extractReproSample(),l=wa(JSON.stringify({inlineCompletion:r.inlineCompletion},null,4)).map(d=>"// "+d).join(` +}`))),this._register(new N$(this._editor,this._model,this._instantiationService))}shouldShowHoverAtViewZone(e){var t;return((t=this._ghostTextWidgets.get()[0])==null?void 0:t.get().ownsViewZone(e))??!1}};lq=Tlt([Rlt(3,Ae)],lq);var Mlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nf=function(n,e){return function(t,i){e(t,i,n)}},Th,su;let Ia=(su=class extends G{static getInFocusedEditorOrParent(e){const t=Owe(e);return t?Th.get(t):null}static get(e){return oot(e.getContribution(Th.ID))}constructor(e,t,i,s,o,r,a,l,c,d){super(),this.editor=e,this._instantiationService=t,this._contextKeyService=i,this._configurationService=s,this._commandService=o,this._debounceService=r,this._languageFeaturesService=a,this._accessibilitySignalService=l,this._keybindingService=c,this._accessibilityService=d,this._editorObs=$i(this.editor),this._positions=oe(this,p=>{var m;return((m=this._editorObs.selections.read(p))==null?void 0:m.map(b=>b.getEndPosition()))??[new U(1,1)]}),this._suggestWidgetAdapter=this._register(new _at(this._editorObs,p=>{var m;return(m=this.model.get())==null?void 0:m.handleSuggestAccepted(p)},()=>{var p,m;return(m=(p=this.model.get())==null?void 0:p.selectedInlineCompletion.get())==null?void 0:m.getSingleTextEdit()})),this._enabledInConfig=qt(this,this.editor.onDidChangeConfiguration,()=>this.editor.getOption(71).enabled),this._isScreenReaderEnabled=qt(this,this._accessibilityService.onDidChangeScreenReaderOptimized,()=>this._accessibilityService.isScreenReaderOptimized()),this._editorDictationInProgress=qt(this,this._contextKeyService.onDidChangeContext,()=>this._contextKeyService.getContext(this.editor.getDomNode()).getValue("editorDictation.inProgress")===!0),this._enabled=oe(this,p=>this._enabledInConfig.read(p)&&(!this._isScreenReaderEnabled.read(p)||!this._editorDictationInProgress.read(p))),this._debounceValue=this._debounceService.for(this._languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._focusIsInMenu=Ze(this,!1),this._focusIsInEditorOrMenu=oe(this,p=>{const m=this._editorObs.isFocused.read(p),b=this._focusIsInMenu.read(p);return m||b}),this._cursorIsInIndentation=oe(this,p=>{const m=this._editorObs.cursorPosition.read(p);if(m===null)return!1;const b=this._editorObs.model.read(p);if(!b)return!1;this._editorObs.versionId.read(p);const v=b.getLineIndentColumn(m.lineNumber);return m.column<=v}),this.model=Nl(this,p=>{if(this._editorObs.isReadonly.read(p))return;const m=this._editorObs.model.read(p);return m?this._instantiationService.createInstance(PU,m,this._suggestWidgetAdapter.selectedItem,this._editorObs.versionId,this._positions,this._debounceValue,this._enabled,this.editor):void 0}).recomputeInitiallyAndOnChange(this._store),this._playAccessibilitySignal=Vl(this),this._hideInlineEditOnSelectionChange=this._editorObs.getOption(71).map(p=>!0),this._view=this._register(this._instantiationService.createInstance(lq,this.editor,this.model,this._focusIsInMenu)),Th._instances.add(this),this._register(Re(()=>Th._instances.delete(this))),this._register(qe(p=>{var w,C;const m=this.model.read(p);if(!m)return;const b=m.state.read(p);if(!b||!this._focusIsInEditorOrMenu.read(void 0))return;const v=b.kind==="inlineEdit"?b.nextEditUri:void 0;for(const S of Th._instances)S!==this&&(v&&t_(v,(w=S.editor.getModel())==null?void 0:w.uri)?(C=S.model.read(void 0))==null||C.trigger():S.reject())})),this._register(qe(p=>{var v;const m=this.model.read(p),b=(v=this.editor.getModel())==null?void 0:v.uri;!m||!b||p.store.add(m.onDidAccept(()=>{var w,C;for(const S of Th._instances){if(S===this)continue;const L=(w=S.model.read(void 0))==null?void 0:w.state.read(void 0);(L==null?void 0:L.kind)==="inlineEdit"&&t_(L.nextEditUri,b)&&((C=S.model.read(void 0))==null||C.stop("automatic"))}}))})),this._register(Yd(this._editorObs.onDidType,(p,m)=>{var b;this._enabled.get()&&((b=this.model.get())==null||b.trigger())})),this._register(Yd(this._editorObs.onDidPaste,(p,m)=>{var b;this._enabled.get()&&((b=this.model.get())==null||b.trigger())}));const h=new Set([ay.Tab.id,ay.DeleteLeft.id,ay.DeleteRight.id,bN,"acceptSelectedSuggestion",IO.ID,kO.ID,Si.NextMatchFindAction,..._A.getRegisteredCommands()]);this._register(this._commandService.onDidExecuteCommand(p=>{if(h.has(p.commandId)&&e.hasTextFocus()&&this._enabled.get()){let m=!1;p.commandId===bN&&(m=!0),this._editorObs.forceUpdate(b=>{var v;(v=this.model.get())==null||v.trigger(b,{noDelay:m})})}})),this._register(Yd(this._editorObs.selections,(p,m,b)=>{var v,w,C,S;if(b.some(L=>L.reason===3||L.source==="api")){if(!this._hideInlineEditOnSelectionChange.get()&&((w=(v=this.model.get())==null?void 0:v.state.get())==null?void 0:w.kind)==="inlineEdit")return;const L=this.model.get();if(!L)return;((C=L.state.get())==null?void 0:C.kind)==="ghostText"&&((S=this.model.get())==null||S.stop())}})),this._register(qe(p=>{var v,w;const m=this._focusIsInEditorOrMenu.read(p),b=this.model.read(void 0);if(m){const C=b==null?void 0:b.state.read(void 0);(!C||C.kind!=="inlineEdit"||!C.nextEditUri)&&vi(S=>{var L;for(const x of Th._instances)x!==this&&((L=x.model.read(void 0))==null||L.stop("automatic",S))});return}this._contextKeyService.getContextKeyValue("accessibleViewIsShown")||this._configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(71).keepOnBlur||DS.dropDownVisible||b&&((w=(v=b.state.read(void 0))==null?void 0:v.inlineCompletion)!=null&&w.isFromExplicitRequest&&b.inlineEditAvailable.read(void 0)||vi(C=>{b.stop("automatic",C)}))})),this._register(qe(p=>{var b;const m=(b=this.model.read(p))==null?void 0:b.inlineCompletionState.read(p);m!=null&&m.suggestItem?m.primaryGhostText.lineCount>=2&&this._suggestWidgetAdapter.forceRenderingAbove():this._suggestWidgetAdapter.stopForceRenderingAbove()})),this._register(Re(()=>{this._suggestWidgetAdapter.stopForceRenderingAbove()}));const u=Hg(this,(p,m)=>{var w;const b=this.model.read(p),v=b==null?void 0:b.state.read(p);return this._suggestWidgetAdapter.selectedItem.get()?m:(w=v==null?void 0:v.inlineCompletion)==null?void 0:w.semanticId});this._register(o_e(oe(p=>(this._playAccessibilitySignal.read(p),u.read(p),{})),async(p,m,b,v)=>{let w=this.model.get(),C=w==null?void 0:w.state.get();if(!C||!w||(await wu(50,nW(v)),await r1e(this._suggestWidgetAdapter.selectedItem,Lo,()=>!1,nW(v)),w=this.model.get(),C=w==null?void 0:w.state.get(),!C||!w))return;const S=C.kind==="ghostText"?w.textModel.getLineContent(C.primaryGhostText.lineNumber):"";this._accessibilitySignalService.playSignal(C.kind==="ghostText"?ur.inlineSuggestion:ur.nextEditSuggestion),this.editor.getOption(12)&&(C.kind==="ghostText"?this._provideScreenReaderUpdate(C.primaryGhostText.renderForScreenReader(S)):this._provideScreenReaderUpdate(""))})),this._register(this._configurationService.onDidChangeConfiguration(p=>{p.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")})})),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this._configurationService.getValue("accessibility.verbosity.inlineCompletions")});const f=new art(this._contextKeyService);this._register(f.bind(hi.cursorInIndentation,this._cursorIsInIndentation)),this._register(f.bind(hi.hasSelection,p=>{var m;return!((m=this._editorObs.cursorSelection.read(p))!=null&&m.isEmpty())})),this._register(f.bind(hi.cursorAtInlineEdit,this.model.map((p,m)=>{var b,v;return(v=(b=p==null?void 0:p.inlineEditState)==null?void 0:b.read(m))==null?void 0:v.cursorAtInlineEdit.read(m)}))),this._register(f.bind(hi.tabShouldAcceptInlineEdit,this.model.map((p,m)=>!!(p!=null&&p.tabShouldAcceptInlineEdit.read(m))))),this._register(f.bind(hi.tabShouldJumpToInlineEdit,this.model.map((p,m)=>!!(p!=null&&p.tabShouldJumpToInlineEdit.read(m))))),this._register(f.bind(hi.inlineEditVisible,p=>{var m;return((m=this.model.read(p))==null?void 0:m.inlineEditState.read(p))!==void 0})),this._register(f.bind(hi.inlineSuggestionHasIndentation,p=>{var m,b;return(b=(m=this.model.read(p))==null?void 0:m.getIndentationInfo(p))==null?void 0:b.startsWithIndentation})),this._register(f.bind(hi.inlineSuggestionHasIndentationLessThanTabSize,p=>{var m,b;return(b=(m=this.model.read(p))==null?void 0:m.getIndentationInfo(p))==null?void 0:b.startsWithIndentationLessThanTabSize})),this._register(f.bind(hi.suppressSuggestions,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p);return b!=null&&b.primaryGhostText&&(b!=null&&b.inlineCompletion)?b.inlineCompletion.source.inlineSuggestions.suppressSuggestions:void 0})),this._register(f.bind(hi.inlineSuggestionVisible,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p);return!!(b!=null&&b.inlineCompletion)&&(b==null?void 0:b.primaryGhostText)!==void 0&&!(b!=null&&b.primaryGhostText.isEmpty())}));const g=oe(this,p=>{const m=this.model.read(p),b=m==null?void 0:m.inlineCompletionState.read(p),v=b==null?void 0:b.primaryGhostText;return!v||v.isEmpty()?void 0:new U(v.lineNumber,v.parts[0].column)});this._register(f.bind(hi.cursorBeforeGhostText,p=>{const m=g.read(p);if(!m)return!1;const b=this._editorObs.cursorPosition.read(p);return b?m.equals(b):!1})),this._register(this._instantiationService.createInstance(IU,this.editor))}playAccessibilitySignal(e){this._playAccessibilitySignal.trigger(e)}_provideScreenReaderUpdate(e){const t=this._contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let s;!t&&i&&this.editor.getOption(169)&&(s=_(1204,"Inspect this in the accessible view ({0})",i.getAriaLabel())),vr(s?e+", "+s:e)}shouldShowHoverAt(e){var i;const t=(i=this.model.get())==null?void 0:i.primaryGhostText.get();return t?t.parts.some(s=>e.containsPosition(new U(t.lineNumber,s.column))):!1}shouldShowHoverAtViewZone(e){return this._view.shouldShowHoverAtViewZone(e)}reject(){vi(e=>{var i;const t=this.model.get();if(t&&(t.stop("explicitCancel",e),this._focusIsInEditorOrMenu.get()))for(const s of Th._instances)s!==this&&((i=s.model.get())==null||i.stop("automatic",e))})}jump(){const e=this.model.get();e&&e.jump()}},Th=su,su._instances=new Set,su.hot=j3(su),su.ID="editor.contrib.inlineCompletionsController",su);Ia=Th=Mlt([nf(1,Ae),nf(2,Xe),nf(3,lt),nf(4,ki),nf(5,hc),nf(6,De),nf(7,Kg),nf(8,Vt),nf(9,Us)],Ia);const NF=class NF extends Ne{constructor(){super({id:NF.ID,label:ie(1183,"Show Next Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}async run(e,t){var s;const i=Ia.get(t);(s=i==null?void 0:i.model.get())==null||s.next()}};NF.ID=bwe;let cq=NF;const DF=class DF extends Ne{constructor(){super({id:DF.ID,label:ie(1184,"Show Previous Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}async run(e,t){var s;const i=Ia.get(t);(s=i==null?void 0:i.model.get())==null||s.previous()}};DF.ID=_we;let dq=DF;const Alt="vscode://schemas/inlineCompletionProviderIdArgs";function Plt(n){const e=[];return n.providerId&&(e.push(n.providerId.toStringWithoutVersion()),e.push(n.providerId.extensionId+":*")),e}const Ule=got(uot({showNoResultNotification:l6(ele()),providerId:l6(mot(Alt,lot())),explicit:l6(ele())}),dot());class Olt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:ie(1185,"Trigger Inline Suggestion"),precondition:H.writable,metadata:{description:_(1172,"Triggers an inline suggestion in the editor."),args:[{name:"args",description:_(1173,"Options for triggering inline suggestions."),isOptional:!0,schema:Ule.getJSONSchema()}]}})}async run(e,t,i){var c;const s=e.get(fn),o=e.get(De),r=Ia.get(t),a=Ule.validateOrThrow(i),l=a!=null&&a.providerId?o.inlineCompletionsProvider.all(t.getModel()).find(d=>Plt(d).some(h=>h===a.providerId)):void 0;await ROe(async d=>{var h;await((h=r==null?void 0:r.model.get())==null?void 0:h.trigger(d,{provider:l,explicit:(a==null?void 0:a.explicit)??!0})),r==null||r.playAccessibilitySignal(d)}),a!=null&&a.showNoResultNotification&&((c=r==null?void 0:r.model.get())!=null&&c.state.get()||s.notify({severity:rx.Info,message:_(1174,"No inline suggestion is available.")}))}}class Flt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:ie(1186,"Accept Next Word Of Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:le.and(H.writable,hi.inlineSuggestionVisible,hi.cursorBeforeGhostText,ex.negate())},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1175,"Accept Word"),group:"primary",order:2}]})}async run(e,t){var s;const i=Ia.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextWord())}}class Blt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:ie(1187,"Accept Next Line Of Inline Suggestion"),precondition:le.and(H.writable,hi.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1176,"Accept Line"),group:"secondary",order:2}]})}async run(e,t){var s;const i=Ia.get(t);await((s=i==null?void 0:i.model.get())==null?void 0:s.acceptNextLine())}}class Wlt extends Ne{constructor(){super({id:bN,label:ie(1188,"Accept Inline Suggestion"),precondition:le.or(hi.inlineSuggestionVisible,hi.inlineEditVisible),menuOpts:[{menuId:Te.InlineSuggestionToolbar,title:_(1177,"Accept"),group:"primary",order:2},{menuId:Te.InlineEditsActions,title:_(1178,"Accept"),group:"primary",order:2}],kbOpts:[{primary:2,weight:200,kbExpr:le.or(le.and(hi.inlineSuggestionVisible,H.tabMovesFocus.toNegated(),bt.Visible.toNegated(),H.hoverFocused.toNegated(),hi.hasSelection.toNegated(),hi.inlineSuggestionHasIndentationLessThanTabSize),le.and(hi.inlineEditVisible,H.tabMovesFocus.toNegated(),bt.Visible.toNegated(),H.hoverFocused.toNegated(),hi.tabShouldAcceptInlineEdit))}]})}async run(e,t){var s;const i=Ia.getInFocusedEditorOrParent(e);i&&((s=i.model.get())==null||s.accept(i.editor),i.editor.focus())}}As.registerKeybindingRule({id:bN,weight:202,primary:2,when:le.and(hi.inInlineEditsPreviewEditor)});class Hlt extends Ne{constructor(){super({id:ktt,label:ie(1189,"Jump to next inline edit"),precondition:hi.inlineEditVisible,menuOpts:[{menuId:Te.InlineEditsActions,title:_(1179,"Jump"),group:"primary",order:1,when:hi.cursorAtInlineEdit.toNegated()}],kbOpts:{primary:2,weight:201,kbExpr:le.and(hi.inlineEditVisible,H.tabMovesFocus.toNegated(),bt.Visible.toNegated(),H.hoverFocused.toNegated(),hi.tabShouldJumpToInlineEdit)}})}async run(e,t){const i=Ia.get(t);i&&i.jump()}}const TF=class TF extends Ne{constructor(){super({id:TF.ID,label:ie(1190,"Hide Inline Suggestion"),precondition:le.or(hi.inlineSuggestionVisible,hi.inlineEditVisible),kbOpts:{weight:190,primary:9},menuOpts:[{menuId:Te.InlineEditsActions,title:_(1180,"Reject"),group:"primary",order:3}]})}async run(e,t){const i=Ia.getInFocusedEditorOrParent(e);vi(s=>{var o;(o=i==null?void 0:i.model.get())==null||o.stop("explicitCancel",s)}),i==null||i.editor.focus()}};TF.ID=vwe;let GO=TF;const RF=class RF extends Ne{constructor(){super({id:RF.ID,label:ie(1191,"Toggle Inline Suggestions Show Collapsed"),precondition:le.true()})}async run(e,t){const i=e.get(lt),s=i.getValue("editor.inlineSuggest.edits.showCollapsed");i.updateValue("editor.inlineSuggest.edits.showCollapsed",!s)}};RF.ID=E$;let hq=RF;As.registerKeybindingRule({id:GO.ID,weight:-1,primary:9,secondary:[1033],when:le.and(hi.inInlineEditsPreviewEditor)});const MF=class MF extends Ps{constructor(){super({id:MF.ID,title:_(1181,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:Te.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:le.equals("config.editor.inlineSuggest.showToolbar","always")})}async run(e){const t=e.get(lt),s=t.getValue("editor.inlineSuggest.showToolbar")==="always"?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",s)}};MF.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";let uq=MF;class Vlt extends Ne{constructor(){super({id:"editor.action.inlineSuggest.dev.extractRepro",label:_(1182,"Developer: Extract Inline Suggest State"),alias:"Developer: Inline Suggest Extract Repro",precondition:le.or(hi.inlineEditVisible,hi.inlineSuggestionVisible)})}async run(e,t){const i=e.get(La),s=Ia.get(t),o=s==null?void 0:s.model.get();if(!o)return;const r=o.extractReproSample(),l=Ca(JSON.stringify({inlineCompletion:r.inlineCompletion},null,4)).map(d=>"// "+d).join(` `),c=`${r.documentValue} // ${l} // -`;return await i.writeText(c),{reproCase:c}}}var $lt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Y2=function(n,e){return function(t,i){e(t,i,n)}};class Ult{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gq=class{constructor(e,t,i,s,o){this._editor=e,this.accessibilityService=t,this._instantiationService=i,this._telemetryService=s,this._markdownRendererService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=ka.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new FL(1e3,this,D.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}if(i.type===7&&t.shouldShowHoverAt(i.range))return new FL(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new FL(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===9&&i.element){const s=NN.getWarningWidgetContext(i.element);if(s&&t.shouldShowHoverAt(s.range))return new FL(1e3,this,s.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const i=ka.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new Ult(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new ne,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,s));const o=s.controller.model.get(),r=document.createElement("div");e.fragment.appendChild(r),i.add(Eo((l,c)=>{const d=c.add(this._instantiationService.createInstance(RS.hot.read(l),this._editor,!1,Ci(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands,o.warning,()=>{e.onContentsChanged()}));r.replaceChildren(d.getDomNode())})),o.triggerExplicitly();const a={hoverPart:s,hoverElement:r,dispose(){i.dispose()}};return new xw([a])}getAccessibleContent(e){return _(1205,"There are inline completions here")}renderScreenReaderText(e,t){const i=new ne,s=me,o=s("div.hover-row.markdown-hover"),r=ue(o,s("div.hover-contents",{"aria-live":"assertive"})),a=l=>{const c=_(1206,"Suggestion:"),d=i.add(this._markdownRendererService.render(new yo().appendText(c).appendCodeblock("text",l),{context:this._editor,asyncRenderCallback:()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}}));r.replaceChildren(d.element)};return i.add(qe(l=>{var d;const c=(d=t.controller.model.read(l))==null?void 0:d.primaryGhostText.read(l);if(c){const h=this._editor.getModel().getLineContent(c.lineNumber);a(c.renderForScreenReader(h))}else ys(r)})),e.fragment.appendChild(o),i}};gq=$lt([Y2(1,Us),Y2(2,Ae),Y2(3,Ro),Y2(4,Jc)],gq);class qlt{}At(ka.ID,lot(ka.hot),3);we(Blt);we(dq);we(hq);we(Wlt);we(Hlt);we(Vlt);we(uq);we(GO);we(zlt);ni(fq);we(jlt);ni(vz);ni(wz);Gw.register(gq);t8.register(new qlt);var Klt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x6=function(n,e){return function(t,i){e(t,i,n)}},$L,Um;let RN=(Um=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new ne,this.toUnhookForKeyboard=new ne,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new Z3(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Je(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution($L.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var r;this.toUnhookForKeyboard.clear();const t=e?(r=this.editor.getModel())==null?void 0:r.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new x1e(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=ss(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){Je(a);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=s[0].originSelectionRange?D.lift(s[0].originSelectionRange):new D(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let a=o;for(const{originSelectionRange:l}of s)l&&(a=D.plusRange(a,l));this.addDecoration(a,new yo().appendText(_(1077,"Click to show {0} definitions.",s.length)))}else{const a=s[0];return a.uri?this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const h=this.getPreviewValue(c,d,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,h?new yo().appendCodeblock(u||"",h):void 0),l.dispose()}):void 0}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=$L.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),s=e.validateRange(s),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(101)&&!this.isInPeekEditor(i);return new zD({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Kr.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},$L=Um,Um.ID="editor.contrib.gotodefinitionatposition",Um.MAX_SOURCE_PREVIEW_LINES=8,Um);RN=$L=Klt([x6(1,Xo),x6(2,un),x6(3,De)],RN);At(RN.ID,RN,2);class Glt extends Ne{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:ie(1101,"Developer: Debug Editor GPU Renderer"),precondition:le.true()})}async run(e,t){const i=e.get(Ae),o=await e.get(Do).pick([{label:_(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:_(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:_(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(o)switch(o.id){case"logTextureAtlasStats":i.invokeFunction(r=>{const a=r.get(ki),l=jo.atlas;if(!jo.atlas){a.error("No texture atlas found");return}const c=l.getStats();a.info(["Texture atlas stats",...c].join(` +`;return await i.writeText(c),{reproCase:c}}}var zlt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Z2=function(n,e){return function(t,i){e(t,i,n)}};class jlt{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let fq=class{constructor(e,t,i,s,o){this._editor=e,this.accessibilityService=t,this._instantiationService=i,this._telemetryService=s,this._markdownRendererService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=Ia.get(this._editor);if(!t)return null;const i=e.target;if(i.type===8){const s=i.detail;if(t.shouldShowHoverAtViewZone(s.viewZoneId))return new FL(1e3,this,D.fromPositions(this._editor.getModel().validatePosition(s.positionBefore||s.position)),e.event.posx,e.event.posy,!1)}if(i.type===7&&t.shouldShowHoverAt(i.range))return new FL(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===6&&i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new FL(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(i.type===9&&i.element){const s=NN.getWarningWidgetContext(i.element);if(s&&t.shouldShowHoverAt(s.range))return new FL(1e3,this,s.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if(this._editor.getOption(71).showToolbar!=="onHover")return[];const i=Ia.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new jlt(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new ne,s=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(12)&&i.add(this.renderScreenReaderText(e,s));const o=s.controller.model.get(),r=document.createElement("div");e.fragment.appendChild(r),i.add(ko((l,c)=>{const d=c.add(this._instantiationService.createInstance(DS.hot.read(l),this._editor,!1,wi(null),o.selectedInlineCompletionIndex,o.inlineCompletionsCount,o.activeCommands,o.warning,()=>{e.onContentsChanged()}));r.replaceChildren(d.getDomNode())})),o.triggerExplicitly();const a={hoverPart:s,hoverElement:r,dispose(){i.dispose()}};return new Cw([a])}getAccessibleContent(e){return _(1205,"There are inline completions here")}renderScreenReaderText(e,t){const i=new ne,s=me,o=s("div.hover-row.markdown-hover"),r=he(o,s("div.hover-contents",{"aria-live":"assertive"})),a=l=>{const c=_(1206,"Suggestion:"),d=i.add(this._markdownRendererService.render(new Co().appendText(c).appendCodeblock("text",l),{context:this._editor,asyncRenderCallback:()=>{r.className="hover-contents code-hover-contents",e.onContentsChanged()}}));r.replaceChildren(d.element)};return i.add(qe(l=>{var d;const c=(d=t.controller.model.read(l))==null?void 0:d.primaryGhostText.read(l);if(c){const h=this._editor.getModel().getLineContent(c.lineNumber);a(c.renderForScreenReader(h))}else Ss(r)})),e.fragment.appendChild(o),i}};fq=zlt([Z2(1,Us),Z2(2,Ae),Z2(3,To),Z2(4,ed)],fq);class $lt{}At(Ia.ID,rot(Ia.hot),3);we(Olt);we(cq);we(dq);we(Flt);we(Blt);we(Wlt);we(hq);we(GO);we(Hlt);ni(uq);we(Vlt);ni(bz);ni(vz);Uw.register(fq);t8.register(new $lt);var Ult=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x6=function(n,e){return function(t,i){e(t,i,n)}},$L,$m;let RN=($m=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new ne,this.toUnhookForKeyboard=new ne,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new Z3(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{Je(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution($L.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}async startFindDefinition(e){var r;this.toUnhookForKeyboard.clear();const t=e?(r=this.editor.getModel())==null?void 0:r.getWordAtPosition(e):null;if(!t){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===t.startColumn&&this.currentWordAtPosition.endColumn===t.endColumn&&this.currentWordAtPosition.word===t.word)return;this.currentWordAtPosition=t;const i=new w1e(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=rs(a=>this.findDefinition(e,a));let s;try{s=await this.previousPromise}catch(a){Je(a);return}if(!s||!s.length||!i.validate(this.editor)){this.removeLinkDecorations();return}const o=s[0].originSelectionRange?D.lift(s[0].originSelectionRange):new D(e.lineNumber,t.startColumn,e.lineNumber,t.endColumn);if(s.length>1){let a=o;for(const{originSelectionRange:l}of s)l&&(a=D.plusRange(a,l));this.addDecoration(a,new Co().appendText(_(1077,"Click to show {0} definitions.",s.length)))}else{const a=s[0];return a.uri?this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const h=this.getPreviewValue(c,d,a),u=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(o,h?new Co().appendCodeblock(u||"",h):void 0),l.dispose()}):void 0}}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=$L.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),s=e.validateRange(s),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(101)&&!this.isInPeekEditor(i);return new zD({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(Xe);return Yr.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}},$L=$m,$m.ID="editor.contrib.gotodefinitionatposition",$m.MAX_SOURCE_PREVIEW_LINES=8,$m);RN=$L=Ult([x6(1,Qo),x6(2,un),x6(3,De)],RN);At(RN.ID,RN,2);class qlt extends Ne{constructor(){super({id:"editor.action.debugEditorGpuRenderer",label:ie(1101,"Developer: Debug Editor GPU Renderer"),precondition:le.true()})}async run(e,t){const i=e.get(Ae),o=await e.get(No).pick([{label:_(1098,"Log Texture Atlas Stats"),id:"logTextureAtlasStats"},{label:_(1099,"Save Texture Atlas"),id:"saveTextureAtlas"},{label:_(1100,"Draw Glyph"),id:"drawGlyph"}],{canPickMany:!1});if(o)switch(o.id){case"logTextureAtlasStats":i.invokeFunction(r=>{const a=r.get(Li),l=$o.atlas;if(!$o.atlas){a.error("No texture atlas found");return}const c=l.getStats();a.info(["Texture atlas stats",...c].join(` -`))});break;case"saveTextureAtlas":i.invokeFunction(async r=>{const a=r.get(Rg),l=r.get(Ele),c=a.getWorkspace().folders;if(c.length>0){const d=jo.atlas,h=[];for(const[u,f]of d.pages.entries())h.push(l.writeFile(He.joinPath(c[0].uri,`textureAtlasPage${u}_actual.png`),ym.wrap(new Uint8Array(await(await f.source.convertToBlob()).arrayBuffer()))),l.writeFile(He.joinPath(c[0].uri,`textureAtlasPage${u}_usage.png`),ym.wrap(new Uint8Array(await(await f.getUsagePreview()).arrayBuffer()))));await Promise.all(h)}});break;case"drawGlyph":i.invokeFunction(async r=>{var R,M,A;const a=r.get(lt),l=r.get(Ele),c=r.get(Do),h=r.get(Rg).getWorkspace().folders;if(h.length===0)return;const u=jo.atlas,f=a.getValue("editor.fontFamily"),g=a.getValue("editor.fontSize"),p=new PI(g,f,ii().devicePixelRatio,jo.decorationStyleCache);let m=await c.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!m)return;const b=(M=(R=m.match(/0x(?[0-9a-f]+)/i))==null?void 0:R.groups)==null?void 0:M.codePoint;b!==void 0&&(m=String.fromCodePoint(parseInt(b,16)));const v=0,C=u.getGlyph(p,m,v,0,0);if(!C)return;const S=(A=u.pages[C.pageIndex].source.getContext("2d"))==null?void 0:A.getImageData(C.x,C.y,C.w,C.h);if(!S)return;const L=new OffscreenCanvas(S.width,S.height);ow(L.getContext("2d")).putImageData(S,0,0);const E=await L.convertToBlob({type:"image/png"}),I=He.joinPath(h[0].uri,`glyph_${m}_${v}_${g}px_${f.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await l.writeFile(I,ym.wrap(new Uint8Array(await E.arrayBuffer())))});break}}}we(Glt);var md;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(md||(md={}));class Ylt extends Ne{constructor(){super({id:wwe,label:ie(1107,"Show or Focus Hover"),metadata:{description:ie(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[md.NoAutoFocus,md.FocusIfVisible,md.AutoFocusImmediately],enumDescriptions:[_(1104,"The hover will not automatically take focus."),_(1105,"The hover will take focus only if it is already visible."),_(1106,"The hover will automatically take focus when it appears.")],default:md.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:Wn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=To.get(t);if(!s)return;const o=i==null?void 0:i.focus;let r=md.FocusIfVisible;Object.values(md).includes(o)?r=o:typeof o=="boolean"&&o&&(r=md.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),h=new D(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(h,1,2,c)},l=t.getOption(2)===2;s.isHoverVisible?r!==md.NoAutoFocus?s.focus():a(l):a(l||r===md.AutoFocusImmediately)}}class Zlt extends Ne{constructor(){super({id:mtt,label:ie(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:ie(1110,"Show the definition preview hover in the editor.")}})}run(e,t){const i=To.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new D(s.lineNumber,s.column,s.lineNumber,s.column),r=RN.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,2,!0)})}}class Xlt extends Ne{constructor(){super({id:_tt,label:ie(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){var i;(i=To.get(t))==null||i.hideContentHover()}}class Qlt extends Ne{constructor(){super({id:btt,label:ie(1112,"Scroll Up Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:16,weight:100},metadata:{description:ie(1113,"Scroll up the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.scrollUp()}}class Jlt extends Ne{constructor(){super({id:vtt,label:ie(1114,"Scroll Down Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:18,weight:100},metadata:{description:ie(1115,"Scroll down the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.scrollDown()}}class ect extends Ne{constructor(){super({id:wtt,label:ie(1116,"Scroll Left Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:15,weight:100},metadata:{description:ie(1117,"Scroll left the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.scrollLeft()}}class tct extends Ne{constructor(){super({id:Ctt,label:ie(1118,"Scroll Right Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:17,weight:100},metadata:{description:ie(1119,"Scroll right the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.scrollRight()}}class ict extends Ne{constructor(){super({id:ytt,label:ie(1120,"Page Up Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:ie(1121,"Page up the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.pageUp()}}class nct extends Ne{constructor(){super({id:Stt,label:ie(1122,"Page Down Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:ie(1123,"Page down the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.pageDown()}}class sct extends Ne{constructor(){super({id:xtt,label:ie(1124,"Go To Top Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:ie(1125,"Go to the top of the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.goToTop()}}class oct extends Ne{constructor(){super({id:Ltt,label:ie(1126,"Go To Bottom Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:ie(1127,"Go to the bottom of the editor hover.")}})}run(e,t){const i=To.get(t);i&&i.goToBottom()}}class rct extends Ne{constructor(){super({id:q3,label:ktt,alias:"Increase Hover Verbosity Level",precondition:H.hoverVisible})}run(e,t,i){const s=To.get(t);if(!s)return;const o=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();s.updateHoverVerbosityLevel(aa.Increase,o,i==null?void 0:i.focus)}}class act extends Ne{constructor(){super({id:K3,label:Ett,alias:"Decrease Hover Verbosity Level",precondition:H.hoverVisible})}run(e,t,i){var r;const s=To.get(t);if(!s)return;const o=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();(r=To.get(t))==null||r.updateHoverVerbosityLevel(aa.Decrease,o,i==null?void 0:i.focus)}}class lct{constructor(e){this._editor=e}computeSync(e){var r;const t=a=>({value:a}),i=this._editor.getLineDecorations(e.lineNumber),s=[],o=e.laneOrLine==="lineNo";if(!i)return s;for(const a of i){const l=((r=a.options.glyphMargin)==null?void 0:r.position)??Zd.Center;if(!o&&l!==e.laneOrLine)continue;const c=o?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||xS(c)||s.push(...yG(c).map(t))}return s}}var cct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dct=function(n,e){return function(t,i){e(t,i,n)}},pq;const Gle=me;var E1;let mq=(E1=class extends G{constructor(e,t){super(),this._markdownRendererService=t,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new ne),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new fZ(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new xwe(this._editor,new lct(this._editor))),this._register(this._hoverOperation.onResult(i=>this._withResult(i))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(59)&&this._updateFont()})),this._register(xn(this._hover.containerDomNode,"mouseleave",i=>{this._onMouseLeave(i)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return pq.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const s=document.createDocumentFragment();for(const o of i){const r=Gle("div.hover-row.markdown-hover"),a=ue(r,Gle("div.hover-contents")),l=this._renderDisposeables.add(this._markdownRendererService.render(o.value,{context:this._editor}));a.appendChild(l.element),s.appendChild(r)}this._updateContents(s),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),s=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(75),a=this._hover.containerDomNode.clientHeight,l=s-o-(a-r)/2,c=i.glyphMarginLeft+i.glyphMarginWidth+(t==="lineNo"?i.lineNumbersWidth:0),h=i.height-a,u=Math.max(0,Math.min(Math.round(l),h));if(this._editor.getOption(51)){const g=this._editor.getDomNode();if(g){const p=dn(g);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${p.left+c}px`,this._hover.containerDomNode.style.top=`${p.top+u}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${u}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!G3(t,e.x,e.y))&&this.hide()}},pq=E1,E1.ID="editor.contrib.modesGlyphHoverWidget",E1);mq=pq=cct([dct(1,Jc)],mq);var hct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},uct=function(n,e){return function(t,i){e(t,i,n)}},Py;let YO=(Py=class extends G{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new ne,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ai(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnGlyphHoverWidget(e)&&this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?G3(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e))||this.hideGlyphHover()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this.hideGlyphHover()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this.hideGlyphHover())}hideGlyphHover(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(mq,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},Py.ID="editor.contrib.marginHover",Py);YO=hct([uct(1,Ae)],YO);class fct{}class gct{}class pct{}At(To.ID,To,2);At(YO.ID,YO,2);we(Ylt);we(Zlt);we(Xlt);we(Qlt);we(Jlt);we(ect);we(tct);we(ict);we(nct);we(sct);we(oct);we(rct);we(act);Gw.register(vN);Gw.register(sU);gc((n,e)=>{const t=n.getColor(CY);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});t8.register(new fct);t8.register(new gct);t8.register(new pct);function UCe(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const s=e.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;if(!s)return[];const o=new PY(n,s,e);for(i=Math.min(i,n.getLineCount());t<=i&&o.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=n.getOptions(),c=(p,m)=>(m=m||1,cc.shiftIndent(p,p.length+m,r,a,l)),d=(p,m)=>(m=m||1,cc.unshiftIndent(p,p.length+m,r,a,l)),h=[],u=n.getLineContent(t);let f=mi(u),g=f;o.shouldIncrease(t)?(g=c(g),f=c(f)):o.shouldIndentNextLine(t)&&(g=c(g)),t++;for(let p=t;p<=i;p++){if(mct(n,p))continue;const m=n.getLineContent(p),b=mi(m),v=g;o.shouldDecrease(p,v)&&(g=d(g),f=d(f)),b!==g&&h.push(ln.replaceMove(new Ie(p,1,p,b.length+1),MY(g,a,l))),!o.shouldIgnore(p)&&(o.shouldIncrease(p,v)?(f=c(f),g=f):o.shouldIndentNextLine(p,v)?g=c(g):g=f)}return h}function mct(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var _ct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bct=function(n,e){return function(t,i){e(t,i,n)}};const AF=class AF extends Ne{constructor(){super({id:AF.ID,label:ie(1148,"Convert Indentation to Spaces"),precondition:H.writable,metadata:{description:ie(1149,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new Sct(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};AF.ID="editor.action.indentationToSpaces";let _q=AF;const PF=class PF extends Ne{constructor(){super({id:PF.ID,label:ie(1150,"Convert Indentation to Tabs"),precondition:H.writable,metadata:{description:ie(1151,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new xct(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};PF.ID="editor.action.indentationToTabs";let bq=PF;class eQ extends Ne{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(Do),s=e.get(qi),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?_(1144,"Configured Tab Size"):d===r.tabSize?_(1145,"Default Tab Size"):d===a.tabSize?_(1146,"Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:_(1147,"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const OF=class OF extends eQ{constructor(){super(!1,!1,{id:OF.ID,label:ie(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:ie(1153,"Use indentation with tabs.")}})}};OF.ID="editor.action.indentUsingTabs";let vq=OF;const FF=class FF extends eQ{constructor(){super(!0,!1,{id:FF.ID,label:ie(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:ie(1155,"Use indentation with spaces.")}})}};FF.ID="editor.action.indentUsingSpaces";let wq=FF;const BF=class BF extends eQ{constructor(){super(!0,!0,{id:BF.ID,label:ie(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:ie(1157,"Change the space size equivalent of the tab.")}})}};BF.ID="editor.action.changeTabDisplaySize";let Cq=BF;const WF=class WF extends Ne{constructor(){super({id:WF.ID,label:ie(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:ie(1159,"Detect the indentation from content.")}})}run(e,t){const i=e.get(qi),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}};WF.ID="editor.action.detectIndentation";let yq=WF;class vct extends Ne{constructor(){super({id:"editor.action.reindentlines",label:ie(1160,"Reindent Lines"),precondition:H.writable,metadata:{description:ie(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(Ki),s=t.getModel();if(!s)return;const o=UCe(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class wct extends Ne{constructor(){super({id:"editor.action.reindentselectedlines",label:ie(1162,"Reindent Selected Lines"),precondition:H.writable,metadata:{description:ie(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(Ki),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=UCe(s,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class Cct{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(D.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var Oy;let ZO=(Oy=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new ne,this.callOnModel=new ne,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(!this.editor.getOption(17)||this.editor.getOption(16)<4)&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||!this.editor.getOption(18)&&yct(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(16),{tabSize:r,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],d={shiftIndent:g=>cc.shiftIndent(g,g.length+1,r,a,l),unshiftIndent:g=>cc.unshiftIndent(g,g.length+1,r,a,l)};let h=e.startLineNumber,u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const g=pk(o,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(g!==null){const p=mi(u),m=sa(g,r),b=sa(p,r);if(m!==b){const v=qk(m,r,l);c.push({range:new D(h,1,h,p.length+1),text:v}),u=v+u.substring(p.length)}else{const v=Fme(i,h,this._languageConfigurationService);if(v===0||v===8)return}}}const f=h;for(;hi.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,b)=>i.getLanguageIdAtPosition(m,b)},getLineContent:m=>m===f?u:i.getLineContent(m)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(p!==null){const m=sa(p,r),b=sa(mi(i.getLineContent(h+1)),r);if(m!==b){const v=m-b;for(let w=h+1;w<=e.endLineNumber;w++){const C=i.getLineContent(w),S=mi(C),x=sa(S,r)+v,E=qk(x,r,l);E!==S&&c.push({range:new D(w,1,w,S.length+1),text:E})}}}}if(c.length>0){this.editor.pushUndoStop();const g=new Cct(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",g),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=o=>o.trim().length===0;let s=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);s=i(r)}else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const r=e.getLineContent(o);if(o===t.startLineNumber){const a=r.substring(t.startColumn-1);s=i(a)}else if(o===t.endLineNumber){const a=r.substring(0,t.endColumn-1);s=i(a)}else s=e.getLineFirstNonWhitespaceColumn(o)===0;if(!s)break}return s}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},Oy.ID="editor.contrib.autoIndentOnPaste",Oy);ZO=_ct([bct(1,Ki)],ZO);function yct(n,e){const t=i=>c3e(n,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function qCe(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;r=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ect=function(n,e){return function(t,i){e(t,i,n)}},sM,qm;let WS=(qm=class{static get(e){return e.getContribution(sM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),s=this.editor.getModel();if(!s||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const r=new x1e(this.editor,5),a=s.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=ss(c=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{var g;if(!c||!c.range||!c.value||!r.validate(this.editor))return;const d=D.lift(c.range);let h=c.range;const u=c.value.length-(o.endColumn-o.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},u>1&&(o=new Ie(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+u-1));const f=new Lct(d,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,f),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:sM.DECORATION}]),(g=this.decorationRemover)==null||g.cancel(),this.decorationRemover=vu(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Je)}).catch(Je)):Promise.resolve(void 0)}},sM=qm,qm.ID="editor.contrib.inPlaceReplaceController",qm.DECORATION=nt.register({description:"in-place-replace",className:"valueSetReplacement"}),qm);WS=sM=kct([Ect(1,Zr)],WS);class Ict extends Ne{constructor(){super({id:"editor.action.inPlaceReplace.up",label:ie(1240,"Replace with Previous Value"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=WS.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class Nct extends Ne{constructor(){super({id:"editor.action.inPlaceReplace.down",label:ie(1241,"Replace with Next Value"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=WS.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}At(WS.ID,WS,4);we(Ict);we(Nct);class Dct{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=Tct(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Tct(n){const e=n.getLineCount(),t=n.getLineContent(e),i=zc(t)===-1;if(!(!e||i))return ln.insert(new U(e,n.getLineMaxColumn(e)),n.getEOL())}const HF=class HF extends Ne{constructor(){super({id:HF.ID,label:ie(1242,"Insert Final New Line"),precondition:H.writable})}run(e,t,i){const s=t.getSelection();if(s===null)return;const o=new Dct(s);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}};HF.ID="editor.action.insertFinalNewLine";let Sq=HF;we(Sq);class Rct extends Ne{constructor(){super({id:"expandLineSelection",label:ie(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:H.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,3,Bs.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}we(Rct);var Mct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Z2=function(n,e){return function(t,i){e(t,i,n)}},oM;const KCe=new Se("LinkedEditingInputVisible",!1),Act="linked-editing-decoration";var Km;let HS=(Km=class extends G{static get(e){return e.getContribution(oM.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new ne),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=KCe.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new ne),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(78)||r.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(ve.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new sc(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new sc(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const a=this._currentDecorations.getRange(0);if(a&&a.containsPosition(t))return}}if(!((r=this._currentRequestPosition)!=null&&r.equals(t))){const a=this._currentDecorations.getRange(0);a!=null&&a.containsPosition(t)||this.clearRanges()}this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=this._currentRequestCts=new Wi;try{const a=new xs(!1),l=await GCe(this._providers,i,t,o.token);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let d=!1;for(let u=0,f=c.length;u({range:u,options:oM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(a){fl(a)||Je(a),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}},oM=Km,Km.ID="editor.contrib.linkedEditing",Km.DECORATION=nt.register({description:"linked-editing",stickiness:0,className:Act}),Km);HS=oM=Mct([Z2(1,Xe),Z2(2,De),Z2(3,Ki),Z2(4,pc)],HS);class Pct extends Ne{constructor(){super({id:"editor.action.linkedEditing",label:ie(1276,"Start Linked Editing"),precondition:le.and(H.writable,H.hasRenameProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Ft),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return He.isUri(s)&&U.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Je):super.runCommand(e,t)}run(e,t){const i=HS.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const Oct=cs.bindToContribution(HS.get);ye(new Oct({id:"cancelLinkedEditingInput",precondition:KCe,handler:n=>n.clearRanges(),kbOpts:{kbExpr:H.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function GCe(n,e,t,i){const s=n.ordered(e);return zG(s.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){Bn(r);return}}),o=>!!o&&Go(o==null?void 0:o.ranges))}F("editor.linkedEditingBackground",{dark:se.fromHex("#f00").transparent(.3),light:se.fromHex("#f00").transparent(.3),hcDark:se.fromHex("#f00").transparent(.3),hcLight:se.white},_(1275,"Background color when the editor auto renames on type."));Yr("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(De);return GCe(i,e,t,vt.None)});At(HS.ID,HS,1);we(Pct);let Fct=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};const CE=class CE{constructor(e){this._disposables=new ne;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new Fct(r,s));t=CE._union(t,o),Rw(i)&&(this._disposables??(this._disposables=new ne),this._disposables.add(i))}this.links=t}dispose(){var e;(e=this._disposables)==null||e.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;s{try{const l=await r.provideLinks(e,t);l&&(i[a]=[l,r])}catch(l){Bn(l)}});await Promise.all(s);let o=new XO(rh(i));return t.isCancellationRequested&&(o.dispose(),o=XO.Empty),o}Rt.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;Ot(t instanceof He),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(De),o=n.get(qi).getModel(t);if(!o)return[];const r=await YCe(s,o,vt.None);if(!r)return[];for(let l=0;l=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X2=function(n,e){return function(t,i){e(t,i,n)}},xq,I1;let MN=(I1=class extends G{static get(e){return e.getContribution(xq.ID)}constructor(e,t,i,s,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new ai(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new Z3(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=ss(t=>YCe(this.providers,e,t));try{const t=new xs(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Je(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(86)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(Ey.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(86)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(vt.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Ge.file&&o.startsWith(`${Ge.file}:`)){const a=He.parse(o);if(a.scheme===Ge.file){const l=kh(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(o=bpe(r,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(_(1277,"Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(_(1278,"Failed to open this link because its target is missing.")):Je(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink"))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)==null||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},xq=I1,I1.ID="editor.linkDetector",I1);MN=xq=Bct([X2(1,jg),X2(2,fn),X2(3,De),X2(4,pc)],MN);const Yle={general:nt.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:nt.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Ey{static decoration(e,t){return{range:e.range,options:Ey._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?Yle.active:Yle.general};return s.hoverMessage=Wct(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Ey._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Ey._getOptions(this.link,t,!1))}}function Wct(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?_(1279,"Execute command"):_(1280,"Follow link"),s=e?wt?_(1281,"cmd + click"):_(1282,"ctrl + click"):wt?_(1283,"option + click"):_(1284,"alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=_(1285,"Execute command {0}",l)}}return new yo("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${s})`)}else return new yo().appendText(`${i} (${s})`)}class Hct extends Ne{constructor(){super({id:"editor.action.openLink",label:ie(1286,"Open Link"),precondition:void 0})}run(e,t){const i=MN.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}At(MN.ID,MN,1);we(Hct);const LQ=class LQ extends G{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(133);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};LQ.ID="editor.contrib.longLinesHelper";let QO=LQ;At(QO.ID,QO,2);const kQ=class kQ extends G{constructor(e){super(),this._editor=e;const t=Ui(this._editor),i=t.getOption(171);this._register(qe(s=>{if(!i.read(s))return;const o=t.domNode.read(s);if(!o)return;const r=s.store.add(QG("scrollingSession",void 0));s.store.add(this._editor.onMouseDown(l=>{if(r.read(void 0)){r.set(void 0,void 0);return}if(!l.event.middleButton)return;l.event.stopPropagation(),l.event.preventDefault();const d=new ne,h=new bs(l.event.posx,l.event.posy),f=Vct(Oe(o),h,d).map(m=>m.subtract(h).withThreshold(5)),g=o.getBoundingClientRect(),p=new bs(h.x-g.left,h.y-g.top);r.set({mouseDeltaAfterThreshold:f,initialMousePosInEditor:p,didScroll:!1,dispose:()=>d.dispose()},void 0),d.add(this._editor.onMouseUp(m=>{const b=r.read(void 0);b&&b.didScroll&&r.set(void 0,void 0)})),d.add(this._editor.onKeyDown(m=>{r.set(void 0,void 0)}))})),s.store.add(qe(l=>{const c=r.read(l);if(!c)return;let d=Date.now();l.store.add(qe(u=>{OO.instance.invalidateOnNextAnimationFrame(u);const f=Date.now(),g=f-d;d=f;const p=c.mouseDeltaAfterThreshold.read(void 0),m=g/32,b=p.scale(m),v=new bs(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(zct(v.add(b))),b.isZero()||(c.didScroll=!0)}));const h=oe(u=>{const f=c.mouseDeltaAfterThreshold.read(u);let g="";return g+=f.y<0?"n":f.y>0?"s":"",g+=f.x<0?"w":f.x>0?"e":"",g});l.store.add(qe(u=>{o.setAttribute("data-scroll-direction",h.read(u))}))}));const a=s.store.add(ht.div({class:["scroll-editor-on-middle-click-dot",r.map(l=>l?"":"hidden")],style:{left:r.map(l=>l?l.initialMousePosInEditor.x:0),top:r.map(l=>l?l.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());s.store.add(w0(o,a.element)),s.store.add(qe(l=>{const c=r.read(l);o.classList.toggle("scroll-editor-on-middle-click-editor",!!c)}))}))}};kQ.ID="editor.contrib.middleScroll";let JO=kQ;function Vct(n,e,t){const i=Ze("pos",e);return t.add(J(n,"mousemove",s=>{i.set(new bs(s.pageX,s.pageY),void 0)})),i}function zct(n){return{scrollLeft:n.x,scrollTop:n.y}}At(JO.ID,JO,2);const jct=F("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},_(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},_(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.wordHighlightTextBackground",jct,_(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const $ct=F("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Vi,hcLight:Vi},_(1566,"Border color of a symbol during read-access, like reading a variable."));F("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Vi,hcLight:Vi},_(1567,"Border color of a symbol during write-access, like writing to a variable."));F("editor.wordHighlightTextBorder",$ct,_(1568,"Border color of a textual occurrence for a symbol."));const Uct=F("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",_(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),qct=F("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",_(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Kct=F("editorOverviewRuler.wordHighlightTextForeground",fme,_(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),Gct=nt.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:an(qct),position:ll.Center},minimap:{color:an(h3),position:1}}),Yct=nt.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:an(Kct),position:ll.Center},minimap:{color:an(h3),position:1}}),Zct=nt.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:an(fme),position:ll.Center},minimap:{color:an(h3),position:1}}),Xct=nt.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),Qct=nt.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:an(Uct),position:ll.Center},minimap:{color:an(h3),position:1}});function Jct(n){return n===rS.Write?Gct:n===rS.Text?Yct:Qct}function edt(n){return n?Xct:Zct}gc((n,e)=>{const t=n.getColor(wY);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var tdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},idt=function(n,e){return function(t,i){e(t,i,n)}},Lq;function L_(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?_(1288,"Cursor added: {0}",i):_(1289,"Cursors added: {0}",i);Xd(s)}}class ndt extends Ne{constructor(){super({id:"editor.action.insertCursorAbove",label:ie(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1290,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Bs.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),L_(r,o.getCursorStates())}}class sdt extends Ne{constructor(){super({id:"editor.action.insertCursorBelow",label:ie(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1291,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Bs.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),L_(r,o.getCursorStates())}}class odt extends Ne{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:ie(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new Ie(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),L_(r,o.getCursorStates())}}class rdt extends Ne{constructor(){super({id:"editor.action.addCursorsToBottom",label:ie(1301,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new Ie(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),L_(a,r.getCursorStates())}}class adt extends Ne{constructor(){super({id:"editor.action.addCursorsToTop",label:ie(1302,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new Ie(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),L_(r,o.getCursorStates())}}class Q2{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class AN{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new AN(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const h=e.getConfiguredWordAtPosition(l.getStartPosition());if(!h)return null;c=h.word,d=new Ie(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new AN(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Q2(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Q2(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Ie(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Q2(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Q2(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Ie(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}const VF=class VF extends G{static get(e){return e.getContribution(VF.ID)}constructor(e){super(),this._sessionDispose=this._register(new ne),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=AN.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new Ie(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!ZCe(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew Ie(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}};VF.ID="editor.contrib.multiCursorController";let VS=VF;class _x extends Ne{run(e,t){const i=VS.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=Gr.get(t);if(r)this._run(i,r);else{const a=e.get(Ae).createInstance(Gr,t);this._run(i,a),a.dispose()}L_(o,s.getCursorStates())}}}class ldt extends _x{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:ie(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2082,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1293,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class cdt extends _x{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:ie(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1294,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class ddt extends _x{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:ie(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:Wn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class hdt extends _x{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:ie(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class udt extends _x{constructor(){super({id:"editor.action.selectHighlights",label:ie(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:3114,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1295,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class fdt extends _x{constructor(){super({id:"editor.action.changeAll",label:ie(1308,"Change All Occurrences"),precondition:le.and(H.writable,H.editorTextFocus),kbOpts:{kbExpr:H.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class gdt{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(D.compareRangesUsingStarts)),this._cachedFindMatches}}var N1;let e4=(N1=class extends G{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new ai(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=Gr.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(Lq._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,s,o){if(!t||!o.hasModel())return null;if(!i){const h=o.getSelection();if(h.startLineNumber!==h.endLineNumber)return null}const r=VS.get(o);if(!r)return null;const a=Gr.get(o);if(!a)return null;let l=r.getSession(a);if(!l){const h=o.getSelections();if(h.length>1){const f=a.getState().matchCase;if(!ZCe(o.getModel(),h,f))return null}l=AN.create(o,a)}if(!l||l.currentMatch||/^[ \t]+$/.test(l.searchText)||s>0&&l.searchText.length>s)return null;const c=a.getState(),d=c.matchCase;if(c.isRevealed){let h=c.searchString;d||(h=h.toLowerCase());let u=l.searchText;if(d||(u=u.toLowerCase()),h===u&&l.matchCase===c.matchCase&&l.wholeWord===c.wholeWord&&!c.isRegex)return null}return new gdt(o.getModel(),l.searchText,l.matchCase,l.wholeWord?o.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(D.compareRangesUsingStarts);const o=[];for(let c=0,d=0,h=i.length,u=s.length;c=u)o.push(f),c++;else{const g=D.compareRangesUsingStarts(f,s[d]);g<0?((s[d].isEmpty()||!D.areIntersecting(f,s[d]))&&o.push(f),c++):(g>0||c++,d++)}}const r=this.editor.getOption(90)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=o.map(c=>({range:c,options:edt(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}},Lq=N1,N1.ID="editor.contrib.selectionHighlighter",N1);e4=Lq=tdt([idt(1,De)],e4);function ZCe(n,e,t){const i=Zle(n,e[0],!t);for(let s=1,o=e.length;s{const[t,i,s]=e;Ot(He.isUri(t)),Ot(U.isIPosition(i)),Ot(typeof s=="string"||!s);const o=n.get(De),r=await n.get(Xo).createModelReference(t);try{const a=await XCe(o.signatureHelpProvider,r.object.textEditorModel,U.lift(i),{triggerKind:uu.Invoke,isRetrigger:!1,triggerCharacter:s},vt.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var Lp;(function(n){n.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(Lp||(Lp={}));const zF=class zF extends G{constructor(e,t,i=zF.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new q),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=Lp.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Kt),this.triggerChars=new CA,this.retriggerChars=new CA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new sc(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=Lp.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(Je)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(98).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(98).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new Lp.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(_dt);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new Lp.Pending(ss(l=>XCe(this.providers,r,a,o,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new Lp.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=Lp.Default),Je(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:uu.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:uu.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:uu.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};zF.DEFAULT_DELAY=120;let kq=zF;function _dt(n,e){switch(e.triggerKind){case uu.Invoke:return e;case uu.ContentChange:return n;case uu.TriggerCharacter:default:return e}}var bdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xle=function(n,e){return function(t,i){e(t,i,n)}},Eq;const Aa=me,vdt=Ai("parameter-hints-next",de.chevronDown,_(1312,"Icon for show next parameter hint.")),wdt=Ai("parameter-hints-previous",de.chevronUp,_(1313,"Icon for show previous parameter hint."));var D1;let Iq=(D1=class extends G{constructor(e,t,i,s){super(),this.editor=e,this.model=t,this.markdownRendererService=s,this.renderDisposeables=this._register(new ne),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=Iw.Visible.bindTo(i),this.keyMultipleSignatures=Iw.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Aa(".editor-widget.parameter-hints-widget"),t=ue(e,Aa(".phwrapper"));t.tabIndex=-1;const i=ue(t,Aa(".controls")),s=ue(i,Aa(".button"+Ue.asCSSSelector(wdt))),o=ue(i,Aa(".overloads")),r=ue(i,Aa(".button"+Ue.asCSSSelector(vdt)));this._register(J(s,"click",u=>{Wt.stop(u),this.previous()})),this._register(J(r,"click",u=>{Wt.stop(u),this.next()}));const a=Aa(".body"),l=new wD(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=ue(a,Aa(".signature")),d=ue(a,Aa(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(59),f=this.domNodes.element;f.style.fontSize=`${u.fontSize}px`,f.style.lineHeight=`${u.lineHeight/u.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",Hr.fontFamily)};h(),this._register(ve.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(59)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)==null||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)==null||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=ue(this.domNodes.signature,Aa(".code")),o=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(o)this.renderParameters(s,i,r);else{const c=ue(s,Aa("span"));c.textContent=i.label}const a=i.parameters[r];if(a!=null&&a.documentation){const c=Aa("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);c.appendChild(d.element)}ue(this.domNodes.docs,Aa("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")ue(this.domNodes.docs,Aa("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);ue(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const d=i.parameters[r];Array.isArray(d.label)?c=i.label.substring(d.label[0],d.label[1]):c=d.label,d.documentation&&(c+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(_r(_(1314,"{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{var i;(i=this.domNodes)==null||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&Kp(t.documentation).length>0||t&&typeof t.documentation=="object"&&Kp(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&Kp(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&Kp(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),ue(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${va(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return Eq.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},Eq=D1,D1.ID="editor.widget.parameterHintsWidget",D1);Iq=Eq=bdt([Xle(2,Xe),Xle(3,Jc)],Iq);F("editorHoverWidget.highlightForeground",u0,_(1315,"Foreground color of the active item in the parameter hint."));var Cdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qle=function(n,e){return function(t,i){e(t,i,n)}},Nq,T1;let zS=(T1=class extends G{static get(e){return e.getContribution(Nq.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new kq(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var o;s?(this.widget.value.show(),this.widget.value.render(s)):(o=this.widget.rawValue)==null||o.hide()})),this.widget=new oo(()=>this._register(t.createInstance(Iq,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},Nq=T1,T1.ID="editor.controller.parameterHints",T1);zS=Nq=Cdt([Qle(1,Ae),Qle(2,De)],zS);class ydt extends Ne{constructor(){super({id:"editor.action.triggerParameterHints",label:ie(1311,"Trigger Parameter Hints"),precondition:H.hasSignatureHelpProvider,kbOpts:{kbExpr:H.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=zS.get(t);i==null||i.trigger({triggerKind:uu.Invoke})}}At(zS.ID,zS,2);we(ydt);const tQ=175,iQ=cs.bindToContribution(zS.get);ye(new iQ({id:"closeParameterHints",precondition:Iw.Visible,handler:n=>n.cancel(),kbOpts:{weight:tQ,kbExpr:H.focus,primary:9,secondary:[1033]}}));ye(new iQ({id:"showPrevParameterHint",precondition:le.and(Iw.Visible,Iw.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:tQ,kbExpr:H.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));ye(new iQ({id:"showNextParameterHint",precondition:le.and(Iw.Visible,Iw.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:tQ,kbExpr:H.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));const EQ=class EQ extends G{constructor(e){super(),this._editor=e,this._editorObs=Ui(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=no({owner:this,equalsFn:_H},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=Sdt(this,t=>{var i;return((i=this._state.read(t))==null?void 0:i.placeholder)!==void 0}),this._view=oe(t=>{if(!this._shouldViewBeAlive.read(t))return;const i=Pt("div.editorPlaceholder");t.store.add(qe(s=>{const o=this._state.read(s),r=(o==null?void 0:o.placeholder)!==void 0;i.root.style.display=r?"block":"none",i.root.innerText=(o==null?void 0:o.placeholder)??""})),t.store.add(qe(s=>{const o=this._editorObs.layoutInfo.read(s);i.root.style.left=`${o.contentLeft}px`,i.root.style.width=o.contentWidth-o.verticalScrollbarWidth+"px",i.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),t.store.add(qe(s=>{i.root.style.fontFamily=this._editorObs.getOption(58).read(s),i.root.style.fontSize=this._editorObs.getOption(61).read(s)+"px",i.root.style.lineHeight=this._editorObs.getOption(75).read(s)+"px"})),t.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:Ci(0),position:Ci(null),domNode:i.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};EQ.ID="editor.contrib.placeholderText";let t4=EQ;function Sdt(n,e){return Hg(n,(t,i)=>i===!0?!0:e(t))}var xdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ldt=function(n,e){return function(t,i){e(t,i,n)}};class kdt{constructor(e){this.instantiationService=e}init(...e){}}function Edt(n){return n()}let Jle=class extends kdt{constructor(e,t){super(t),this.init(e)}};Jle=xdt([Ldt(1,Ae)],Jle);At(t4.ID,Edt(()=>t4),0);F("editor.placeholder.foreground",M6e,_(1334,"Foreground color of the placeholder text in the editor."));var Idt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},J2=function(n,e){return function(t,i){e(t,i,n)}};const bx=new Se("renameInputVisible",!1,_(1391,"Whether the rename input widget is visible"));new Se("renameInputFocused",!1,_(1392,"Whether the rename input widget is focused"));let Dq=class{constructor(e,t,i,s,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new ne,this._visibleContextKey=bx.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new xs,this._inputWithButton=new Ndt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(59)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new nQ(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(sx),i=e.getColor(xY);this._domNode.style.backgroundColor=String(e.getColor(el)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(gme)??"");const s=e.getColor(pme);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(tV)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(tV)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=(s==null?void 0:s.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;Ot(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=e_(this.getDomNode().ownerDocument.body),t=dn(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(75),{totalHeight:o}=PN.getLayoutInfo({lineHeight:s}),r=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:r}}beforeRender(){var i,s;const[e,t]=this._acceptKeybindings;return this._label.innerText=_(1393,"{0} to Rename, {1} to Preview",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(s=this._keybindingService.lookupKeybinding(t))==null?void 0:s.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Ot(this._renameCandidateListView),Ot(this._nPxAvailableAbove!==void 0),Ot(this._nPxAvailableBelow!==void 0);const t=zf(this._inputWithButton.domNode),i=zf(this._label);let s;e===2?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:ra(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const l=new ne;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),l.add(J(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(J(this._inputWithButton.button,_e.KEY_DOWN,d=>{const h=new ui(d);(h.equals(3)||h.equals(10))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new U(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(Re(()=>{this._renameCts=void 0,o.dispose(!0)})),l.add(Re(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(Re(()=>this._candidates.clear()));const c=new Mw;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=d=>{var h;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(h=this._renameCandidateListView)==null||h.clearCandidates(),c.complete(d),!0},this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Ot(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const g=this._renameCandidateListView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),u=g,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var d;return this.cancelInput(!((d=this._domNode)!=null&&d.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Ot(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Wi;const i=t?sI.Invoke:sI.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){Ot(this._editor.hasModel());const i=this._editor.getSelection();let s=0,o=t.length;return!D.isEmpty(i)&&!D.spansMultipleLines(i)&&D.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...c)=>this._trace("_updateRenameCandidates",...c);s("start");const o=await lS(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(c=>c.status==="fulfilled"&&Ts(c.value)?c.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=bg(r,c=>c.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(s(`valid distinct candidates - ${r.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(l),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};Dq=Idt([J2(2,en),J2(3,Ht),J2(4,Xe),J2(5,ki)],Dq);class nQ{constructor(e,t){this._disposables=new ne,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=nQ._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(zw({listInactiveFocusForeground:II,listInactiveFocusBackground:NI}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Xd(_(1394,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=PN.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new PN(r,i)}renderElement(r,a,l){l.populate(r)}disposeTemplate(r){r.dispose()}};return new pl("NewSymbolNameCandidates",e,s,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class Ndt{constructor(){this._buttonHoverContent="",this._onDidInputChange=new q,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new ne}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",_(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=_(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=_(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(ed().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(J(this.input,_e.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(J(this.input,_e.KEY_DOWN,e=>{const t=new ui(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(J(this.input,_e.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(J(this.input,_e.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(J(this.input,_e.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Ot(this._inputNode),this._inputNode}get button(){return Ot(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=eh(de.sparkle)),js(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??(this._stopIcon=eh(de.stopCircle)),js(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}const yE=class yE{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${yE._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=eh(de.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Ms(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(hW.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+yE._PADDING*2}}dispose(){}};yE._PADDING=2;let PN=yE;var Ddt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nb=function(n,e){return function(t,i){e(t,i,n)}},Tq;class sQ{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` +`))});break;case"saveTextureAtlas":i.invokeFunction(async r=>{const a=r.get(Rg),l=r.get(Lle),c=a.getWorkspace().folders;if(c.length>0){const d=$o.atlas,h=[];for(const[u,f]of d.pages.entries())h.push(l.writeFile(He.joinPath(c[0].uri,`textureAtlasPage${u}_actual.png`),Cm.wrap(new Uint8Array(await(await f.source.convertToBlob()).arrayBuffer()))),l.writeFile(He.joinPath(c[0].uri,`textureAtlasPage${u}_usage.png`),Cm.wrap(new Uint8Array(await(await f.getUsagePreview()).arrayBuffer()))));await Promise.all(h)}});break;case"drawGlyph":i.invokeFunction(async r=>{var R,M,A;const a=r.get(lt),l=r.get(Lle),c=r.get(No),h=r.get(Rg).getWorkspace().folders;if(h.length===0)return;const u=$o.atlas,f=a.getValue("editor.fontFamily"),g=a.getValue("editor.fontSize"),p=new PE(g,f,ii().devicePixelRatio,$o.decorationStyleCache);let m=await c.input({prompt:"Enter a character to draw (prefix with 0x for code point))"});if(!m)return;const b=(M=(R=m.match(/0x(?[0-9a-f]+)/i))==null?void 0:R.groups)==null?void 0:M.codePoint;b!==void 0&&(m=String.fromCodePoint(parseInt(b,16)));const v=0,C=u.getGlyph(p,m,v,0,0);if(!C)return;const S=(A=u.pages[C.pageIndex].source.getContext("2d"))==null?void 0:A.getImageData(C.x,C.y,C.w,C.h);if(!S)return;const L=new OffscreenCanvas(S.width,S.height);iw(L.getContext("2d")).putImageData(S,0,0);const I=await L.convertToBlob({type:"image/png"}),E=He.joinPath(h[0].uri,`glyph_${m}_${v}_${g}px_${f.replaceAll(/[,\\\/\.'\s]/g,"_")}.png`);await l.writeFile(E,Cm.wrap(new Uint8Array(await I.arrayBuffer())))});break}}}we(qlt);var bd;(function(n){n.NoAutoFocus="noAutoFocus",n.FocusIfVisible="focusIfVisible",n.AutoFocusImmediately="autoFocusImmediately"})(bd||(bd={}));class Klt extends Ne{constructor(){super({id:mwe,label:ie(1107,"Show or Focus Hover"),metadata:{description:ie(1108,"Show or focus the editor hover which shows documentation, references, and other content for a symbol at the current cursor position."),args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[bd.NoAutoFocus,bd.FocusIfVisible,bd.AutoFocusImmediately],enumDescriptions:[_(1104,"The hover will not automatically take focus."),_(1105,"The hover will take focus only if it is already visible."),_(1106,"The hover will automatically take focus when it appears.")],default:bd.FocusIfVisible}}}}]},precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:Fn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=Do.get(t);if(!s)return;const o=i==null?void 0:i.focus;let r=bd.FocusIfVisible;Object.values(bd).includes(o)?r=o:typeof o=="boolean"&&o&&(r=bd.AutoFocusImmediately);const a=c=>{const d=t.getPosition(),h=new D(d.lineNumber,d.column,d.lineNumber,d.column);s.showContentHover(h,1,2,c)},l=t.getOption(2)===2;s.isHoverVisible?r!==bd.NoAutoFocus?s.focus():a(l):a(l||r===bd.AutoFocusImmediately)}}class Glt extends Ne{constructor(){super({id:gtt,label:ie(1109,"Show Definition Preview Hover"),precondition:void 0,metadata:{description:ie(1110,"Show the definition preview hover in the editor.")}})}run(e,t){const i=Do.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new D(s.lineNumber,s.column,s.lineNumber,s.column),r=RN.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,2,!0)})}}class Ylt extends Ne{constructor(){super({id:ptt,label:ie(1111,"Hide Hover"),alias:"Hide Content Hover",precondition:void 0})}run(e,t){var i;(i=Do.get(t))==null||i.hideContentHover()}}class Zlt extends Ne{constructor(){super({id:mtt,label:ie(1112,"Scroll Up Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:16,weight:100},metadata:{description:ie(1113,"Scroll up the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.scrollUp()}}class Xlt extends Ne{constructor(){super({id:_tt,label:ie(1114,"Scroll Down Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:18,weight:100},metadata:{description:ie(1115,"Scroll down the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.scrollDown()}}class Qlt extends Ne{constructor(){super({id:btt,label:ie(1116,"Scroll Left Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:15,weight:100},metadata:{description:ie(1117,"Scroll left the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.scrollLeft()}}class Jlt extends Ne{constructor(){super({id:vtt,label:ie(1118,"Scroll Right Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:17,weight:100},metadata:{description:ie(1119,"Scroll right the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.scrollRight()}}class ect extends Ne{constructor(){super({id:wtt,label:ie(1120,"Page Up Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:11,secondary:[528],weight:100},metadata:{description:ie(1121,"Page up the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.pageUp()}}class tct extends Ne{constructor(){super({id:Ctt,label:ie(1122,"Page Down Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:12,secondary:[530],weight:100},metadata:{description:ie(1123,"Page down the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.pageDown()}}class ict extends Ne{constructor(){super({id:ytt,label:ie(1124,"Go To Top Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:14,secondary:[2064],weight:100},metadata:{description:ie(1125,"Go to the top of the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.goToTop()}}class nct extends Ne{constructor(){super({id:Stt,label:ie(1126,"Go To Bottom Hover"),precondition:H.hoverFocused,kbOpts:{kbExpr:H.hoverFocused,primary:13,secondary:[2066],weight:100},metadata:{description:ie(1127,"Go to the bottom of the editor hover.")}})}run(e,t){const i=Do.get(t);i&&i.goToBottom()}}class sct extends Ne{constructor(){super({id:q3,label:xtt,alias:"Increase Hover Verbosity Level",precondition:H.hoverVisible})}run(e,t,i){const s=Do.get(t);if(!s)return;const o=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();s.updateHoverVerbosityLevel(la.Increase,o,i==null?void 0:i.focus)}}class oct extends Ne{constructor(){super({id:K3,label:Ltt,alias:"Decrease Hover Verbosity Level",precondition:H.hoverVisible})}run(e,t,i){var r;const s=Do.get(t);if(!s)return;const o=(i==null?void 0:i.index)!==void 0?i.index:s.focusedHoverPartIndex();(r=Do.get(t))==null||r.updateHoverVerbosityLevel(la.Decrease,o,i==null?void 0:i.focus)}}class rct{constructor(e){this._editor=e}computeSync(e){var r;const t=a=>({value:a}),i=this._editor.getLineDecorations(e.lineNumber),s=[],o=e.laneOrLine==="lineNo";if(!i)return s;for(const a of i){const l=((r=a.options.glyphMargin)==null?void 0:r.position)??Qd.Center;if(!o&&l!==e.laneOrLine)continue;const c=o?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||yS(c)||s.push(...CG(c).map(t))}return s}}var act=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lct=function(n,e){return function(t,i){e(t,i,n)}},gq;const qle=me;var x1;let pq=(x1=class extends G{constructor(e,t){super(),this._markdownRendererService=t,this.allowEditorOverflow=!0,this._renderDisposeables=this._register(new ne),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new uZ(!0)),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._hoverOperation=this._register(new wwe(this._editor,new rct(this._editor))),this._register(this._hoverOperation.onResult(i=>this._withResult(i))),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(59)&&this._updateFont()})),this._register(kn(this._hover.containerDomNode,"mouseleave",i=>{this._onMouseLeave(i)})),this._editor.addOverlayWidget(this)}dispose(){this._hoverComputerOptions=void 0,this._editor.removeOverlayWidget(this),super.dispose()}getId(){return gq.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&this._hoverComputerOptions&&(this._hoverOperation.cancel(),this._hoverOperation.start(0,this._hoverComputerOptions))}showsOrWillShow(e){const t=e.target;return t.type===2&&t.detail.glyphMarginLane?(this._startShowingAt(t.position.lineNumber,t.detail.glyphMarginLane),!0):t.type===3?(this._startShowingAt(t.position.lineNumber,"lineNo"),!0):!1}_startShowingAt(e,t){this._hoverComputerOptions&&this._hoverComputerOptions.lineNumber===e&&this._hoverComputerOptions.laneOrLine===t||(this._hoverOperation.cancel(),this.hide(),this._hoverComputerOptions={lineNumber:e,laneOrLine:t},this._hoverOperation.start(0,this._hoverComputerOptions))}hide(){this._hoverComputerOptions=void 0,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e.value,this._messages.length>0?this._renderMessages(e.options.lineNumber,e.options.laneOrLine,this._messages):this.hide()}_renderMessages(e,t,i){this._renderDisposeables.clear();const s=document.createDocumentFragment();for(const o of i){const r=qle("div.hover-row.markdown-hover"),a=he(r,qle("div.hover-contents")),l=this._renderDisposeables.add(this._markdownRendererService.render(o.value,{context:this._editor}));a.appendChild(l.element),s.appendChild(r)}this._updateContents(s),this._showAt(e,t)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e,t){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const i=this._editor.getLayoutInfo(),s=this._editor.getTopForLineNumber(e),o=this._editor.getScrollTop(),r=this._editor.getOption(75),a=this._hover.containerDomNode.clientHeight,l=s-o-(a-r)/2,c=i.glyphMarginLeft+i.glyphMarginWidth+(t==="lineNo"?i.lineNumbersWidth:0),h=i.height-a,u=Math.max(0,Math.min(Math.round(l),h));if(this._editor.getOption(51)){const g=this._editor.getDomNode();if(g){const p=dn(g);this._hover.containerDomNode.style.position="fixed",this._hover.containerDomNode.style.left=`${p.left+c}px`,this._hover.containerDomNode.style.top=`${p.top+u}px`}}else this._hover.containerDomNode.style.position="absolute",this._hover.containerDomNode.style.left=`${c}px`,this._hover.containerDomNode.style.top=`${u}px`;this._hover.containerDomNode.style.zIndex="11"}_onMouseLeave(e){const t=this._editor.getDomNode();(!t||!G3(t,e.x,e.y))&&this.hide()}},gq=x1,x1.ID="editor.contrib.modesGlyphHoverWidget",x1);pq=gq=act([lct(1,ed)],pq);var cct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dct=function(n,e){return function(t,i){e(t,i,n)}},My;let YO=(My=class extends G{constructor(e,t){super(),this._editor=e,this._instantiationService=t,this.shouldKeepOpenOnEditorMouseMoveOrLeave=!1,this._listenersStore=new ne,this._hoverState={mouseDown:!1},this._reactToEditorMouseMoveRunner=this._register(new ai(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(69)&&(this._unhookListeners(),this._hookListeners())}))}_hookListeners(){const e=this._editor.getOption(69);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.hidingDelay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this.hideGlyphHover()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this.hideGlyphHover()}_onEditorMouseDown(e){this._hoverState.mouseDown=!0,!this._isMouseOnGlyphHoverWidget(e)&&this.hideGlyphHover()}_isMouseOnGlyphHoverWidget(e){var i;const t=(i=this._glyphWidget)==null?void 0:i.getDomNode();return t?G3(t,e.event.posx,e.event.posy):!1}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){this.shouldKeepOpenOnEditorMouseMoveOrLeave||(this._cancelScheduler(),this._isMouseOnGlyphHoverWidget(e))||this.hideGlyphHover()}_shouldNotRecomputeCurrentHoverWidget(e){const t=this._hoverSettings.sticky,i=this._isMouseOnGlyphHoverWidget(e);return t&&i}_onEditorMouseMove(e){if(this.shouldKeepOpenOnEditorMouseMoveOrLeave)return;if(this._mouseMoveEvent=e,this._shouldNotRecomputeCurrentHoverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){!e||this._tryShowHoverWidget(e)||this.hideGlyphHover()}_tryShowHoverWidget(e){return this._getOrCreateGlyphWidget().showsOrWillShow(e)}_onKeyDown(e){this._editor.hasModel()&&(e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||this.hideGlyphHover())}hideGlyphHover(){var e;(e=this._glyphWidget)==null||e.hide()}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=this._instantiationService.createInstance(pq,this._editor)),this._glyphWidget}dispose(){var e;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)==null||e.dispose()}},My.ID="editor.contrib.marginHover",My);YO=cct([dct(1,Ae)],YO);class hct{}class uct{}class fct{}At(Do.ID,Do,2);At(YO.ID,YO,2);we(Klt);we(Glt);we(Ylt);we(Zlt);we(Xlt);we(Qlt);we(Jlt);we(ect);we(tct);we(ict);we(nct);we(sct);we(oct);Uw.register(vN);Uw.register(nU);dc((n,e)=>{const t=n.getColor(wY);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});t8.register(new hct);t8.register(new uct);t8.register(new fct);function VCe(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return[];const s=e.getLanguageConfiguration(n.getLanguageId()).indentRulesSupport;if(!s)return[];const o=new AY(n,s,e);for(i=Math.min(i,n.getLineCount());t<=i&&o.shouldIgnore(t);)t++;if(t>i-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=n.getOptions(),c=(p,m)=>(m=m||1,oc.shiftIndent(p,p.length+m,r,a,l)),d=(p,m)=>(m=m||1,oc.unshiftIndent(p,p.length+m,r,a,l)),h=[],u=n.getLineContent(t);let f=pi(u),g=f;o.shouldIncrease(t)?(g=c(g),f=c(f)):o.shouldIndentNextLine(t)&&(g=c(g)),t++;for(let p=t;p<=i;p++){if(gct(n,p))continue;const m=n.getLineContent(p),b=pi(m),v=g;o.shouldDecrease(p,v)&&(g=d(g),f=d(f)),b!==g&&h.push(ln.replaceMove(new Ie(p,1,p,b.length+1),RY(g,a,l))),!o.shouldIgnore(p)&&(o.shouldIncrease(p,v)?(f=c(f),g=f):o.shouldIndentNextLine(p,v)?g=c(g):g=f)}return h}function gct(n,e){return n.tokenization.isCheapToTokenize(e)?n.tokenization.getLineTokens(e).getStandardTokenType(0)===2:!1}var pct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mct=function(n,e){return function(t,i){e(t,i,n)}};const AF=class AF extends Ne{constructor(){super({id:AF.ID,label:ie(1148,"Convert Indentation to Spaces"),precondition:H.writable,metadata:{description:ie(1149,"Convert the tab indentation to spaces.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new Cct(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}};AF.ID="editor.action.indentationToSpaces";let mq=AF;const PF=class PF extends Ne{constructor(){super({id:PF.ID,label:ie(1150,"Convert Indentation to Tabs"),precondition:H.writable,metadata:{description:ie(1151,"Convert the spaces indentation to tabs.")}})}run(e,t){const i=t.getModel();if(!i)return;const s=i.getOptions(),o=t.getSelection();if(!o)return;const r=new yct(o,s.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[r]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}};PF.ID="editor.action.indentationToTabs";let _q=PF;class JX extends Ne{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(No),s=e.get(Ui),o=t.getModel();if(!o)return;const r=s.getCreationOptions(o.getLanguageId(),o.uri,o.isForSimpleWidget),a=o.getOptions(),l=[1,2,3,4,5,6,7,8].map(d=>({id:d.toString(),label:d.toString(),description:d===r.tabSize&&d===a.tabSize?_(1144,"Configured Tab Size"):d===r.tabSize?_(1145,"Default Tab Size"):d===a.tabSize?_(1146,"Current Tab Size"):void 0})),c=Math.min(o.getOptions().tabSize-1,7);setTimeout(()=>{i.pick(l,{placeHolder:_(1147,"Select Tab Size for Current File"),activeItem:l[c]}).then(d=>{if(d&&o&&!o.isDisposed()){const h=parseInt(d.label,10);this.displaySizeOnly?o.updateOptions({tabSize:h}):o.updateOptions({tabSize:h,indentSize:h,insertSpaces:this.insertSpaces})}})},50)}}const OF=class OF extends JX{constructor(){super(!1,!1,{id:OF.ID,label:ie(1152,"Indent Using Tabs"),precondition:void 0,metadata:{description:ie(1153,"Use indentation with tabs.")}})}};OF.ID="editor.action.indentUsingTabs";let bq=OF;const FF=class FF extends JX{constructor(){super(!0,!1,{id:FF.ID,label:ie(1154,"Indent Using Spaces"),precondition:void 0,metadata:{description:ie(1155,"Use indentation with spaces.")}})}};FF.ID="editor.action.indentUsingSpaces";let vq=FF;const BF=class BF extends JX{constructor(){super(!0,!0,{id:BF.ID,label:ie(1156,"Change Tab Display Size"),precondition:void 0,metadata:{description:ie(1157,"Change the space size equivalent of the tab.")}})}};BF.ID="editor.action.changeTabDisplaySize";let wq=BF;const WF=class WF extends Ne{constructor(){super({id:WF.ID,label:ie(1158,"Detect Indentation from Content"),precondition:void 0,metadata:{description:ie(1159,"Detect the indentation from content.")}})}run(e,t){const i=e.get(Ui),s=t.getModel();if(!s)return;const o=i.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget);s.detectIndentation(o.insertSpaces,o.tabSize)}};WF.ID="editor.action.detectIndentation";let Cq=WF;class _ct extends Ne{constructor(){super({id:"editor.action.reindentlines",label:ie(1160,"Reindent Lines"),precondition:H.writable,metadata:{description:ie(1161,"Reindent the lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(qi),s=t.getModel();if(!s)return;const o=VCe(s,i,1,s.getLineCount());o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}}class bct extends Ne{constructor(){super({id:"editor.action.reindentselectedlines",label:ie(1162,"Reindent Selected Lines"),precondition:H.writable,metadata:{description:ie(1163,"Reindent the selected lines of the editor.")},canTriggerInlineEdits:!0})}run(e,t){const i=e.get(qi),s=t.getModel();if(!s)return;const o=t.getSelections();if(o===null)return;const r=[];for(const a of o){let l=a.startLineNumber,c=a.endLineNumber;if(l!==c&&a.endColumn===1&&c--,l===1){if(l===c)continue}else l--;const d=VCe(s,i,l,c);r.push(...d)}r.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,r),t.pushUndoStop())}}class vct{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&typeof i.text=="string"&&this._edits.push(i)}getEditOperations(e,t){for(const s of this._edits)t.addEditOperation(D.lift(s.range),s.text);let i=!1;Array.isArray(this._edits)&&this._edits.length===1&&this._initialSelection.isEmpty()&&(this._edits[0].range.startColumn===this._initialSelection.endColumn&&this._edits[0].range.startLineNumber===this._initialSelection.endLineNumber?(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!0)):this._edits[0].range.endColumn===this._initialSelection.startColumn&&this._edits[0].range.endLineNumber===this._initialSelection.startLineNumber&&(i=!0,this._selectionId=t.trackSelection(this._initialSelection,!1))),i||(this._selectionId=t.trackSelection(this._initialSelection))}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}var Ay;let ZO=(Ay=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new ne,this.callOnModel=new ne,this.callOnDispose.add(e.onDidChangeConfiguration(()=>this.update())),this.callOnDispose.add(e.onDidChangeModel(()=>this.update())),this.callOnDispose.add(e.onDidChangeModelLanguage(()=>this.update()))}update(){this.callOnModel.clear(),!(!this.editor.getOption(17)||this.editor.getOption(16)<4)&&this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste(({range:e})=>{this.trigger(e)}))}trigger(e){const t=this.editor.getSelections();if(t===null||t.length>1)return;const i=this.editor.getModel();if(!i||this.rangeContainsOnlyWhitespaceCharacters(i,e)||!this.editor.getOption(18)&&wct(i,e)||!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const o=this.editor.getOption(16),{tabSize:r,indentSize:a,insertSpaces:l}=i.getOptions(),c=[],d={shiftIndent:g=>oc.shiftIndent(g,g.length+1,r,a,l),unshiftIndent:g=>oc.unshiftIndent(g,g.length+1,r,a,l)};let h=e.startLineNumber,u=i.getLineContent(h);if(!/\S/.test(u.substring(0,e.startColumn-1))){const g=pk(o,i,i.getLanguageId(),h,d,this._languageConfigurationService);if(g!==null){const p=pi(u),m=oa(g,r),b=oa(p,r);if(m!==b){const v=qk(m,r,l);c.push({range:new D(h,1,h,p.length+1),text:v}),u=v+u.substring(p.length)}else{const v=Mme(i,h,this._languageConfigurationService);if(v===0||v===8)return}}}const f=h;for(;hi.tokenization.getLineTokens(m),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(m,b)=>i.getLanguageIdAtPosition(m,b)},getLineContent:m=>m===f?u:i.getLineContent(m)},i.getLanguageId(),h+1,d,this._languageConfigurationService);if(p!==null){const m=oa(p,r),b=oa(pi(i.getLineContent(h+1)),r);if(m!==b){const v=m-b;for(let w=h+1;w<=e.endLineNumber;w++){const C=i.getLineContent(w),S=pi(C),x=oa(S,r)+v,I=qk(x,r,l);I!==S&&c.push({range:new D(w,1,w,S.length+1),text:I})}}}}if(c.length>0){this.editor.pushUndoStop();const g=new vct(c,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",g),this.editor.pushUndoStop()}}rangeContainsOnlyWhitespaceCharacters(e,t){const i=o=>o.trim().length===0;let s=!0;if(t.startLineNumber===t.endLineNumber){const r=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);s=i(r)}else for(let o=t.startLineNumber;o<=t.endLineNumber;o++){const r=e.getLineContent(o);if(o===t.startLineNumber){const a=r.substring(t.startColumn-1);s=i(a)}else if(o===t.endLineNumber){const a=r.substring(0,t.endColumn-1);s=i(a)}else s=e.getLineFirstNonWhitespaceColumn(o)===0;if(!s)break}return s}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}},Ay.ID="editor.contrib.autoIndentOnPaste",Ay);ZO=pct([mct(1,qi)],ZO);function wct(n,e){const t=i=>a3e(n,i)===2;return t(e.getStartPosition())||t(e.getEndPosition())}function zCe(n,e,t,i){if(n.getLineCount()===1&&n.getLineMaxColumn(1)===1)return;let s="";for(let r=0;r=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Lct=function(n,e){return function(t,i){e(t,i,n)}},oM,Um;let FS=(Um=class{static get(e){return e.getContribution(oM.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var l;(l=this.currentRequest)==null||l.cancel();const i=this.editor.getSelection(),s=this.editor.getModel();if(!s||!i)return;let o=i;if(o.startLineNumber!==o.endLineNumber)return;const r=new w1e(this.editor,5),a=s.uri;return this.editorWorkerService.canNavigateValueSet(a)?(this.currentRequest=rs(c=>this.editorWorkerService.navigateValueSet(a,o,t)),this.currentRequest.then(c=>{var g;if(!c||!c.range||!c.value||!r.validate(this.editor))return;const d=D.lift(c.range);let h=c.range;const u=c.value.length-(o.endColumn-o.startColumn);h={startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.startColumn+c.value.length},u>1&&(o=new Ie(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+u-1));const f=new Sct(d,o,c.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,f),this.editor.pushUndoStop(),this.decorations.set([{range:h,options:oM.DECORATION}]),(g=this.decorationRemover)==null||g.cancel(),this.decorationRemover=wu(350),this.decorationRemover.then(()=>this.decorations.clear()).catch(Je)}).catch(Je)):Promise.resolve(void 0)}},oM=Um,Um.ID="editor.contrib.inPlaceReplaceController",Um.DECORATION=st.register({description:"in-place-replace",className:"valueSetReplacement"}),Um);FS=oM=xct([Lct(1,Qr)],FS);class kct extends Ne{constructor(){super({id:"editor.action.inPlaceReplace.up",label:ie(1240,"Replace with Previous Value"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3159,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!1):Promise.resolve(void 0)}}class Ict extends Ne{constructor(){super({id:"editor.action.inPlaceReplace.down",label:ie(1241,"Replace with Next Value"),precondition:H.writable,kbOpts:{kbExpr:H.editorTextFocus,primary:3161,weight:100}})}run(e,t){const i=FS.get(t);return i?i.run(this.id,!0):Promise.resolve(void 0)}}At(FS.ID,FS,4);we(kct);we(Ict);class Ect{constructor(e){this._selection=e,this._selectionId=null}getEditOperations(e,t){const i=Nct(e);i&&t.addEditOperation(i.range,i.text),this._selectionId=t.trackSelection(this._selection)}computeCursorState(e,t){return t.getTrackedSelection(this._selectionId)}}function Nct(n){const e=n.getLineCount(),t=n.getLineContent(e),i=jc(t)===-1;if(!(!e||i))return ln.insert(new U(e,n.getLineMaxColumn(e)),n.getEOL())}const HF=class HF extends Ne{constructor(){super({id:HF.ID,label:ie(1242,"Insert Final New Line"),precondition:H.writable})}run(e,t,i){const s=t.getSelection();if(s===null)return;const o=new Ect(s);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}};HF.ID="editor.action.insertFinalNewLine";let yq=HF;we(yq);class Dct extends Ne{constructor(){super({id:"expandLineSelection",label:ie(1243,"Expand Line Selection"),precondition:void 0,kbOpts:{weight:0,kbExpr:H.textInputFocus,primary:2090}})}run(e,t,i){if(i=i||{},!t.hasModel())return;const s=t._getViewModel();s.model.pushStackElement(),s.setCursorStates(i.source,3,Bs.expandLineSelection(s,s.getCursorStates())),s.revealAllCursors(i.source,!0)}}we(Dct);var Tct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X2=function(n,e){return function(t,i){e(t,i,n)}},rM;const jCe=new Se("LinkedEditingInputVisible",!1),Rct="linked-editing-decoration";var qm;let BS=(qm=class extends G{static get(e){return e.getContribution(rM.ID)}constructor(e,t,i,s,o){super(),this.languageConfigurationService=s,this._syncRangesToken=0,this._localToDispose=this._register(new ne),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=jCe.bindTo(t),this._debounceInformation=o.for(this._providers,"Linked Editing",{max:200}),this._currentDecorations=this._editor.createDecorationsCollection(),this._languageWordPattern=null,this._currentWordPattern=null,this._ignoreChangeEvent=!1,this._localToDispose=this._register(new ne),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequestCts=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel(()=>this.reinitialize(!0))),this._register(this._editor.onDidChangeConfiguration(r=>{(r.hasChanged(78)||r.hasChanged(106))&&this.reinitialize(!1)})),this._register(this._providers.onDidChange(()=>this.reinitialize(!1))),this._register(this._editor.onDidChangeModelLanguage(()=>this.reinitialize(!0))),this.reinitialize(!0)}reinitialize(e){const t=this._editor.getModel(),i=t!==null&&(this._editor.getOption(78)||this._editor.getOption(106))&&this._providers.has(t);if(i===this._enabled&&!e||(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||t===null))return;this._localToDispose.add(ve.runAndSubscribe(t.onDidChangeLanguageConfiguration,()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()}));const s=new ec(this._debounceInformation.get(t)),o=()=>{this._rangeUpdateTriggerPromise=s.trigger(()=>this.updateRanges(),this._debounceDuration??this._debounceInformation.get(t))},r=new ec(0),a=l=>{this._rangeSyncTriggerPromise=r.trigger(()=>this._syncRanges(l))};this._localToDispose.add(this._editor.onDidChangeCursorPosition(()=>{o()})),this._localToDispose.add(this._editor.onDidChangeModelContent(l=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const c=this._currentDecorations.getRange(0);if(c&&l.changes.every(d=>c.intersectRanges(d.range))){a(this._syncRangesToken);return}}o()})),this._localToDispose.add({dispose:()=>{s.dispose(),r.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||this._currentDecorations.length===0)return;const t=this._editor.getModel(),i=this._currentDecorations.getRange(0);if(!i||i.startLineNumber!==i.endLineNumber)return this.clearRanges();const s=t.getValueInRange(i);if(this._currentWordPattern){const r=s.match(this._currentWordPattern);if((r?r[0].length:0)!==s.length)return this.clearRanges()}const o=[];for(let r=1,a=this._currentDecorations.length;r1){this.clearRanges();return}const i=this._editor.getModel(),s=i.getVersionId();if(this._currentRequestPosition&&this._currentRequestModelVersion===s){if(t.equals(this._currentRequestPosition))return;if(this._currentDecorations.length>0){const a=this._currentDecorations.getRange(0);if(a&&a.containsPosition(t))return}}if(!((r=this._currentRequestPosition)!=null&&r.equals(t))){const a=this._currentDecorations.getRange(0);a!=null&&a.containsPosition(t)||this.clearRanges()}this._currentRequestPosition=t,this._currentRequestModelVersion=s;const o=this._currentRequestCts=new Bi;try{const a=new Ls(!1),l=await $Ce(this._providers,i,t,o.token);if(this._debounceInformation.update(i,a.elapsed()),o!==this._currentRequestCts||(this._currentRequestCts=null,s!==i.getVersionId()))return;let c=[];l!=null&&l.ranges&&(c=l.ranges),this._currentWordPattern=(l==null?void 0:l.wordPattern)||this._languageWordPattern;let d=!1;for(let u=0,f=c.length;u({range:u,options:rM.DECORATION}));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(a){fl(a)||Je(a),(this._currentRequestCts===o||!this._currentRequestCts)&&this.clearRanges()}}},rM=qm,qm.ID="editor.contrib.linkedEditing",qm.DECORATION=st.register({description:"linked-editing",stickiness:0,className:Rct}),qm);BS=rM=Tct([X2(1,Xe),X2(2,De),X2(3,qi),X2(4,hc)],BS);class Mct extends Ne{constructor(){super({id:"editor.action.linkedEditing",label:ie(1276,"Start Linked Editing"),precondition:le.and(H.writable,H.hasRenameProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Bt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return He.isUri(s)&&U.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Je):super.runCommand(e,t)}run(e,t){const i=BS.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}}const Act=hs.bindToContribution(BS.get);ye(new Act({id:"cancelLinkedEditingInput",precondition:jCe,handler:n=>n.clearRanges(),kbOpts:{kbExpr:H.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));function $Ce(n,e,t,i){const s=n.ordered(e);return VG(s.map(o=>async()=>{try{return await o.provideLinkedEditingRanges(e,t,i)}catch(r){On(r);return}}),o=>!!o&&Yo(o==null?void 0:o.ranges))}F("editor.linkedEditingBackground",{dark:se.fromHex("#f00").transparent(.3),light:se.fromHex("#f00").transparent(.3),hcDark:se.fromHex("#f00").transparent(.3),hcLight:se.white},_(1275,"Background color when the editor auto renames on type."));Xr("_executeLinkedEditingProvider",(n,e,t)=>{const{linkedEditingRangeProvider:i}=n.get(De);return $Ce(i,e,t,wt.None)});At(BS.ID,BS,1);we(Mct);let Pct=class{constructor(e,t){this._link=e,this._provider=t}toJSON(){return{range:this.range,url:this.url,tooltip:this.tooltip}}get range(){return this._link.range}get url(){return this._link.url}get tooltip(){return this._link.tooltip}async resolve(e){return this._link.url?this._link.url:typeof this._provider.resolveLink=="function"?Promise.resolve(this._provider.resolveLink(this._link,e)).then(t=>(this._link=t||this._link,this._link.url?this.resolve(e):Promise.reject(new Error("missing")))):Promise.reject(new Error("missing"))}};const CI=class CI{constructor(e){this._disposables=new ne;let t=[];for(const[i,s]of e){const o=i.links.map(r=>new Pct(r,s));t=CI._union(t,o),Nw(i)&&(this._disposables??(this._disposables=new ne),this._disposables.add(i))}this.links=t}dispose(){var e;(e=this._disposables)==null||e.dispose(),this.links.length=0}static _union(e,t){const i=[];let s,o,r,a;for(s=0,r=0,o=e.length,a=t.length;s{try{const l=await r.provideLinks(e,t);l&&(i[a]=[l,r])}catch(l){On(l)}});await Promise.all(s);let o=new XO(lh(i));return t.isCancellationRequested&&(o.dispose(),o=XO.Empty),o}Rt.registerCommand("_executeLinkProvider",async(n,...e)=>{let[t,i]=e;Ft(t instanceof He),typeof i!="number"&&(i=0);const{linkProvider:s}=n.get(De),o=n.get(Ui).getModel(t);if(!o)return[];const r=await UCe(s,o,wt.None);if(!r)return[];for(let l=0;l=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q2=function(n,e){return function(t,i){e(t,i,n)}},Sq,L1;let MN=(L1=class extends G{static get(e){return e.getContribution(Sq.ID)}constructor(e,t,i,s,o){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=s,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=o.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new ai(()=>this.computeLinksNow(),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const r=this._register(new Z3(e));this._register(r.onMouseMoveOrRelevantKeyDown(([a,l])=>{this._onEditorMouseMove(a,l)})),this._register(r.onExecute(a=>{this.onEditorMouseUp(a)})),this._register(r.onCancel(a=>{this.cleanUpActiveLinkDecoration()})),this._register(e.onDidChangeConfiguration(a=>{a.hasChanged(79)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))})),this._register(e.onDidChangeModelContent(a=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))})),this._register(e.onDidChangeModel(a=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)})),this._register(e.onDidChangeModelLanguage(a=>{this.stop(),this.computeLinks.schedule(0)})),this._register(this.providers.onDidChange(a=>{this.stop(),this.computeLinks.schedule(0)})),this.computeLinks.schedule(0)}async computeLinksNow(){if(!this.editor.hasModel()||!this.editor.getOption(79))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=rs(t=>UCe(this.providers,e,t));try{const t=new Ls(!1);if(this.activeLinksList=await this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){Je(t)}finally{this.computePromise=null}}}updateDecorations(e){const t=this.editor.getOption(86)==="altKey",i=[],s=Object.keys(this.currentOccurrences);for(const r of s){const a=this.currentOccurrences[r];i.push(a.decorationId)}const o=[];if(e)for(const r of e)o.push(Ly.decoration(r,t));this.editor.changeDecorations(r=>{const a=r.deltaDecorations(i,o);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let l=0,c=a.length;l{s.activate(o,i),this.activeLinkDecorationId=s.decorationId})}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e=this.editor.getOption(86)==="altKey";if(this.activeLinkDecorationId){const t=this.currentOccurrences[this.activeLinkDecorationId];t&&this.editor.changeDecorations(i=>{t.deactivate(i,e)}),this.activeLinkDecorationId=null}}onEditorMouseUp(e){if(!this.isEnabled(e))return;const t=this.getLinkOccurrence(e.target.position);t&&this.openLinkOccurrence(t,e.hasSideBySideModifier,!0)}openLinkOccurrence(e,t,i=!1){if(!this.openerService)return;const{link:s}=e;s.resolve(wt.None).then(o=>{if(typeof o=="string"&&this.editor.hasModel()){const r=this.editor.getModel().uri;if(r.scheme===Ge.file&&o.startsWith(`${Ge.file}:`)){const a=He.parse(o);if(a.scheme===Ge.file){const l=Ih(a);let c=null;l.startsWith("/./")||l.startsWith("\\.\\")?c=`.${l.substr(1)}`:(l.startsWith("//./")||l.startsWith("\\\\.\\"))&&(c=`.${l.substr(2)}`),c&&(o=gpe(r,c))}}}return this.openerService.open(o,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})},o=>{const r=o instanceof Error?o.message:o;r==="invalid"?this.notificationService.warn(_(1277,"Failed to open this link because it is not well-formed: {0}",s.url.toString())):r==="missing"?this.notificationService.warn(_(1278,"Failed to open this link because its target is missing.")):Je(o)})}getLinkOccurrence(e){if(!this.editor.hasModel()||!e)return null;const t=this.editor.getModel().getDecorationsInRange({startLineNumber:e.lineNumber,startColumn:e.column,endLineNumber:e.lineNumber,endColumn:e.column},0,!0);for(const i of t){const s=this.currentOccurrences[i.id];if(s)return s}return null}isEnabled(e,t){return!!(e.target.type===6&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey||e.isMiddleClick&&e.mouseMiddleClickAction==="openLink"))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&((e=this.activeLinksList)==null||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}},Sq=L1,L1.ID="editor.linkDetector",L1);MN=Sq=Oct([Q2(1,jg),Q2(2,fn),Q2(3,De),Q2(4,hc)],MN);const Kle={general:st.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:st.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class Ly{static decoration(e,t){return{range:e.range,options:Ly._getOptions(e,t,!1)}}static _getOptions(e,t,i){const s={...i?Kle.active:Kle.general};return s.hoverMessage=Fct(e,t),s}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,Ly._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,Ly._getOptions(this.link,t,!1))}}function Fct(n,e){const t=n.url&&/^command:/i.test(n.url.toString()),i=n.tooltip?n.tooltip:t?_(1279,"Execute command"):_(1280,"Follow link"),s=e?yt?_(1281,"cmd + click"):_(1282,"ctrl + click"):yt?_(1283,"option + click"):_(1284,"alt + click");if(n.url){let o="";if(/^command:/i.test(n.url.toString())){const a=n.url.toString().match(/^command:([^?#]+)/);if(a){const l=a[1];o=_(1285,"Execute command {0}",l)}}return new Co("",!0).appendLink(n.url.toString(!0).replace(/ /g,"%20"),i,o).appendMarkdown(` (${s})`)}else return new Co().appendText(`${i} (${s})`)}class Bct extends Ne{constructor(){super({id:"editor.action.openLink",label:ie(1286,"Open Link"),precondition:void 0})}run(e,t){const i=MN.get(t);if(!i||!t.hasModel())return;const s=t.getSelections();for(const o of s){const r=i.getLinkOccurrence(o.getEndPosition());r&&i.openLinkOccurrence(r,!1)}}}At(MN.ID,MN,1);we(Bct);const xQ=class xQ extends G{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown(t=>{const i=this._editor.getOption(133);i>=0&&t.target.type===6&&t.target.position.column>=i&&this._editor.updateOptions({stopRenderingLineAfter:-1})}))}};xQ.ID="editor.contrib.longLinesHelper";let QO=xQ;At(QO.ID,QO,2);const LQ=class LQ extends G{constructor(e){super(),this._editor=e;const t=$i(this._editor),i=t.getOption(171);this._register(qe(s=>{if(!i.read(s))return;const o=t.domNode.read(s);if(!o)return;const r=s.store.add(XG("scrollingSession",void 0));s.store.add(this._editor.onMouseDown(l=>{if(r.read(void 0)){r.set(void 0,void 0);return}if(!l.event.middleButton)return;l.event.stopPropagation(),l.event.preventDefault();const d=new ne,h=new vs(l.event.posx,l.event.posy),f=Wct(Pe(o),h,d).map(m=>m.subtract(h).withThreshold(5)),g=o.getBoundingClientRect(),p=new vs(h.x-g.left,h.y-g.top);r.set({mouseDeltaAfterThreshold:f,initialMousePosInEditor:p,didScroll:!1,dispose:()=>d.dispose()},void 0),d.add(this._editor.onMouseUp(m=>{const b=r.read(void 0);b&&b.didScroll&&r.set(void 0,void 0)})),d.add(this._editor.onKeyDown(m=>{r.set(void 0,void 0)}))})),s.store.add(qe(l=>{const c=r.read(l);if(!c)return;let d=Date.now();l.store.add(qe(u=>{OO.instance.invalidateOnNextAnimationFrame(u);const f=Date.now(),g=f-d;d=f;const p=c.mouseDeltaAfterThreshold.read(void 0),m=g/32,b=p.scale(m),v=new vs(this._editor.getScrollLeft(),this._editor.getScrollTop());this._editor.setScrollPosition(Hct(v.add(b))),b.isZero()||(c.didScroll=!0)}));const h=oe(u=>{const f=c.mouseDeltaAfterThreshold.read(u);let g="";return g+=f.y<0?"n":f.y>0?"s":"",g+=f.x<0?"w":f.x>0?"e":"",g});l.store.add(qe(u=>{o.setAttribute("data-scroll-direction",h.read(u))}))}));const a=s.store.add(ht.div({class:["scroll-editor-on-middle-click-dot",r.map(l=>l?"":"hidden")],style:{left:r.map(l=>l?l.initialMousePosInEditor.x:0),top:r.map(l=>l?l.initialMousePosInEditor.y:0)}}).toDisposableLiveElement());s.store.add(b0(o,a.element)),s.store.add(qe(l=>{const c=r.read(l);o.classList.toggle("scroll-editor-on-middle-click-editor",!!c)}))}))}};LQ.ID="editor.contrib.middleScroll";let JO=LQ;function Wct(n,e,t){const i=Ze("pos",e);return t.add(J(n,"mousemove",s=>{i.set(new vs(s.pageX,s.pageY),void 0)})),i}function Hct(n){return{scrollLeft:n.x,scrollTop:n.y}}At(JO.ID,JO,2);const Vct=F("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},_(1563,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},_(1564,"Background color of a symbol during write-access, like writing to a variable. The color must not be opaque so as not to hide underlying decorations."),!0);F("editor.wordHighlightTextBackground",Vct,_(1565,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const zct=F("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Hi,hcLight:Hi},_(1566,"Border color of a symbol during read-access, like reading a variable."));F("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Hi,hcLight:Hi},_(1567,"Border color of a symbol during write-access, like writing to a variable."));F("editor.wordHighlightTextBorder",zct,_(1568,"Border color of a textual occurrence for a symbol."));const jct=F("editorOverviewRuler.wordHighlightForeground","#A0A0A0CC",_(1569,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),$ct=F("editorOverviewRuler.wordHighlightStrongForeground","#C0A0C0CC",_(1570,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Uct=F("editorOverviewRuler.wordHighlightTextForeground",cme,_(1571,"Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0),qct=st.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:an($ct),position:ll.Center},minimap:{color:an(h3),position:1}}),Kct=st.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:an(Uct),position:ll.Center},minimap:{color:an(h3),position:1}}),Gct=st.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:an(cme),position:ll.Center},minimap:{color:an(h3),position:1}}),Yct=st.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),Zct=st.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:an(jct),position:ll.Center},minimap:{color:an(h3),position:1}});function Xct(n){return n===sS.Write?qct:n===sS.Text?Kct:Zct}function Qct(n){return n?Yct:Gct}dc((n,e)=>{const t=n.getColor(vY);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var Jct=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},edt=function(n,e){return function(t,i){e(t,i,n)}},xq;function x_(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?_(1288,"Cursor added: {0}",i):_(1289,"Cursors added: {0}",i);Jd(s)}}class tdt extends Ne{constructor(){super({id:"editor.action.insertCursorAbove",label:ie(1298,"Add Cursor Above"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1290,"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Bs.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),x_(r,o.getCursorStates())}}class idt extends Ne{constructor(){super({id:"editor.action.insertCursorBelow",label:ie(1299,"Add Cursor Below"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1291,"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,Bs.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),x_(r,o.getCursorStates())}}class ndt extends Ne{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:ie(1300,"Add Cursors to Line Ends"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1292,"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new Ie(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),x_(r,o.getCursorStates())}}class sdt extends Ne{constructor(){super({id:"editor.action.addCursorsToBottom",label:ie(1301,"Add Cursors to Bottom"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new Ie(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),x_(a,r.getCursorStates())}}class odt extends Ne{constructor(){super({id:"editor.action.addCursorsToTop",label:ie(1302,"Add Cursors to Top"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getSelections(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new Ie(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),x_(r,o.getCursorStates())}}class J2{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class AN{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new AN(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=i.matchCase);const l=e.getSelection();let c,d=null;if(l.isEmpty()){const h=e.getConfiguredWordAtPosition(l.getStartPosition());if(!h)return null;c=h.word,d=new Ie(l.startLineNumber,h.startColumn,l.startLineNumber,h.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new AN(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new J2(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new J2(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Ie(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}addSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new J2(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new J2(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1);return i?new Ie(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(148):null,!1,1073741824)}}const VF=class VF extends G{static get(e){return e.getContribution(VF.ID)}constructor(e){super(),this._sessionDispose=this._register(new ne),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=AN.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.wholeWord)&&this._endSession()}))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};this._session.findController.getState().change(e,!1)}this._session=null}_setSelections(e){this._ignoreSelectionChange=!0,this._editor.setSelections(e),this._ignoreSelectionChange=!1}_expandEmptyToWord(e,t){if(!t.isEmpty())return t;const i=this._editor.getConfiguredWordAtPosition(t.getStartPosition());return i?new Ie(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):t}_applySessionResult(e){e&&(this._setSelections(e.selections),e.revealRange&&this._editor.revealRangeInCenterIfOutsideViewport(e.revealRange,e.revealScrollType))}getSession(e){return this._session}addSelectionToNextFindMatch(e){if(this._editor.hasModel()){if(!this._session){const t=this._editor.getSelections();if(t.length>1){const s=e.getState().matchCase;if(!qCe(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(148):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew Ie(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}};VF.ID="editor.contrib.multiCursorController";let WS=VF;class px extends Ne{run(e,t){const i=WS.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=Zr.get(t);if(r)this._run(i,r);else{const a=e.get(Ae).createInstance(Zr,t);this._run(i,a),a.dispose()}x_(o,s.getCursorStates())}}}class rdt extends px{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:ie(1303,"Add Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2082,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1293,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class adt extends px{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:ie(1304,"Add Selection to Previous Find Match"),precondition:void 0,menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1294,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class ldt extends px{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:ie(1305,"Move Last Selection to Next Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:Fn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class cdt extends px{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:ie(1306,"Move Last Selection to Previous Find Match"),precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}class ddt extends px{constructor(){super({id:"editor.action.selectHighlights",label:ie(1307,"Select All Occurrences of Find Match"),precondition:void 0,kbOpts:{kbExpr:H.focus,primary:3114,weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"3_multi",title:_(1295,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class hdt extends px{constructor(){super({id:"editor.action.changeAll",label:ie(1308,"Change All Occurrences"),precondition:le.and(H.writable,H.editorTextFocus),kbOpts:{kbExpr:H.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class udt{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,this._cachedFindMatches=null,this._modelVersionId=this._model.getVersionId(),o&&this._model===o._model&&this._searchText===o._searchText&&this._matchCase===o._matchCase&&this._wordSeparators===o._wordSeparators&&this._modelVersionId===o._modelVersionId&&(this._cachedFindMatches=o._cachedFindMatches)}findMatches(){return this._cachedFindMatches===null&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map(e=>e.range),this._cachedFindMatches.sort(D.compareRangesUsingStarts)),this._cachedFindMatches}}var k1;let e4=(k1=class extends G{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new ai(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(122),this._isEnabledMultiline=e.getOption(124),this._maxLength=e.getOption(123)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=Zr.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(xq._createState(this.state,this._isEnabled,this._isEnabledMultiline,this._maxLength,this.editor))}static _createState(e,t,i,s,o){if(!t||!o.hasModel())return null;if(!i){const h=o.getSelection();if(h.startLineNumber!==h.endLineNumber)return null}const r=WS.get(o);if(!r)return null;const a=Zr.get(o);if(!a)return null;let l=r.getSession(a);if(!l){const h=o.getSelections();if(h.length>1){const f=a.getState().matchCase;if(!qCe(o.getModel(),h,f))return null}l=AN.create(o,a)}if(!l||l.currentMatch||/^[ \t]+$/.test(l.searchText)||s>0&&l.searchText.length>s)return null;const c=a.getState(),d=c.matchCase;if(c.isRevealed){let h=c.searchString;d||(h=h.toLowerCase());let u=l.searchText;if(d||(u=u.toLowerCase()),h===u&&l.matchCase===c.matchCase&&l.wholeWord===c.wholeWord&&!c.isRegex)return null}return new udt(o.getModel(),l.searchText,l.matchCase,l.wholeWord?o.getOption(148):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(D.compareRangesUsingStarts);const o=[];for(let c=0,d=0,h=i.length,u=s.length;c=u)o.push(f),c++;else{const g=D.compareRangesUsingStarts(f,s[d]);g<0?((s[d].isEmpty()||!D.areIntersecting(f,s[d]))&&o.push(f),c++):(g>0||c++,d++)}}const r=this.editor.getOption(90)!=="off",a=this._languageFeaturesService.documentHighlightProvider.has(t)&&r,l=o.map(c=>({range:c,options:Qct(a)}));this._decorations.set(l)}dispose(){this._setState(null),super.dispose()}},xq=k1,k1.ID="editor.contrib.selectionHighlighter",k1);e4=xq=Jct([edt(1,De)],e4);function qCe(n,e,t){const i=Gle(n,e[0],!t);for(let s=1,o=e.length;s{const[t,i,s]=e;Ft(He.isUri(t)),Ft(U.isIPosition(i)),Ft(typeof s=="string"||!s);const o=n.get(De),r=await n.get(Qo).createModelReference(t);try{const a=await KCe(o.signatureHelpProvider,r.object.textEditorModel,U.lift(i),{triggerKind:fu.Invoke,isRetrigger:!1,triggerCharacter:s},wt.None);return a?(setTimeout(()=>a.dispose(),0),a.value):void 0}finally{r.dispose()}});var xp;(function(n){n.Default={type:0};class e{constructor(s,o){this.request=s,this.previouslyActiveHints=o,this.type=2}}n.Pending=e;class t{constructor(s){this.hints=s,this.type=1}}n.Active=t})(xp||(xp={}));const zF=class zF extends G{constructor(e,t,i=zF.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new q),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=xp.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new Gt),this.triggerChars=new CA,this.retriggerChars=new CA,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new ec(i),this._register(this.editor.onDidBlurEditorWidget(()=>this.cancel())),this._register(this.editor.onDidChangeConfiguration(()=>this.onEditorConfigurationChange())),this._register(this.editor.onDidChangeModel(s=>this.onModelChanged())),this._register(this.editor.onDidChangeModelLanguage(s=>this.onModelChanged())),this._register(this.editor.onDidChangeCursorSelection(s=>this.onCursorChange(s))),this._register(this.editor.onDidChangeModelContent(s=>this.onModelContentChange())),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType(s=>this.onDidType(s))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){this._state.type===2&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=xp.Default,this.throttledDelayer.cancel(),e||this._onChangedHints.fire(void 0)}trigger(e,t){const i=this.editor.getModel();if(!i||!this.providers.has(i))return;const s=++this.triggerId;this._pendingTriggers.push(e),this.throttledDelayer.trigger(()=>this.doTrigger(s),t).catch(Je)}next(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e===e-1,s=this.editor.getOption(98).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?0:t+1)}previous(){if(this.state.type!==1)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t===0,s=this.editor.getOption(98).cycle;if((e<2||i)&&!s){this.cancel();return}this.updateActiveSignature(i&&s?e-1:t-1)}updateActiveSignature(e){this.state.type===1&&(this.state=new xp.Active({...this.state.hints,activeSignature:e}),this._onChangedHints.fire(this.state.hints))}async doTrigger(e){const t=this.state.type===1||this.state.type===2,i=this.getLastActiveHints();if(this.cancel(!0),this._pendingTriggers.length===0)return!1;const s=this._pendingTriggers.reduce(pdt);this._pendingTriggers=[];const o={triggerKind:s.triggerKind,triggerCharacter:s.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const r=this.editor.getModel(),a=this.editor.getPosition();this.state=new xp.Pending(rs(l=>KCe(this.providers,r,a,o,l)),i);try{const l=await this.state.request;return e!==this.triggerId?(l==null||l.dispose(),!1):!l||!l.value.signatures||l.value.signatures.length===0?(l==null||l.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1):(this.state=new xp.Active(l.value),this._lastSignatureHelpResult.value=l,this._onChangedHints.fire(this.state.hints),!0)}catch(l){return e===this.triggerId&&(this.state=xp.Default),Je(l),!1}}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return this.state.type===1||this.state.type===2||this.throttledDelayer.isTriggered()}onModelChanged(){this.cancel(),this.triggerChars.clear(),this.retriggerChars.clear();const e=this.editor.getModel();if(e)for(const t of this.providers.ordered(e)){for(const i of t.signatureHelpTriggerCharacters||[])if(i.length){const s=i.charCodeAt(0);this.triggerChars.add(s),this.retriggerChars.add(s)}for(const i of t.signatureHelpRetriggerCharacters||[])i.length&&this.retriggerChars.add(i.charCodeAt(0))}}onDidType(e){if(!this.triggerOnType)return;const t=e.length-1,i=e.charCodeAt(t);(this.triggerChars.has(i)||this.isTriggered&&this.retriggerChars.has(i))&&this.trigger({triggerKind:fu.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){e.source==="mouse"?this.cancel():this.isTriggered&&this.trigger({triggerKind:fu.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:fu.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(98).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}};zF.DEFAULT_DELAY=120;let Lq=zF;function pdt(n,e){switch(e.triggerKind){case fu.Invoke:return e;case fu.ContentChange:return n;case fu.TriggerCharacter:default:return e}}var mdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yle=function(n,e){return function(t,i){e(t,i,n)}},kq;const Aa=me,_dt=Ri("parameter-hints-next",de.chevronDown,_(1312,"Icon for show next parameter hint.")),bdt=Ri("parameter-hints-previous",de.chevronUp,_(1313,"Icon for show previous parameter hint."));var I1;let Iq=(I1=class extends G{constructor(e,t,i,s){super(),this.editor=e,this.model=t,this.markdownRendererService=s,this.renderDisposeables=this._register(new ne),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.keyVisible=Lw.Visible.bindTo(i),this.keyMultipleSignatures=Lw.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=Aa(".editor-widget.parameter-hints-widget"),t=he(e,Aa(".phwrapper"));t.tabIndex=-1;const i=he(t,Aa(".controls")),s=he(i,Aa(".button"+$e.asCSSSelector(bdt))),o=he(i,Aa(".overloads")),r=he(i,Aa(".button"+$e.asCSSSelector(_dt)));this._register(J(s,"click",u=>{Ht.stop(u),this.previous()})),this._register(J(r,"click",u=>{Ht.stop(u),this.next()}));const a=Aa(".body"),l=new wD(a,{alwaysConsumeMouseWheel:!0});this._register(l),t.appendChild(l.getDomNode());const c=he(a,Aa(".signature")),d=he(a,Aa(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:c,overloads:o,docs:d,scrollbar:l},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection(u=>{this.visible&&this.editor.layoutContentWidget(this)}));const h=()=>{if(!this.domNodes)return;const u=this.editor.getOption(59),f=this.domNodes.element;f.style.fontSize=`${u.fontSize}px`,f.style.lineHeight=`${u.lineHeight/u.fontSize}`,f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamily",u.fontFamily),f.style.setProperty("--vscode-parameterHintsWidget-editorFontFamilyDefault",zr.fontFamily)};h(),this._register(ve.chain(this.editor.onDidChangeConfiguration.bind(this.editor),u=>u.filter(f=>f.hasChanged(59)))(h)),this._register(this.editor.onDidLayoutChange(u=>this.updateMaxHeight())),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout(()=>{var e;(e=this.domNodes)==null||e.element.classList.add("visible")},100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,(e=this.domNodes)==null||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){if(this.renderDisposeables.clear(),!this.domNodes)return;const t=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",t),this.keyMultipleSignatures.set(t),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const i=e.signatures[e.activeSignature];if(!i)return;const s=he(this.domNodes.signature,Aa(".code")),o=i.parameters.length>0,r=i.activeParameter??e.activeParameter;if(o)this.renderParameters(s,i,r);else{const c=he(s,Aa("span"));c.textContent=i.label}const a=i.parameters[r];if(a!=null&&a.documentation){const c=Aa("span.documentation");if(typeof a.documentation=="string")c.textContent=a.documentation;else{const d=this.renderMarkdownDocs(a.documentation);c.appendChild(d.element)}he(this.domNodes.docs,Aa("p",{},c))}if(i.documentation!==void 0)if(typeof i.documentation=="string")he(this.domNodes.docs,Aa("p",{},i.documentation));else{const c=this.renderMarkdownDocs(i.documentation);he(this.domNodes.docs,c.element)}const l=this.hasDocs(i,a);if(this.domNodes.signature.classList.toggle("has-docs",l),this.domNodes.docs.classList.toggle("empty",!l),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,a){let c="";const d=i.parameters[r];Array.isArray(d.label)?c=i.label.substring(d.label[0],d.label[1]):c=d.label,d.documentation&&(c+=typeof d.documentation=="string"?`, ${d.documentation}`:`, ${d.documentation.value}`),i.documentation&&(c+=typeof i.documentation=="string"?`, ${i.documentation}`:`, ${i.documentation.value}`),this.announcedLabel!==c&&(vr(_(1314,"{0}, hint",c)),this.announcedLabel=c)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRendererService.render(e,{context:this.editor,asyncRenderCallback:()=>{var i;(i=this.domNodes)==null||i.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&typeof t.documentation=="string"&&qp(t.documentation).length>0||t&&typeof t.documentation=="object"&&qp(t.documentation).value.length>0||e.documentation&&typeof e.documentation=="string"&&qp(e.documentation).length>0||e.documentation&&typeof e.documentation=="object"&&qp(e.documentation.value).length>0)}renderParameters(e,t,i){const[s,o]=this.getParameterLabelOffsets(t,i),r=document.createElement("span");r.textContent=t.label.substring(0,s);const a=document.createElement("span");a.textContent=t.label.substring(s,o),a.className="parameter active";const l=document.createElement("span");l.textContent=t.label.substring(o),he(e,r,a,l)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const s=new RegExp(`(\\W|^)${wa(i.label)}(?=\\W|$)`,"g");s.test(e.label);const o=s.lastIndex-i.label.length;return o>=0?[o,s.lastIndex]:[0,0]}else return[0,0]}else return[0,0]}next(){this.editor.focus(),this.model.next()}previous(){this.editor.focus(),this.model.previous()}getDomNode(){return this.domNodes||this.createParameterHintDOMNodes(),this.domNodes.element}getId(){return kq.ID}updateMaxHeight(){if(!this.domNodes)return;const t=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=t;const i=this.domNodes.element.getElementsByClassName("phwrapper");i.length&&(i[0].style.maxHeight=t)}},kq=I1,I1.ID="editor.widget.parameterHintsWidget",I1);Iq=kq=mdt([Yle(2,Xe),Yle(3,ed)],Iq);F("editorHoverWidget.highlightForeground",d0,_(1315,"Foreground color of the active item in the parameter hint."));var vdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Zle=function(n,e){return function(t,i){e(t,i,n)}},Eq,E1;let HS=(E1=class extends G{static get(e){return e.getContribution(Eq.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new Lq(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints(s=>{var o;s?(this.widget.value.show(),this.widget.value.render(s)):(o=this.widget.rawValue)==null||o.hide()})),this.widget=new ro(()=>this._register(t.createInstance(Iq,this.editor,this.model)))}cancel(){this.model.cancel()}previous(){var e;(e=this.widget.rawValue)==null||e.previous()}next(){var e;(e=this.widget.rawValue)==null||e.next()}trigger(e){this.model.trigger(e,0)}},Eq=E1,E1.ID="editor.controller.parameterHints",E1);HS=Eq=vdt([Zle(1,Ae),Zle(2,De)],HS);class wdt extends Ne{constructor(){super({id:"editor.action.triggerParameterHints",label:ie(1311,"Trigger Parameter Hints"),precondition:H.hasSignatureHelpProvider,kbOpts:{kbExpr:H.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=HS.get(t);i==null||i.trigger({triggerKind:fu.Invoke})}}At(HS.ID,HS,2);we(wdt);const eQ=175,tQ=hs.bindToContribution(HS.get);ye(new tQ({id:"closeParameterHints",precondition:Lw.Visible,handler:n=>n.cancel(),kbOpts:{weight:eQ,kbExpr:H.focus,primary:9,secondary:[1033]}}));ye(new tQ({id:"showPrevParameterHint",precondition:le.and(Lw.Visible,Lw.MultipleSignatures),handler:n=>n.previous(),kbOpts:{weight:eQ,kbExpr:H.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}}));ye(new tQ({id:"showNextParameterHint",precondition:le.and(Lw.Visible,Lw.MultipleSignatures),handler:n=>n.next(),kbOpts:{weight:eQ,kbExpr:H.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));const kQ=class kQ extends G{constructor(e){super(),this._editor=e,this._editorObs=$i(this._editor),this._placeholderText=this._editorObs.getOption(100),this._state=so({owner:this,equalsFn:mH},t=>{const i=this._placeholderText.read(t);if(i&&this._editorObs.valueIsEmpty.read(t))return{placeholder:i}}),this._shouldViewBeAlive=Cdt(this,t=>{var i;return((i=this._state.read(t))==null?void 0:i.placeholder)!==void 0}),this._view=oe(t=>{if(!this._shouldViewBeAlive.read(t))return;const i=Ot("div.editorPlaceholder");t.store.add(qe(s=>{const o=this._state.read(s),r=(o==null?void 0:o.placeholder)!==void 0;i.root.style.display=r?"block":"none",i.root.innerText=(o==null?void 0:o.placeholder)??""})),t.store.add(qe(s=>{const o=this._editorObs.layoutInfo.read(s);i.root.style.left=`${o.contentLeft}px`,i.root.style.width=o.contentWidth-o.verticalScrollbarWidth+"px",i.root.style.top=`${this._editor.getTopForLineNumber(0)}px`})),t.store.add(qe(s=>{i.root.style.fontFamily=this._editorObs.getOption(58).read(s),i.root.style.fontSize=this._editorObs.getOption(61).read(s)+"px",i.root.style.lineHeight=this._editorObs.getOption(75).read(s)+"px"})),t.store.add(this._editorObs.createOverlayWidget({allowEditorOverflow:!1,minContentWidthInPx:wi(0),position:wi(null),domNode:i.root}))}),this._view.recomputeInitiallyAndOnChange(this._store)}};kQ.ID="editor.contrib.placeholderText";let t4=kQ;function Cdt(n,e){return Hg(n,(t,i)=>i===!0?!0:e(t))}var ydt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sdt=function(n,e){return function(t,i){e(t,i,n)}};class xdt{constructor(e){this.instantiationService=e}init(...e){}}function Ldt(n){return n()}let Xle=class extends xdt{constructor(e,t){super(t),this.init(e)}};Xle=ydt([Sdt(1,Ae)],Xle);At(t4.ID,Ldt(()=>t4),0);F("editor.placeholder.foreground",T6e,_(1334,"Foreground color of the placeholder text in the editor."));var kdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eR=function(n,e){return function(t,i){e(t,i,n)}};const mx=new Se("renameInputVisible",!1,_(1391,"Whether the rename input widget is visible"));new Se("renameInputFocused",!1,_(1392,"Whether the rename input widget is focused"));let Nq=class{constructor(e,t,i,s,o,r){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=s,this._logService=r,this.allowEditorOverflow=!0,this._disposables=new ne,this._visibleContextKey=mx.bindTo(o),this._isEditingRenameCandidate=!1,this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,this._candidates=new Set,this._beforeFirstInputFieldEditSW=new Ls,this._inputWithButton=new Idt,this._disposables.add(this._inputWithButton),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(59)&&this._updateFont()})),this._disposables.add(i.onDidColorThemeChange(this._updateStyles,this))}dispose(){this._disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return"__renameInputWidget"}getDomNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="monaco-editor rename-box",this._domNode.appendChild(this._inputWithButton.domNode),this._renameCandidateListView=this._disposables.add(new iQ(this._domNode,{fontInfo:this._editor.getOption(59),onFocusChange:e=>{this._inputWithButton.input.value=e,this._isEditingRenameCandidate=!1},onSelectionChange:()=>{this._isEditingRenameCandidate=!1,this.acceptInput(!1)}})),this._disposables.add(this._inputWithButton.onDidInputChange(()=>{var e,t,i;((e=this._renameCandidateListView)==null?void 0:e.focusedCandidate)!==void 0&&(this._isEditingRenameCandidate=!0),this._timeBeforeFirstInputFieldEdit??(this._timeBeforeFirstInputFieldEdit=this._beforeFirstInputFieldEditSW.elapsed()),((t=this._renameCandidateProvidersCts)==null?void 0:t.token.isCancellationRequested)===!1&&this._renameCandidateProvidersCts.cancel(),(i=this._renameCandidateListView)==null||i.clearFocus()})),this._label=document.createElement("div"),this._label.className="rename-label",this._domNode.appendChild(this._label),this._updateFont(),this._updateStyles(this._themeService.getColorTheme())),this._domNode}_updateStyles(e){if(!this._domNode)return;const t=e.getColor(ix),i=e.getColor(SY);this._domNode.style.backgroundColor=String(e.getColor(el)??""),this._domNode.style.boxShadow=t?` 0 0 8px 2px ${t}`:"",this._domNode.style.border=i?`1px solid ${i}`:"",this._domNode.style.color=String(e.getColor(dme)??"");const s=e.getColor(hme);this._inputWithButton.domNode.style.backgroundColor=String(e.getColor(eV)??""),this._inputWithButton.input.style.backgroundColor=String(e.getColor(eV)??""),this._inputWithButton.domNode.style.borderWidth=s?"1px":"0px",this._inputWithButton.domNode.style.borderStyle=s?"solid":"none",this._inputWithButton.domNode.style.borderColor=(s==null?void 0:s.toString())??"none"}_updateFont(){if(this._domNode===void 0)return;Ft(this._label!==void 0,"RenameWidget#_updateFont: _label must not be undefined given _domNode is defined"),this._editor.applyFontInfo(this._inputWithButton.input);const e=this._editor.getOption(59);this._label.style.fontSize=`${this._computeLabelFontSize(e.fontSize)}px`}_computeLabelFontSize(e){return e*.8}getPosition(){if(!this._visible||!this._editor.hasModel()||!this._editor.getDomNode())return null;const e=Jm(this.getDomNode().ownerDocument.body),t=dn(this._editor.getDomNode()),i=this._getTopForPosition();this._nPxAvailableAbove=i+t.top,this._nPxAvailableBelow=e.height-this._nPxAvailableAbove;const s=this._editor.getOption(75),{totalHeight:o}=PN.getLayoutInfo({lineHeight:s}),r=this._nPxAvailableBelow>o*6?[2,1]:[1,2];return{position:this._position,preference:r}}beforeRender(){var i,s;const[e,t]=this._acceptKeybindings;return this._label.innerText=_(1393,"{0} to Rename, {1} to Preview",(i=this._keybindingService.lookupKeybinding(e))==null?void 0:i.getLabel(),(s=this._keybindingService.lookupKeybinding(t))==null?void 0:s.getLabel()),this._domNode.style.minWidth="200px",null}afterRender(e){if(e===null){this.cancelInput(!0,"afterRender (because position is null)");return}if(!this._editor.hasModel()||!this._editor.getDomNode())return;Ft(this._renameCandidateListView),Ft(this._nPxAvailableAbove!==void 0),Ft(this._nPxAvailableBelow!==void 0);const t=zf(this._inputWithButton.domNode),i=zf(this._label);let s;e===2?s=this._nPxAvailableBelow:s=this._nPxAvailableAbove,this._renameCandidateListView.layout({height:s-i-t,width:aa(this._inputWithButton.domNode)})}acceptInput(e){var t;this._trace("invoking acceptInput"),(t=this._currentAcceptInput)==null||t.call(this,e)}cancelInput(e,t){var i;(i=this._currentCancelInput)==null||i.call(this,e)}focusNextRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusNext()||(this._inputWithButton.input.value=this._currentName)}focusPreviousRenameSuggestion(){var e;(e=this._renameCandidateListView)!=null&&e.focusPrevious()||(this._inputWithButton.input.value=this._currentName)}getInput(e,t,i,s,o){const{start:r,end:a}=this._getSelection(e,t);this._renameCts=o;const l=new ne;this._nRenameSuggestionsInvocations=0,this._hadAutomaticRenameSuggestionsInvocation=!1,s===void 0?this._inputWithButton.button.style.display="none":(this._inputWithButton.button.style.display="flex",this._requestRenameCandidatesOnce=s,this._requestRenameCandidates(t,!1),l.add(J(this._inputWithButton.button,"click",()=>this._requestRenameCandidates(t,!0))),l.add(J(this._inputWithButton.button,_e.KEY_DOWN,d=>{const h=new ui(d);(h.equals(3)||h.equals(10))&&(h.stopPropagation(),h.preventDefault(),this._requestRenameCandidates(t,!0))}))),this._isEditingRenameCandidate=!1,this._domNode.classList.toggle("preview",i),this._position=new U(e.startLineNumber,e.startColumn),this._currentName=t,this._inputWithButton.input.value=t,this._inputWithButton.input.setAttribute("selectionStart",r.toString()),this._inputWithButton.input.setAttribute("selectionEnd",a.toString()),this._inputWithButton.input.size=Math.max((e.endColumn-e.startColumn)*1.1,20),this._beforeFirstInputFieldEditSW.reset(),l.add(Re(()=>{this._renameCts=void 0,o.dispose(!0)})),l.add(Re(()=>{this._renameCandidateProvidersCts!==void 0&&(this._renameCandidateProvidersCts.dispose(!0),this._renameCandidateProvidersCts=void 0)})),l.add(Re(()=>this._candidates.clear()));const c=new Dw;return c.p.finally(()=>{l.dispose(),this._hide()}),this._currentCancelInput=d=>{var h;return this._trace("invoking _currentCancelInput"),this._currentAcceptInput=void 0,this._currentCancelInput=void 0,(h=this._renameCandidateListView)==null||h.clearCandidates(),c.complete(d),!0},this._currentAcceptInput=d=>{this._trace("invoking _currentAcceptInput"),Ft(this._renameCandidateListView!==void 0);const h=this._renameCandidateListView.nCandidates;let u,f;const g=this._renameCandidateListView.focusedCandidate;if(g!==void 0?(this._trace("using new name from renameSuggestion"),u=g,f={k:"renameSuggestion"}):(this._trace("using new name from inputField"),u=this._inputWithButton.input.value,f=this._isEditingRenameCandidate?{k:"userEditedRenameSuggestion"}:{k:"inputField"}),u===t||u.trim().length===0){this.cancelInput(!0,"_currentAcceptInput (because newName === value || newName.trim().length === 0)");return}this._currentAcceptInput=void 0,this._currentCancelInput=void 0,this._renameCandidateListView.clearCandidates(),c.complete({newName:u,wantsPreview:i&&d,stats:{source:f,nRenameSuggestions:h,timeBeforeFirstInputFieldEdit:this._timeBeforeFirstInputFieldEdit,nRenameSuggestionsInvocations:this._nRenameSuggestionsInvocations,hadAutomaticRenameSuggestionsInvocation:this._hadAutomaticRenameSuggestionsInvocation}})},l.add(o.token.onCancellationRequested(()=>this.cancelInput(!0,"cts.token.onCancellationRequested"))),l.add(this._editor.onDidBlurEditorWidget(()=>{var d;return this.cancelInput(!((d=this._domNode)!=null&&d.ownerDocument.hasFocus()),"editor.onDidBlurEditorWidget")})),this._show(),c.p}_requestRenameCandidates(e,t){if(this._requestRenameCandidatesOnce!==void 0&&(this._renameCandidateProvidersCts!==void 0&&this._renameCandidateProvidersCts.dispose(!0),Ft(this._renameCts),this._inputWithButton.buttonState!=="stop")){this._renameCandidateProvidersCts=new Bi;const i=t?sE.Invoke:sE.Automatic,s=this._requestRenameCandidatesOnce(i,this._renameCandidateProvidersCts.token);if(s.length===0){this._inputWithButton.setSparkleButton();return}t||(this._hadAutomaticRenameSuggestionsInvocation=!0),this._nRenameSuggestionsInvocations+=1,this._inputWithButton.setStopButton(),this._updateRenameCandidates(s,e,this._renameCts.token)}}_getSelection(e,t){Ft(this._editor.hasModel());const i=this._editor.getSelection();let s=0,o=t.length;return!D.isEmpty(i)&&!D.spansMultipleLines(i)&&D.containsRange(e,i)&&(s=Math.max(0,i.startColumn-e.startColumn),o=Math.min(e.endColumn,i.endColumn)-e.startColumn),{start:s,end:o}}_show(){this._trace("invoking _show"),this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout(()=>{this._inputWithButton.input.focus(),this._inputWithButton.input.setSelectionRange(parseInt(this._inputWithButton.input.getAttribute("selectionStart")),parseInt(this._inputWithButton.input.getAttribute("selectionEnd")))},100)}async _updateRenameCandidates(e,t,i){const s=(...c)=>this._trace("_updateRenameCandidates",...c);s("start");const o=await rS(Promise.allSettled(e),i);if(this._inputWithButton.setSparkleButton(),o===void 0){s("returning early - received updateRenameCandidates results - undefined");return}const r=o.flatMap(c=>c.status==="fulfilled"&&Ts(c.value)?c.value:[]);s(`received updateRenameCandidates results - total (unfiltered) ${r.length} candidates.`);const a=bg(r,c=>c.newSymbolName);s(`distinct candidates - ${a.length} candidates.`);const l=a.filter(({newSymbolName:c})=>c.trim().length>0&&c!==this._inputWithButton.input.value&&c!==t&&!this._candidates.has(c));if(s(`valid distinct candidates - ${r.length} candidates.`),l.forEach(c=>this._candidates.add(c.newSymbolName)),l.length<1){s("returning early - no valid distinct candidates");return}s("setting candidates"),this._renameCandidateListView.setCandidates(l),s("asking editor to re-layout"),this._editor.layoutContentWidget(this)}_hide(){this._trace("invoked _hide"),this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}_getTopForPosition(){const e=this._editor.getVisibleRanges();let t;return e.length>0?t=e[0].startLineNumber:(this._logService.warn("RenameWidget#_getTopForPosition: this should not happen - visibleRanges is empty"),t=Math.max(1,this._position.lineNumber-5)),this._editor.getTopForLineNumber(this._position.lineNumber)-this._editor.getTopForLineNumber(t)}_trace(...e){this._logService.trace("RenameWidget",...e)}};Nq=kdt([eR(2,en),eR(3,Vt),eR(4,Xe),eR(5,Li)],Nq);class iQ{constructor(e,t){this._disposables=new ne,this._availableHeight=0,this._minimumWidth=0,this._lineHeight=t.fontInfo.lineHeight,this._typicalHalfwidthCharacterWidth=t.fontInfo.typicalHalfwidthCharacterWidth,this._listContainer=document.createElement("div"),this._listContainer.className="rename-box rename-candidate-list-container",e.appendChild(this._listContainer),this._listWidget=iQ._createListWidget(this._listContainer,this._candidateViewHeight,t.fontInfo),this._disposables.add(this._listWidget.onDidChangeFocus(i=>{i.elements.length===1&&t.onFocusChange(i.elements[0].newSymbolName)},this._disposables)),this._disposables.add(this._listWidget.onDidChangeSelection(i=>{i.elements.length===1&&t.onSelectionChange()},this._disposables)),this._disposables.add(this._listWidget.onDidBlur(i=>{this._listWidget.setFocus([])})),this._listWidget.style(Ww({listInactiveFocusForeground:EE,listInactiveFocusBackground:NE}))}dispose(){this._listWidget.dispose(),this._disposables.dispose()}layout({height:e,width:t}){this._availableHeight=e,this._minimumWidth=t}setCandidates(e){this._listWidget.splice(0,0,e);const t=this._pickListHeight(this._listWidget.length),i=this._pickListWidth(e);this._listWidget.layout(t,i),this._listContainer.style.height=`${t}px`,this._listContainer.style.width=`${i}px`,Jd(_(1394,"Received {0} rename suggestions",e.length))}clearCandidates(){this._listContainer.style.height="0px",this._listContainer.style.width="0px",this._listWidget.splice(0,this._listWidget.length,[])}get nCandidates(){return this._listWidget.length}get focusedCandidate(){if(this._listWidget.length===0)return;const e=this._listWidget.getSelectedElements()[0];if(e!==void 0)return e.newSymbolName;const t=this._listWidget.getFocusedElements()[0];if(t!==void 0)return t.newSymbolName}focusNext(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0)return this._listWidget.focusFirst(),this._listWidget.reveal(0),!0;if(e[0]===this._listWidget.length-1)return this._listWidget.setFocus([]),this._listWidget.reveal(0),!1;{this._listWidget.focusNext();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}focusPrevious(){if(this._listWidget.length===0)return!1;const e=this._listWidget.getFocus();if(e.length===0){this._listWidget.focusLast();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}else{if(e[0]===0)return this._listWidget.setFocus([]),!1;{this._listWidget.focusPrevious();const t=this._listWidget.getFocus()[0];return this._listWidget.reveal(t),!0}}}clearFocus(){this._listWidget.setFocus([])}get _candidateViewHeight(){const{totalHeight:e}=PN.getLayoutInfo({lineHeight:this._lineHeight});return e}_pickListHeight(e){const t=this._candidateViewHeight*e;return Math.min(t,this._availableHeight,this._candidateViewHeight*7)}_pickListWidth(e){const t=Math.ceil(Math.max(...e.map(s=>s.newSymbolName.length))*this._typicalHalfwidthCharacterWidth);return Math.max(this._minimumWidth,25+t+10)}static _createListWidget(e,t,i){const s=new class{getTemplateId(r){return"candidate"}getHeight(r){return t}},o=new class{constructor(){this.templateId="candidate"}renderTemplate(r){return new PN(r,i)}renderElement(r,a,l){l.populate(r)}disposeTemplate(r){r.dispose()}};return new pl("NewSymbolNameCandidates",e,s,[o],{keyboardSupport:!1,mouseSupport:!0,multipleSelectionSupport:!1})}}class Idt{constructor(){this._buttonHoverContent="",this._onDidInputChange=new q,this.onDidInputChange=this._onDidInputChange.event,this._disposables=new ne}get domNode(){return this._domNode||(this._domNode=document.createElement("div"),this._domNode.className="rename-input-with-button",this._domNode.style.display="flex",this._domNode.style.flexDirection="row",this._domNode.style.alignItems="center",this._inputNode=document.createElement("input"),this._inputNode.className="rename-input",this._inputNode.type="text",this._inputNode.style.border="none",this._inputNode.setAttribute("aria-label",_(1395,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._inputNode),this._buttonNode=document.createElement("div"),this._buttonNode.className="rename-suggestions-button",this._buttonNode.setAttribute("tabindex","0"),this._buttonGenHoverText=_(1396,"Generate New Name Suggestions"),this._buttonCancelHoverText=_(1397,"Cancel"),this._buttonHoverContent=this._buttonGenHoverText,this._disposables.add(td().setupDelayedHover(this._buttonNode,()=>({content:this._buttonHoverContent,style:1}))),this._domNode.appendChild(this._buttonNode),this._disposables.add(J(this.input,_e.INPUT,()=>this._onDidInputChange.fire())),this._disposables.add(J(this.input,_e.KEY_DOWN,e=>{const t=new ui(e);(t.keyCode===15||t.keyCode===17)&&this._onDidInputChange.fire()})),this._disposables.add(J(this.input,_e.CLICK,()=>this._onDidInputChange.fire())),this._disposables.add(J(this.input,_e.FOCUS,()=>{this.domNode.style.outlineWidth="1px",this.domNode.style.outlineStyle="solid",this.domNode.style.outlineOffset="-1px",this.domNode.style.outlineColor="var(--vscode-focusBorder)"})),this._disposables.add(J(this.input,_e.BLUR,()=>{this.domNode.style.outline="none"}))),this._domNode}get input(){return Ft(this._inputNode),this._inputNode}get button(){return Ft(this._buttonNode),this._buttonNode}get buttonState(){return this._buttonState}setSparkleButton(){this._buttonState="sparkle",this._sparkleIcon??(this._sparkleIcon=ih(de.sparkle)),js(this.button),this.button.appendChild(this._sparkleIcon),this.button.setAttribute("aria-label","Generating new name suggestions"),this._buttonHoverContent=this._buttonGenHoverText,this.input.focus()}setStopButton(){this._buttonState="stop",this._stopIcon??(this._stopIcon=ih(de.stopCircle)),js(this.button),this.button.appendChild(this._stopIcon),this.button.setAttribute("aria-label","Cancel generating new name suggestions"),this._buttonHoverContent=this._buttonCancelHoverText,this.input.focus()}dispose(){this._disposables.dispose()}}const yI=class yI{constructor(e,t){this._domNode=document.createElement("div"),this._domNode.className="rename-box rename-candidate",this._domNode.style.display="flex",this._domNode.style.columnGap="5px",this._domNode.style.alignItems="center",this._domNode.style.height=`${t.lineHeight}px`,this._domNode.style.padding=`${yI._PADDING}px`;const i=document.createElement("div");i.style.display="flex",i.style.alignItems="center",i.style.width=i.style.height=`${t.lineHeight*.8}px`,this._domNode.appendChild(i),this._icon=ih(de.sparkle),this._icon.style.display="none",i.appendChild(this._icon),this._label=document.createElement("div"),Ms(this._label,t),this._domNode.appendChild(this._label),e.appendChild(this._domNode)}populate(e){this._updateIcon(e),this._updateLabel(e)}_updateIcon(e){var i;const t=!!((i=e.tags)!=null&&i.includes(dW.AIGenerated));this._icon.style.display=t?"inherit":"none"}_updateLabel(e){this._label.innerText=e.newSymbolName}static getLayoutInfo({lineHeight:e}){return{totalHeight:e+yI._PADDING*2}}dispose(){}};yI._PADDING=2;let PN=yI;var Edt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ib=function(n,e){return function(t,i){e(t,i,n)}},Dq;class nQ{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}async resolveRenameLocation(e){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join(` `):void 0}:{range:D.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join(` `):void 0}}async provideRenameEdits(e,t){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}async _provideRenameEdits(e,t,i,s){const o=this._providers[t];if(!o)return{edits:[],rejectReason:i.join(` -`)};const r=await o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(_(1380,"No result.")),s);return r}}async function Tdt(n,e,t,i){const s=new sQ(e,t,n),o=await s.resolveRenameLocation(vt.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,vt.None)}var R1;let f_=(R1=class{static get(e){return e.getContribution(Tq.ID)}constructor(e,t,i,s,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new ne,this._cts=new Wi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Dq,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Wi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new sQ(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new Mg(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const m=i.resolveRenameLocation(s.token);this._progressService.showWhile(m,250),o=await m,e("resolved rename location")}catch(m){m instanceof ic?e("resolve rename location cancelled",JSON.stringify(m,null," ")):(e("resolve rename location failed",m instanceof Error?m:JSON.stringify(m,null," ")),(typeof m=="string"||cg(m))&&((g=_a.get(this.editor))==null||g.showMessage(m||_(1381,"An unknown error occurred while resolving rename location"),t)));return}finally{s.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),(p=_a.get(this.editor))==null||p.showMessage(o.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Mg(this.editor,5,o.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async m=>[m,await m.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(m,b)=>{let v=c.slice();return m===sI.Automatic&&(v=v.filter(([w,C])=>C)),v.map(([w])=>w.provideNewSymbolNames(a,o.range,m,b))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=lS(i.provideRenameEdits(u.newName,r.token),r.token).then(async m=>{if(!m){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(m.rejectReason){e(`returning early - rejected with reason: ${m.rejectReason}`),this._notificationService.info(m.rejectReason);return}this.editor.setSelection(D.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(m,{editor:this.editor,showPreview:u.wantsPreview,label:_(1382,"Renaming '{0}' to '{1}'",o==null?void 0:o.text,u.newName),code:"undoredo.rename",quotableLabel:_(1383,"Renaming {0} to {1}",o==null?void 0:o.text,u.newName),respectAutoSaveConfig:!0,reason:wo.rename()}).then(b=>{e("edits applied"),b.ariaSummary&&_r(_(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,b.ariaSummary))}).catch(b=>{e(`error when applying edits ${JSON.stringify(b,null," ")}`),this._notificationService.error(_(1385,"Rename failed to apply edits")),this._logService.error(b)})},m=>{e("error when providing rename edits",JSON.stringify(m,null," ")),this._notificationService.error(_(1386,"Rename failed to compute edits")),this._logService.error(m)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},Tq=R1,R1.ID="editor.contrib.renameController",R1);f_=Tq=Ddt([nb(1,Ae),nb(2,fn),nb(3,ID),nb(4,Tg),nb(5,ki),nb(6,s3),nb(7,De)],f_);class Rdt extends Ne{constructor(){super({id:"editor.action.rename",label:ie(1388,"Rename Symbol"),precondition:le.and(H.writable,H.hasRenameProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(Ft),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return He.isUri(s)&&U.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Je):super.runCommand(e,t)}run(e,t){const i=e.get(ki),s=f_.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}At(f_.ID,f_,4);we(Rdt);const oQ=cs.bindToContribution(f_.get);ye(new oQ({id:"acceptRenameInput",precondition:bx,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:le.and(H.focus,le.not("isComposing")),primary:3}}));ye(new oQ({id:"acceptRenameInputWithPreview",precondition:le.and(bx,le.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:le.and(H.focus,le.not("isComposing")),primary:2051}}));ye(new oQ({id:"cancelRenameInput",precondition:bx,handler:n=>n.cancelRenameInput(),kbOpts:{weight:199,kbExpr:H.focus,primary:9,secondary:[1033]}}));ni(class extends Ps{constructor(){super({id:"focusNextRenameSuggestion",title:{...ie(1389,"Focus Next Rename Suggestion")},precondition:bx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(Ft).getFocusedCodeEditor();if(!t)return;const i=f_.get(t);i&&i.focusNextRenameSuggestion()}});ni(class extends Ps{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...ie(1390,"Focus Previous Rename Suggestion")},precondition:bx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(Ft).getFocusedCodeEditor();if(!t)return;const i=f_.get(t);i&&i.focusPreviousRenameSuggestion()}});Yr("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;Ot(typeof s=="string");const{renameProvider:o}=n.get(De);return Tdt(o,e,t,s)});Yr("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(De),o=await new sQ(e,t,i).resolveRenameLocation(vt.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});Ji.as(ah.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:_(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Mdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ece=function(n,e){return function(t,i){e(t,i,n)}},Fy;let i4=(Fy=class extends G{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{var r;const o=(r=this.editor.getModel())==null?void 0:r.getLanguageId();o&&s.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ai(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(s!=null&&s.markers)))return{foldingRules:s,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,s;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((s=this.options)!=null&&s.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(o=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(o)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),s=e.map(o=>Adt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,l=r.length;a0?t[0]:[]}async function t0e(n,e,t,i,s){const o=Wdt(n,e),r=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){c=d,l=null}return(!l||!l8(l)&&!JCe(l))&&(l=null),new Bdt(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function Hdt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class Vdt{constructor(e,t){this.provider=e,this.tokens=t}}function zdt(n,e){return n.has(e)}function i0e(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function rQ(n,e,t,i){const s=i0e(n,e),o=await Promise.all(s.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){Bn(l),a=null}return(!a||!l8(a))&&(a=null),new Vdt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}Rt.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;Ot(t instanceof He);const i=n.get(qi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(De),o=Hdt(s,i);return o?o[0].getLegend():n.get(Ei).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Rt.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;Ot(t instanceof He);const i=n.get(qi).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(De);if(!e0e(s,i))return n.get(Ei).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await t0e(s,i,null,null,vt.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!l8(a))return;const l=QCe({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});Rt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;Ot(t instanceof He);const s=n.get(qi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(De),r=i0e(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!D.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await rQ(o,s,D.lift(i),vt.None);if(a)return a.provider.getLegend()});Rt.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;Ot(t instanceof He),Ot(D.isIRange(i));const s=n.get(qi).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(De),r=await rQ(o,s,D.lift(i),vt.None);if(!(!r||!r.tokens))return QCe({id:0,type:"full",data:r.tokens.data})});const aQ="editor.semanticHighlighting";function rM(n,e,t){var s;const i=(s=t.getValue(aQ,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))==null?void 0:s.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var n0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Kh=function(n,e){return function(t,i){e(t,i,n)}},wp;let Rq=class extends G{constructor(e,t,i,s,o,r){super(),this._watchers=new kn;const a=d=>{var h;(h=this._watchers.get(d.uri))==null||h.dispose(),this._watchers.set(d.uri,new Mq(d,e,i,o,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);rM(d,i,s)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{rM(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{rM(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(aQ)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){Jt(this._watchers.values()),this._watchers.clear(),super.dispose()}};Rq=n0e([Kh(0,x3),Kh(1,qi),Kh(2,en),Kh(3,lt),Kh(4,pc),Kh(5,De)],Rq);var Gm;let Mq=(Gm=class extends G{constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:wp.REQUEST_MIN_DELAY,max:wp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ai(()=>this._fetchDocumentSemanticTokensNow(),wp.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{Jt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),Jt(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!e0e(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Wi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=t0e(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new xs(!1);s.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,o)}},l=>{l&&(fl(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Je(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(JCe(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(wp._copy(l,d-g,c,h-g,g),h-=g),f.data&&(wp._copy(f.data,0,c,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&wp._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(l8(t)){this._currentDocumentResponse=new jdt(e,t.resultId,t.data);const a=Q_e(t,i,this._model.getLanguageId());if(s.length>0)for(const l of s)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},wp=Gm,Gm.REQUEST_MIN_DELAY=300,Gm.REQUEST_MAX_DELAY=2e3,Gm);Mq=wp=n0e([Kh(1,x3),Kh(2,en),Kh(3,pc),Kh(4,De)],Mq);class jdt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}fx(Rq);var $dt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bL=function(n,e){return function(t,i){e(t,i,n)}},By;let n4=(By=class extends G{constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ai(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{var c;if(this._cleanupProviderListeners(),this._editor.hasModel()){const d=this._editor.getModel();for(const h of this._provider.all(d)){const u=(c=h.onDidChange)==null?void 0:c.call(h,()=>{this._cancelAll(),a()});u&&this._rangeProvidersChangeListeners.push(u)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(aQ)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){Jt(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=ss(r=>Promise.resolve(rQ(this._provider,e,t,r))),o=new xs(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,Q_e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},By.ID="editor.contrib.viewportSemanticTokens",By);n4=$dt([bL(1,x3),bL(2,en),bL(3,lt),bL(4,pc),bL(5,De)],n4);At(n4.ID,n4,1);class Udt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=o.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(Gp(h)&&$h(d))break;d=h}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new D(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var qdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Kdt=function(n,e){return function(t,i){e(t,i,n)}},Aq;class lQ{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new lQ(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var M1;let ON=(M1=class{static get(e){return e.getContribution(Aq.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await o0e(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(129),vt.None).then(o=>{var r;if(!(!Go(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Bi(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new lQ(0,a)),(r=this._selectionListener)==null||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>Ie.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},Aq=M1,M1.ID="editor.contrib.smartSelectController",M1);ON=Aq=qdt([Kdt(1,De)],ON);class s0e extends Ne{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=ON.get(t);i&&await i.run(this._forward)}}class Gdt extends s0e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:ie(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:_(1398,"&&Expand Selection"),order:2}})}}Rt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Ydt extends s0e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:ie(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:_(1399,"&&Shrink Selection"),order:3}})}}At(ON.ID,ON,4);we(Gdt);we(Ydt);async function o0e(n,e,t,i,s){const o=n.all(e).concat(new Udt(i.selectSubwords));o.length===1&&o.unshift(new VO);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,s)).then(c=>{if(Go(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((u,f)=>U.isBefore(u.getStartPosition(),f.getStartPosition())?1:U.isBefore(f.getStartPosition(),u.getStartPosition())||U.isBefore(u.getEndPosition(),f.getEndPosition())?-1:U.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||D.containsRange(u,d)&&!D.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;uU.isIPosition(r)));const s=n.get(De).selectionRangeProvider,o=await n.get(Xo).createModelReference(t);try{return o0e(s,o.object.textEditorModel,i.map(U.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},vt.None)}finally{o.dispose()}});const Pq=Object.freeze({View:ie(1638,"View"),Help:ie(1639,"Help"),Test:ie(1640,"Test"),File:ie(1641,"File"),Preferences:ie(1642,"Preferences"),Developer:ie(1643,"Developer")});class Zdt extends Qc{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...ie(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:_(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:ie(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Pq.View,toggled:{condition:le.equals("config.editor.stickyScroll.enabled",!0),title:_(1445,"Sticky Scroll"),mnemonicTitle:_(1446,"&&Sticky Scroll")},menu:[{id:Te.CommandPalette},{id:Te.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Te.StickyScrollContext}]})}async runEditorCommand(e,t){var r;const i=e.get(lt),s=!i.getValue("editor.stickyScroll.enabled"),o=(r=Zc.get(t))==null?void 0:r.isFocused();i.updateValue("editor.stickyScroll.enabled",s),o&&t.focus()}}const c8=100;class Xdt extends Qc{constructor(){super({id:"editor.action.focusStickyScroll",title:{...ie(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:_(1447,"&&Focus Editor Sticky Scroll")},precondition:le.and(le.has("config.editor.stickyScroll.enabled"),H.stickyScrollVisible),menu:[{id:Te.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Zc.get(t))==null||i.focus()}}class Qdt extends Qc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:ie(1451,"Select the next editor sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:18}})}runEditorCommand(e,t){var i;(i=Zc.get(t))==null||i.focusNext()}}class Jdt extends Qc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:ie(1452,"Select the previous sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:16}})}runEditorCommand(e,t){var i;(i=Zc.get(t))==null||i.focusPrevious()}}class eht extends Qc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:ie(1453,"Go to the focused sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:3}})}runEditorCommand(e,t){var i;(i=Zc.get(t))==null||i.goToFocused()}}class tht extends Qc{constructor(){super({id:"editor.action.selectEditor",title:ie(1454,"Select Editor"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:9}})}runEditorCommand(e,t){var i;(i=Zc.get(t))==null||i.selectEditor()}}At(Zc.ID,Zc,1);ni(Zdt);ni(Xdt);ni(Jdt);ni(Qdt);ni(eht);ni(tht);var r0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},UL=function(n,e){return function(t,i){e(t,i,n)}};class iht{constructor(e,t,i,s,o,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.gutterMenuLinkAction=r,this.completion=a}}let Oq=class extends YMe{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(vt.None)}return e}};Oq=r0e([UL(5,o8)],Oq);let Fq=class extends G{constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){var f;if(i.selectedSuggestionInfo)return;let o;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){o=g;break}if(!o)return;const r=o.getOption(102);if(L0.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(L0.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new D(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new Lle(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await qX(this._languageFeatureService.completionProvider,e,t,new xN(void 0,jO.createSuggestFilter(o).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new jp(g.items,t.column,new Lle(u,0),zO.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Oq(e,t.lineNumber,c,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(vt.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var o;const i=e.getValueInRange(D.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))(o=r.triggerCharacters)!=null&&o.includes(i)&&s.add(r);if(s.size!==0)return{providers:s,ch:i}}};Fq=r0e([UL(0,De),UL(1,xa),UL(2,o8),UL(3,Ft)],Fq);fx(Fq);class nht extends Ne{constructor(){super({id:"editor.action.forceRetokenize",label:ie(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new xs;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}we(nht);const jF=class jF extends Ps{constructor(){super({id:jF.ID,title:ie(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:ie(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!mS.getTabFocusMode();mS.setTabFocusMode(t),_r(t?_(1528,"Pressing Tab will now move focus to the next focusable element"):_(1529,"Pressing Tab will now insert the tab character"))}};jF.ID="editor.action.toggleTabFocusMode";let Bq=jF;ni(Bq);var sht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tce=function(n,e){return function(t,i){e(t,i,n)}};let Wq=class extends G{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},s,o){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=ue(e,me("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Au("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new ti(this.el,"click")),a=this._register(new ti(this.el,"keypress")),l=ve.chain(a.event,h=>h.map(u=>new ui(u)).filter(u=>u.keyCode===3)),c=this._register(new ti(this.el,Li.Tap)).event;this._register(No.addTarget(this.el));const d=ve.any(r.event,l,c);this._register(d(h=>{this.enabled&&(Wt.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Wq=sht([tce(3,Cr),tce(4,jg)],Wq);var a0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hq=function(n,e){return function(t,i){e(t,i,n)}};const oht=26;let Vq=class extends G{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(zq))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,oht)}};Vq=a0e([Hq(1,Ae)],Vq);let zq=class extends G{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=me("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=me("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){js(this.element)}show(e){js(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ue(this.element,me("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(me(`div${Ue.asCSSSelector(e.icon)}`));const s=ue(this.element,me("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ue(this.element,me("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(Wq,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=ue(this.element,me("div.action-container"));this.actionBar=this._register(new Vr(o)),this.actionBar.push(this._register(new ol("banner.close",_(1533,"Close Banner"),Ue.asClassName(Jve),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};zq=a0e([Hq(0,Ae),Hq(1,Jc)],zq);var cQ=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iE=function(n,e){return function(t,i){e(t,i,n)}};const rht=Ai("extensions-warning-message",de.warning,_(1534,"Icon shown with a warning message in the extensions editor."));var Wy;let FN=(Wy=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:_(1535,"This document contains many non-basic ASCII unicode characters"),command:new WN};else if(o.ambiguousCharacterCount>=r)a={message:_(1536,"This document contains many ambiguous unicode characters"),command:new Nw};else if(o.invisibleCharacterCount>=r)a={message:_(1537,"This document contains many invisible unicode characters"),command:new BN};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:rht,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(Vq,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=aht(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?Fw.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?jMe:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new jq(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new lht(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},Wy.ID="editor.contrib.unicodeHighlighter",Wy);FN=cQ([iE(1,Zr),iE(2,Ybe),iE(3,Ae)],FN);function aht(n,e){return{nonBasicASCII:e.nonBasicASCII===Va?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Va?!n:e.includeComments,includeStrings:e.includeStrings===Va?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let jq=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ai(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:s4.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!jY(t,e))return null;const i=t.getValueInRange(e.range);return{reason:c0e(i,this._options),inComment:$Y(t,e),inString:UY(t,e)}}};jq=cQ([iE(3,Zr)],jq);class lht extends G{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ai(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=aY.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:s4.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return jY(t,e)?{reason:c0e(i,this._options),inComment:$Y(t,e),inString:UY(t,e)}:null}}const l0e=_(1538,"Configure Unicode Highlight Options");let $q=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=this._editor.getContribution(FN.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=s.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=L6(h);let f;switch(c.reason.kind){case 0:{aD(c.reason.confusableWith)?f=_(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,L6(c.reason.confusableWith.codePointAt(0))):f=_(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,L6(c.reason.confusableWith.codePointAt(0)));break}case 1:f=_(1541,"The character {0} is invisible.",u);break;case 2:f=_(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const g={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=_(1543,"Adjust settings"),m=bbe(o4.ID,g),b=new yo("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,l0e);o.push(new Fc(this,l.range,[b],!1,a++))}return o}renderHoverParts(e,t){return Lit(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` -`)}};$q=cQ([iE(1,Jc)],$q);function Uq(n){return`U+${n.toString(16).padStart(4,"0")}`}function L6(n){let e=`\`${Uq(n)}\``;return Ev.isInvisibleCharacter(n)||(e+=` "${`${cht(n)}`}"`),e}function cht(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function c0e(n,e){return aY.computeUnicodeHighlightReason(n,e)}const $F=class $F{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=nt.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};$F.instance=new $F;let s4=$F;class dht extends Ne{constructor(){super({id:Nw.ID,label:ie(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=_(1544,"Disable Highlight In Comments")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Pr.includeComments,!1,2)}}class hht extends Ne{constructor(){super({id:Nw.ID,label:ie(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=_(1545,"Disable Highlight In Strings")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Pr.includeStrings,!1,2)}}const UF=class UF extends Ps{constructor(){super({id:UF.ID,title:ie(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Pr.ambiguousCharacters,!1,2)}};UF.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let Nw=UF;const qF=class qF extends Ps{constructor(){super({id:qF.ID,title:ie(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1547,"Disable Invisible Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Pr.invisibleCharacters,!1,2)}};qF.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let BN=qF;const KF=class KF extends Ps{constructor(){super({id:KF.ID,title:ie(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Pr.nonBasicASCII,!1,2)}};KF.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let WN=KF;const GF=class GF extends Ps{constructor(){super({id:GF.ID,title:ie(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:s,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(Do),c=e.get(lt);function d(g){return Ev.isInvisibleCharacter(g)?_(1549,"Exclude {0} (invisible character) from being highlighted",Uq(g)):_(1550,"Exclude {0} from being highlighted",`${Uq(g)} "${a}"`)}const h=[];if(s.kind===0)for(const g of s.notAmbiguousInLocales)h.push({label:_(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{fht(c,[g])}});if(h.push({label:d(i),run:()=>uht(c,[i])}),r){const g=new dht;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new hht;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(s.kind===0){const g=new Nw;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(s.kind===1){const g=new BN;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(s.kind===2){const g=new WN;h.push({label:u(g),run:async()=>g.runAction(c)})}else ght(s);const f=await l.pick(h,{title:l0e});f&&await f.run()}};GF.ID="editor.action.unicodeHighlight.showExcludeOptions";let o4=GF;async function uht(n,e){const t=n.getValue(Pr.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(Pr.allowedCharacters,i,2)}async function fht(n,e){var s;const t=(s=n.inspect(Pr.allowedLocales).user)==null?void 0:s.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await n.updateValue(Pr.allowedLocales,i,2)}function ght(n){throw new Error(`Unexpected value: ${n}`)}ni(Nw);ni(BN);ni(WN);ni(o4);At(FN.ID,FN,1);Gw.register($q);var pht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ice=function(n,e){return function(t,i){e(t,i,n)}};const d0e="ignoreUnusualLineTerminators";function mht(n,e,t){n.setModelProperty(e.uri,d0e,t)}function _ht(n,e){return n.getModelProperty(e.uri,d0e)}var Hy;let r4=(Hy=class extends G{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||_ht(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:_(1558,"Unusual Line Terminators"),message:_(1559,"Detected unusual line terminators"),detail:_(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",rc(e.uri)),primaryButton:_(1561,"&&Remove Unusual Line Terminators"),cancelButton:_(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){mht(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},Hy.ID="editor.contrib.unusualLineTerminatorsDetector",Hy);r4=pht([ice(1,SD),ice(2,Ft)],r4);At(r4.ID,r4,1);var bht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},vht=function(n,e){return function(t,i){e(t,i,n)}};class nce{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const s=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,iA,!1).map(a=>({range:a.range,kind:rS.Text})):Promise.resolve(s)}provideMultiDocumentHighlights(e,t,i,s){const o=new kn,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,iA,!1).map(d=>({range:d.range,kind:rS.Text}));c&&o.set(a.uri,c)}return o}}let qq=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new nce)),this._register(e.multiDocumentHighlightProvider.register("*",new nce))}};qq=bht([vht(0,De)],qq);var h0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gh=function(n,e){return function(t,i){e(t,i,n)}},sn,Kq;const dQ=new Se("hasWordHighlights",!1);function u0e(n,e,t,i){const s=n.ordered(e);return zG(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,Bn)),o=>o!=null).then(o=>{if(o){const r=new kn;return r.set(e.uri,o),r}return new kn})}function wht(n,e,t,i,s){const o=n.ordered(e);return zG(o.map(r=>()=>{const a=s.filter(l=>Wpe(l)).filter(l=>uZ(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,Bn)}),r=>r!=null)}class f0e{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=ss(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new D(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class Cht extends f0e{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return u0e(this._providers,e,t.getPosition(),s).then(o=>o||new kn)}}class yht extends f0e{constructor(e,t,i,s,o){super(e,t,i),this._providers=s,this._otherModels=o}_compute(e,t,i,s){return wht(this._providers,e,t.getPosition(),s,this._otherModels).then(o=>o||new kn)}}function Sht(n,e,t,i){return new Cht(e,t,i,n)}function xht(n,e,t,i,s){return new yht(e,t,i,n,s)}Yr("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(De),s=await u0e(i.documentHighlightProvider,e,t,vt.None);return s==null?void 0:s.get(e.uri)});var Ym;let Gq=(Ym=class{constructor(e,t,i,s,o,r,a,l){this.toUnhook=new ne,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new kn,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new sc(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=dQ.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{O5(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():sn.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=sn.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":sn.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Ge.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Ge.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,sn.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(D.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);_r(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);_r(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=sn.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),sn.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const s of t){if(!s.hasModel()||i_(s.getModel().uri,e))continue;const o=sn.storedDecorationIDs.get(s.getModel().uri);if(!o)continue;s.removeDecorations(o),i.push(s.getModel().uri);const r=g_.get(s);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const s of i)sn.storedDecorationIDs.delete(s)}_stopSingular(){var e,t,i,s;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Ge.vscodeNotebookCell&&((i=(t=sn.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Ge.vscodeNotebookCell?(sn.query=null,this._run()):(s=sn.query)!=null&&s.modelInfo&&(sn.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Ge.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ge.vscodeNotebookCell&&o.push(l)}return o}const i=[],s=this.codeEditorService.listCodeEditors();for(const o of s){if(!uX(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of s){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var s,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){sn.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Je)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Ge.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!sn.query||!sn.query.modelInfo)return;const l=await this.textModelService.createModelReference(sn.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,sn.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Je)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?xht(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):Sht(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,s;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=g_.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=sn.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:Jct(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),sn.storedDecorationIDs=sn.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(s=r.wordHighlighter)==null||s._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},sn=Ym,Ym.storedDecorationIDs=new kn,Ym.query=null,Ym);Gq=sn=h0e([Gh(4,Xo),Gh(5,Ft),Gh(6,lt),Gh(7,ki)],Gq);var A1;let g_=(A1=class extends G{static get(e){return e.getContribution(Kq.ID)}constructor(e,t,i,s,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Ge.accessibleView&&(this._wordHighlighter=new Gq(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,s,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Ge.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},Kq=A1,A1.ID="editor.contrib.wordHighlighter",A1);g_=Kq=h0e([Gh(1,Xe),Gh(2,De),Gh(3,Ft),Gh(4,Xo),Gh(5,lt),Gh(6,ki)],g_);class g0e extends Ne{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=g_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Lht extends g0e{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:ie(1572,"Go to Next Symbol Highlight"),precondition:dQ,kbOpts:{kbExpr:H.editorTextFocus,primary:65,weight:100}})}}class kht extends g0e{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:ie(1573,"Go to Previous Symbol Highlight"),precondition:dQ,kbOpts:{kbExpr:H.editorTextFocus,primary:1089,weight:100}})}}class Eht extends Ne{constructor(){super({id:"editor.action.wordHighlight.trigger",label:ie(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=g_.get(t);s&&s.restoreViewState(!0)}}At(g_.ID,g_,0);we(Lht);we(kht);we(Eht);fx(qq);class d8 extends cs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=ac(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new U(c.positionLineNumber,c.positionColumn),h=this._move(s,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>Bt.fromModelSelection(c))),l.length===1){const c=new U(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Ie(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ie(t.lineNumber,t.column,t.lineNumber,t.column)}}class k_ extends d8{_move(e,t,i,s,o){return Zt.moveWordLeft(e,t,i,s,o)}}class E_ extends d8{_move(e,t,i,s,o){return Zt.moveWordRight(e,t,i,s)}}class Iht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Nht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Dht extends k_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ix,P3))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Tht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Rht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Mht extends k_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ix,P3))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Aht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s,o){return super._move(ac(zo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class Pht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s,o){return super._move(ac(zo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class Oht extends E_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Fht extends E_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ix,P3))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Bht extends E_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Wht extends E_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Hht extends E_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ix,P3))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Vht extends E_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class zht extends E_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s,o){return super._move(ac(zo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class jht extends E_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s,o){return super._move(ac(zo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class h8 extends cs{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e==null?void 0:e.get(Ki);if(!t.hasModel()||!s)return;const o=ac(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ro(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class hQ extends h8{_delete(e,t){const i=Zt.deleteWordLeft(e,t);return i||new D(1,1,1,1)}}class uQ extends h8{_delete(e,t){const i=Zt.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new D(s,o,s,o)}}class $ht extends hQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:H.writable})}}class Uht extends hQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:H.writable})}}class qht extends hQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Kht extends uQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:H.writable})}}class Ght extends uQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:H.writable})}}class Yht extends uQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Zht extends Ne{constructor(){super({id:"deleteInsideWord",precondition:H.writable,label:ie(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const s=ac(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Zt.deleteInsideWord(s,o,l);return new ro(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}ye(new Iht);ye(new Nht);ye(new Dht);ye(new Tht);ye(new Rht);ye(new Mht);ye(new Oht);ye(new Fht);ye(new Bht);ye(new Wht);ye(new Hht);ye(new Vht);ye(new Aht);ye(new Pht);ye(new zht);ye(new jht);ye(new $ht);ye(new Uht);ye(new qht);ye(new Kht);ye(new Ght);ye(new Yht);we(Zht);class Xht extends h8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=_3.deleteWordPartLeft(e);return i||new D(1,1,1,1)}}class Qht extends h8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=_3.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new D(s,o,s,o)}}class p0e extends d8{_move(e,t,i,s,o){return _3.moveWordPartLeft(e,t,i,o)}}class Jht extends p0e{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class eut extends p0e{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class m0e extends d8{_move(e,t,i,s,o){return _3.moveWordPartRight(e,t,i)}}class tut extends m0e{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class iut extends m0e{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ye(new Xht);ye(new Qht);ye(new Jht);ye(new eut);ye(new tut);ye(new iut);const IQ=class IQ extends G{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=_a.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new yo(_(1378,"Cannot edit in read-only input")):t=new yo(_(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};IQ.ID="editor.contrib.readOnlyMessageController";let a4=IQ;At(a4.ID,a4,2);var nut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sce=function(n,e){return function(t,i){e(t,i,n)}};let Yq=class extends G{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ze(this,void 0);const s=da("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=da("_textModel.onDidChangeContent",ve.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(Eo(async(r,a)=>{s.read(r),o.read(r);const l=a.add(new QZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(ige(lo(o=>o.range.endLineNumber-o.range.startLineNumber,pa))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};Yq=nut([sce(1,De),sce(2,jD)],Yq);ZP.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(Yq,n));var sut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k6=function(n,e){return function(t,i){e(t,i,n)}},Vy;let l4=(Vy=class extends G{constructor(e,t,i,s){super();const o=this._register(Ui(e)),r=this._register(s.createMenu(Te.EditorContent,e.contextKeyService)),a=Ut(this,r.onDidChange,()=>r.getActions().length===0);this._register(qe(l=>{if(a.read(l))return;const d=Pt("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(cN,d.root,Te.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof rl))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends c_{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(qe(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:Ci(0),position:Ci({preference:1})}))}))}},Vy.ID="editor.contrib.floatingToolbar",Vy);l4=sut([k6(1,Ae),k6(2,Ht),k6(3,uc)],l4);At(l4.ID,l4,1);const NQ=class NQ extends G{constructor(e){super(),this.editor=e,this.widget=null,nc&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new Zq(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};NQ.ID="editor.contrib.iPadShowKeyboard";let c4=NQ;const YF=class YF extends G{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(J(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(J(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return YF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};YF.ID="editor.contrib.ShowKeyboardWidget";let Zq=YF;At(c4.ID,c4,3);var out=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},oce=function(n,e){return function(t,i){e(t,i,n)}},Xq,P1;let HN=(P1=class extends G{static get(e){return e.getContribution(Xq.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(rn.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Qq(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},Xq=P1,P1.ID="editor.contrib.inspectTokens",P1);HN=Xq=out([oce(1,ml),oce(2,un)],HN);class rut extends Ne{constructor(){super({id:"editor.action.inspectTokens",label:xz.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=HN.get(t);i==null||i.launch()}}function aut(n){let e="";for(let t=0,i=n.length;tpS,tokenize:(s,o,r)=>fY(e,r),tokenizeEncoded:(s,o,r)=>o3(i,r)}}const ZF=class ZF extends G{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=lut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return ZF._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let s=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){s=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},rce=function(n,e){return function(t,i){e(t,i,n)}},qL,O1;let Jq=(O1=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Ji.as(jw.Quickaccess)}provide(e){const t=new ne;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(qL.PREFIX.length));s&&s.prefix&&s.prefix!==qL.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==qL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:_(1747,"{0}, {1}",s,t.description),description:t.description}})}},qL=O1,O1.PREFIX="?",O1);Jq=qL=cut([rce(0,Do),rce(1,Ht)],Jq);Ji.as(jw.Quickaccess).registerQuickAccessProvider({ctor:Jq,prefix:"",helpEntries:[{description:Lz.helpQuickAccessActionLabel}]});class _0e{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const s=new ne;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Kt);return o.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new ne,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=_1e(o);if(a){let l=o.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},s.add(Y1(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}s.add(Re(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Xd(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return uX(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:an(Gme),position:ll.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Xb=class Xb extends _0e{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(Xb.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(Xb.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=_(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,G.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new ne;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(Xb.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(s,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(s);return}const g=this.toRange(h,u);s.revealRangeInCenter(g,0),this.addDecorations(s,g)},a=new Ug({title:_(1336,"Use Zero-Based Offset"),icon:de.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:pe(mD),inputActiveOptionForeground:pe(_D),inputActiveOptionBackground:pe(ox)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=_1e(s);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(Re(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var s,o;const i=this.getModel(e);if(!i)return{label:_(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?_(1338,"Type a character position to go to (from 0 to {0}).",a-1):_(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:_(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((s=r[0])==null?void 0:s.trim(),10);if(r.length<1||isNaN(l))return{label:_(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?_(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):_(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:_(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};Xb.PREFIX=":",Xb.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let eK=Xb;var dut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ace=function(n,e){return function(t,i){e(t,i,n)}};let VN=class extends eK{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};VN=dut([ace(0,Ft),ace(1,Qo)],VN);var F1;let b0e=(F1=class extends Ne{constructor(){super({id:F1.ID,label:_P.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(Do).quickAccess.show(VN.PREFIX)}},F1.ID="editor.action.gotoLine",F1);we(b0e);Ji.as(jw.Quickaccess).registerQuickAccessProvider({ctor:VN,prefix:VN.PREFIX,helpEntries:[{description:_P.gotoLineActionLabel,commandId:b0e.ID}]});const v0e=[void 0,[]];function E6(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?hut(n,s.values,t,i):w0e(n,e,t,i)}function hut(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,l]=w0e(n,r,t,i);if(typeof a!="number")return v0e;s+=a,o.push(...l)}return[s,uut(o)]}function w0e(n,e,t,i){const s=cw(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],xD(s)]:v0e}function uut(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!fut(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function fut(n,e){return!(n.end=0,r=lce(n);let a;const l=n.split(C0e);if(l.length>1)for(const c of l){const d=lce(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=cce(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function cce(n){let e;$s?e=n.replace(/\//g,jd):e=n.replace(/\\/g,jd);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function dce(n){return Array.isArray(n)?tK(n.map(e=>e.original).join(C0e)):tK(n.original)}var gut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hce=function(n,e){return function(t,i){e(t,i,n)}},aM,Rd;let Hv=(Rd=class extends _0e{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,_(1345,"To go to a symbol, first open a text editor with symbol information.")),G.None}provideWithTextEditor(e,t,i,s){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,s):this.doProvideWithoutEditorSymbols(e,r,t,i):G.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new ne;return this.provideLabelPick(i,_(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Mw,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(Re(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,o){var h;const r=e.editor,a=new ne;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,s),c=a.add(new Kt),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new Wi,i.busy=!0;try{const g=tK(i.value.substr(aM.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(s.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const m=_I(p,b=>!!(b.type!=="separator"&&b.range&&D.containsPosition(b.range.decoration,u)));m&&(i.activeItems=[m])}}else g.original.length>0?this.provideLabelPick(i,_(1347,"No matching editor symbols")):this.provideLabelPick(i,_(1348,"No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,o){var b,v;const r=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(aM.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=dce(t.values[0]),d=dce(t.values.slice(1))):c=t;let h;const u=(v=(b=this.options)==null?void 0:b.openSideBySideDirection)==null?void 0:v.call(b);u&&(h=[{iconClass:u==="right"?Ue.asClassName(de.splitHorizontal):Ue.asClassName(de.splitVertical),tooltip:u==="right"?_(1349,"Open to the Side"):_(1350,"Open to the Bottom")}]);const f=[];for(let w=0;wl){let P=!1;if(c!==t&&([I,R]=E6(L,{...t,values:void 0},l,x),typeof I=="number"&&(P=!0)),typeof I!="number"&&([I,R]=E6(L,c,l,x),typeof I!="number"))continue;if(!P&&d){if(E&&d.original.length>0&&([M,A]=E6(E,d)),typeof M!="number")continue;typeof I=="number"&&(I+=M)}}const W=C.tags&&C.tags.indexOf(1)>=0;f.push({index:w,kind:C.kind,score:I,label:L,ariaLabel:NPe(C.name,C.kind),description:E,highlights:W?void 0:{label:R,description:A},range:{selection:D.collapseToStart(C.selectionRange),decoration:C.range},uri:o.uri,symbolName:S,strikethrough:W,buttons:h})}const g=f.sort((w,C)=>a?this.compareByKindAndScore(w,C):this.compareByScore(w,C));let p=[];if(a){let L=function(){C&&typeof w=="number"&&S>0&&(C.label=J1(N6[w]||I6,S))};var m=L;let w,C,S=0;for(const x of g)w!==x.kind?(L(),w=x.kind,S=1,C={type:"separator"},p.push(C)):S++,p.push(x);L()}else g.length>0&&(p=[{label:_(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=N6[e.kind]||I6,s=N6[t.kind]||I6,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},aM=Rd,Rd.PREFIX="@",Rd.SCOPE_PREFIX=":",Rd.PREFIX_BY_CATEGORY=`${Rd.PREFIX}${Rd.SCOPE_PREFIX}`,Rd);Hv=aM=gut([hce(0,De),hce(1,jD)],Hv);const I6=_(1352,"properties ({0})"),N6={5:_(1353,"methods ({0})"),11:_(1354,"functions ({0})"),8:_(1355,"constructors ({0})"),12:_(1356,"variables ({0})"),4:_(1357,"classes ({0})"),22:_(1358,"structs ({0})"),23:_(1359,"events ({0})"),24:_(1360,"operators ({0})"),10:_(1361,"interfaces ({0})"),2:_(1362,"namespaces ({0})"),3:_(1363,"packages ({0})"),25:_(1364,"type parameters ({0})"),1:_(1365,"modules ({0})"),6:_(1366,"properties ({0})"),9:_(1367,"enumerations ({0})"),21:_(1368,"enumeration members ({0})"),14:_(1369,"strings ({0})"),0:_(1370,"files ({0})"),17:_(1371,"arrays ({0})"),15:_(1372,"numbers ({0})"),16:_(1373,"booleans ({0})"),18:_(1374,"objects ({0})"),19:_(1375,"keys ({0})"),7:_(1376,"fields ({0})"),13:_(1377,"constants ({0})")};var put=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},D6=function(n,e){return function(t,i){e(t,i,n)}};let iK=class extends Hv{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};iK=put([D6(0,Ft),D6(1,De),D6(2,jD)],iK);const XF=class XF extends Ne{constructor(){super({id:XF.ID,label:ZI.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:H.hasDocumentSymbolProvider,kbOpts:{kbExpr:H.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(Do).quickAccess.show(Hv.PREFIX,{itemActivation:Sd.NONE})}};XF.ID="editor.action.quickOutline";let d4=XF;we(d4);Ji.as(jw.Quickaccess).registerQuickAccessProvider({ctor:iK,prefix:Hv.PREFIX,helpEntries:[{description:ZI.quickOutlineActionLabel,prefix:Hv.PREFIX,commandId:d4.ID},{description:ZI.quickOutlineByCategoryActionLabel,prefix:Hv.PREFIX_BY_CATEGORY}]});function mut(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class nE{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,s);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return mut(nE.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const o=nE.termFrequencies(s);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:s,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;s+=c*r}return s}computeEmbedding(e){const t=nE.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function _ut(n){var i;const e=n.slice(0);e.sort((s,o)=>o.score-s.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const s of e)s.score/=t;return e}var I0;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(I0||(I0={}));function T6(n){const e=n;return Array.isArray(e.items)}function uce(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class but extends G{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const s=new ne;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new Kt),a=async()=>{var m;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new ne;o=d.add(new Wi(t));const h=o.token;let u=e.value.substring(this.prefix.length);(m=this.options)!=null&&m.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(b,v)=>{var S;let w,C;if(T6(b)?(w=b.items,C=b.active):w=b,w.length===0){if(v)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(G1(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async b=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof b.mergeDelay=="number"&&(await vu(b.mergeDelay),h.isCancellationRequested)||w||(v=g(b.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await b.additionalPicks;if(h.isCancellationRequested)return;let S,L;T6(b.picks)?(S=b.picks.items,L=b.picks.active):S=b.picks;let x,E;if(T6(C)?(x=C.items,E=C.active):x=C,x.length>0||!v){let I;if(!L&&!E){const R=e.activeItems[0];R&&S.indexOf(R)!==-1&&(I=R)}g({items:[...S,...x],active:L||E||I})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(uce(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const b=await f;if(h.isCancellationRequested)return;uce(b)?await p(b):g(b)}finally{h.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case I0.NO_ACTION:break;case I0.CLOSE_PICKER:e.hide();break;case I0.REFRESH_PICKER:a();break;case I0.REMOVE_ITEM:{const m=e.items.indexOf(h);if(m!==-1){const b=e.items.slice(),v=b.splice(m,1),w=e.activeItems.filter(S=>S!==v[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=b,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return s.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),s.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),s}}new Xc(1e4);const vut=new Xc(1e4);function wut(n){return yut(n,"NFD",vut)}const Cut=/[^\u0000-\u0080]/;function yut(n,e,t){if(!n)return n;const i=t.get(n);if(i)return i;let s;return Cut.test(n)?s=n.normalize(e):s=n,t.set(n,s),s}const Sut=function(){const n=/[\u0300-\u036f]/g;return function(e){return wut(e).replace(n,"")}}();var y0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$p=function(n,e){return function(t,i){e(t,i,n)}},Cb,Yn,su;let nK=(su=class extends but{constructor(e,t,i,s,o,r){super(Cb.PREFIX,e),this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(sK)),this.options=e}async _getPicks(e,t,i,s){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=Y1(()=>{const m=new nE;m.updateDocuments(o.map(v=>({key:v.commandId,textChunks:[this.getTfIdfChunk(v)]})));const b=m.calculateScores(e,i);return _ut(b).filter(v=>v.score>Cb.TFIDF_THRESHOLD).slice(0,Cb.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const m of o){m.labelNoAccents??(m.labelNoAccents=this.normalizeForFiltering(m.label));const b=Cb.WORD_FILTER(a,m.labelNoAccents)??void 0;let v;if(m.commandAlias&&(m.aliasNoAccents??(m.aliasNoAccents=this.normalizeForFiltering(m.commandAlias)),v=Cb.WORD_FILTER(a,m.aliasNoAccents)??void 0),b||v)m.highlights={label:b,detail:this.options.showAlias?v:void 0},l.push(m);else if(e===m.commandId)l.push(m);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===m.commandId);C&&(m.tfIdfScore=C.score,l.push(m))}}const c=new Map;for(const m of l){const b=c.get(m.label);b?(m.description=m.commandId,b.description=b.commandId):c.set(m.label,m)}l.sort((m,b)=>{if(m.tfIdfScore&&b.tfIdfScore)return m.tfIdfScore===b.tfIdfScore?m.label.localeCompare(b.label):b.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const v=this.commandsHistory.peek(m.commandId),w=this.commandsHistory.peek(b.commandId);if(v&&w)return v>w?-1:1;if(v)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),x=this.options.suggestedCommandIds.has(b.commandId);if(L&&x)return 0;if(L)return-1;if(x)return 1}const C=m.commandCategory===Pq.Developer.value,S=b.commandCategory===Pq.Developer.value;return C&&!S?1:!C&&S?-1:m.label.localeCompare(b.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let m=0;m{var v;const m=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const b=m.map(w=>this.toCommandPick(w,s));return u&&((v=b[0])==null?void 0:v.type)!=="separator"&&b.unshift({type:"separator",label:_(1744,"similar commands")}),b})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?_(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){fl(r)||this.dialogService.error(_(1746,"Command '{0}' resulted in an error",e.label),nO(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}normalizeForFiltering(e){const t=Sut(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},Cb=su,su.PREFIX=">",su.TFIDF_THRESHOLD=.5,su.TFIDF_MAX_RESULTS=5,su.WORD_FILTER=gZ(jI,Dje,abe),su);nK=Cb=y0e([$p(1,Ae),$p(2,Ht),$p(3,Ei),$p(4,Ro),$p(5,SD)],nK);var Md;let sK=(Md=class extends G{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===km.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Yn.getConfiguredCommandHistoryLength(this.configurationService),Yn.cache&&Yn.cache.limit!==this.configuredCommandsHistoryLength&&(Yn.cache.limit=this.configuredCommandsHistoryLength,Yn.hasChanges=!0))}load(){const e=this.storageService.get(Yn.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=Yn.cache=new Xc(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Yn.counter=this.storageService.getNumber(Yn.PREF_KEY_COUNTER,0,Yn.counter)}push(e){Yn.cache&&(Yn.cache.set(e,Yn.counter++),Yn.hasChanges=!0)}peek(e){var t;return(t=Yn.cache)==null?void 0:t.peek(e)}saveState(){if(!Yn.cache||!Yn.hasChanges)return;const e={usesLRU:!0,entries:[]};Yn.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Yn.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Yn.PREF_KEY_COUNTER,Yn.counter,0,0),Yn.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var s,o;const i=(o=(s=e.getValue().workbench)==null?void 0:s.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:Yn.DEFAULT_COMMANDS_HISTORY_LENGTH}},Yn=Md,Md.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Md.PREF_KEY_CACHE="commandPalette.mru.cache",Md.PREF_KEY_COUNTER="commandPalette.mru.counter",Md.counter=1,Md.hasChanges=!1,Md);sK=Yn=y0e([$p(0,Qo),$p(1,lt),$p(2,ki)],sK);class xut extends nK{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const s of e.getSupportedActions()){let o;(i=s.metadata)!=null&&i.description&&(bKe(s.metadata.description)?o=s.metadata.description:o={original:s.metadata.description,value:s.metadata.description}),t.push({commandId:s.id,commandAlias:s.alias,commandDescription:o,label:wZ(s.label)||s.id})}return t}}var Lut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},AC=function(n,e){return function(t,i){e(t,i,n)}};let zN=class extends xut{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,s,o,r){super({showAlias:!1},e,i,s,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};zN=Lut([AC(0,Ae),AC(1,Ft),AC(2,Ht),AC(3,Ei),AC(4,Ro),AC(5,SD)],zN);const QF=class QF extends Ne{constructor(){super({id:QF.ID,label:bP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:H.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(Do).quickAccess.show(zN.PREFIX)}};QF.ID="editor.action.quickCommand";let h4=QF;we(h4);Ji.as(jw.Quickaccess).registerQuickAccessProvider({ctor:zN,prefix:zN.PREFIX,helpEntries:[{description:bP.quickCommandHelp,commandId:h4.ID}]});var kut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},PC=function(n,e){return function(t,i){e(t,i,n)}};let oK=class extends Lw{constructor(e,t,i,s,o,r,a){super(!0,e,t,i,s,o,r,a)}};oK=kut([PC(1,Xe),PC(2,Ft),PC(3,fn),PC(4,Ae),PC(5,Qo),PC(6,lt)],oK);At(Lw.ID,oK,4);class Eut extends Ne{constructor(){super({id:"editor.action.toggleHighContrast",label:Ez.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ml),s=i.getColorTheme();qd(s.type)?(i.setTheme(this._originalThemeName||(Ng(s.type)?Cy:Af)),this._originalThemeName=null):(i.setTheme(Ng(s.type)?Fv:Bv),this._originalThemeName=s.themeName)}}we(Eut);const S0e={},R6={};class fQ{static getOrCreate(e){return R6[e]||(R6[e]=new fQ(e)),R6[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,S0e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function Iut(n){const e=n.id;S0e[e]=n,y0.register(n);const t=fQ.getOrCreate(e);y0.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),y0.onLanguageEncountered(e,async()=>{const i=await t.load();y0.setLanguageConfiguration(e,i.conf)})}Iut({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>VJe(()=>Promise.resolve().then(()=>Gft),void 0)});const x0e="aevatar.scripting.package.v1";function gQ(n,e){const t=String(n||e).replace(/\\/g,"/").trim().replace(/^\.\/+/,"").replace(/^\/+/,"");return!t||t===".."||t.includes("../")?e:t}function fce(n,e){const t=new Map;for(const i of n||[]){const s=gQ((i==null?void 0:i.path)||e,e);t.set(s,String((i==null?void 0:i.content)||""))}return Array.from(t.entries()).sort((i,s)=>i[0].localeCompare(s[0])).map(([i,s])=>({path:i,content:s}))}function Bu(n,e=[],t="",i=""){var a;const s=fce(n,"Behavior.cs"),o=fce(e,"schema.proto"),r=s.some(l=>l.path===i)?i:((a=s[0])==null?void 0:a.path)||"";return{format:x0e,csharpSources:s,protoFiles:o,entryBehaviorTypeName:String(t||"").trim(),entrySourcePath:r}}function lM(n,e="Behavior.cs"){return Bu([{path:e,content:n}],[],"",e)}function pQ(n){const e=String(n||"");if(!e.trimStart().startsWith("{"))return lM(e);try{const i=JSON.parse(e);if((i==null?void 0:i.format)!==x0e)return lM(e);const s=Array.isArray(i.cSharpSources)?i.cSharpSources:Array.isArray(i.csharpSources)?i.csharpSources:Array.isArray(i.CsharpSources)?i.CsharpSources:[];return Bu(s.map(o=>({path:String((o==null?void 0:o.path)||(o==null?void 0:o.Path)||"Behavior.cs"),content:String((o==null?void 0:o.content)||(o==null?void 0:o.Content)||"")})),Array.isArray(i.protoFiles)?i.protoFiles.map(o=>({path:String((o==null?void 0:o.path)||"schema.proto"),content:String((o==null?void 0:o.content)||"")})):Array.isArray(i.ProtoFiles)?i.ProtoFiles.map(o=>({path:String((o==null?void 0:o.path)||(o==null?void 0:o.Path)||"schema.proto"),content:String((o==null?void 0:o.content)||(o==null?void 0:o.Content)||"")})):[],i.entryBehaviorTypeName||i.EntryBehaviorTypeName||"",i.entrySourcePath||i.EntrySourcePath||"")}catch{return lM(e)}}function Nut(n){if(!n||typeof n!="object")return null;try{return pQ(JSON.stringify(n))}catch{return null}}function KL(n){var t;const e=Bu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath);return e.protoFiles.length===0&&e.csharpSources.length===1&&!e.entryBehaviorTypeName.trim()?((t=e.csharpSources[0])==null?void 0:t.content)||"":JSON.stringify({format:e.format,cSharpSources:e.csharpSources,protoFiles:e.protoFiles,entryBehaviorTypeName:e.entryBehaviorTypeName})}function rK(n){return[...n.csharpSources.map(e=>({kind:"csharp",path:e.path,content:e.content})),...n.protoFiles.map(e=>({kind:"proto",path:e.path,content:e.content}))]}function Tl(n,e){const t=rK(n);return t.length===0?null:t.find(i=>i.path===e)||t[0]}function gce(n,e,t){const i=L0e(n,e);if(!i)return n;const s=i==="csharp"?n.csharpSources.map(o=>o.path===e?{...o,content:t}:o):n.protoFiles.map(o=>o.path===e?{...o,content:t}:o);return Bu(i==="csharp"?s:n.csharpSources,i==="proto"?s:n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath)}function Dut(n,e,t,i=""){const s=gQ(t,e==="csharp"?"Behavior.cs":"schema.proto"),o=e==="csharp"?[...n.csharpSources,{path:s,content:i}]:[...n.protoFiles,{path:s,content:i}];return Bu(e==="csharp"?o:n.csharpSources,e==="proto"?o:n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath||(e==="csharp"?s:""))}function Tut(n,e,t){const i=L0e(n,e);if(!i)return n;const s=gQ(t,e),o=i==="csharp"?n.csharpSources.map(a=>a.path===e?{...a,path:s}:a):n.csharpSources,r=i==="proto"?n.protoFiles.map(a=>a.path===e?{...a,path:s}:a):n.protoFiles;return Bu(o,r,n.entryBehaviorTypeName,n.entrySourcePath===e?s:n.entrySourcePath)}function Rut(n,e){var o;const t=n.csharpSources.filter(r=>r.path!==e),i=n.protoFiles.filter(r=>r.path!==e),s=t.some(r=>r.path===n.entrySourcePath)?n.entrySourcePath:((o=t[0])==null?void 0:o.path)||"";return Bu(t,i,n.entryBehaviorTypeName,s)}function Mut(n,e){return n.csharpSources.some(t=>t.path===e)?Bu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,e):n}function Aut(n,e){return Bu(n.csharpSources,n.protoFiles,e,n.entrySourcePath)}function L0e(n,e){return n.csharpSources.some(t=>t.path===e)?"csharp":n.protoFiles.some(t=>t.path===e)?"proto":null}function Fl(n){return n?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(n)):"-"}function k0e(n){var i,s;if(!((i=n==null?void 0:n.scopeDetail)!=null&&i.source))return!1;const e=n.scopeDetail.source.sourceText||"",t=((s=n.scopeDetail.script)==null?void 0:s.activeRevision)||n.scopeDetail.source.revision||"";return e!==KL(n.package)||t&&t!==n.revision}function Jh(n){return y.jsx("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-6 text-center",children:y.jsxs("div",{className:"max-w-[360px]",children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:n.title}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-500",children:n.copy})]})})}function M6(n){return y.jsxs("button",{type:"button",onClick:n.onClick,className:`execution-run-card ${n.active?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:n.title}),y.jsx("div",{className:"mt-1 text-[11px] text-gray-400",children:n.meta})]}),n.status?y.jsx("span",{className:"rounded-full border border-[#E5DED3] bg-[#F7F2E8] px-2.5 py-1 text-[10px] uppercase tracking-[0.14em] text-[#8E6A3D]",children:n.status}):null]}),y.jsx("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:n.summary})]})}function Pf(n){const[e,t]=$.useState(n.defaultOpen??!0);return y.jsxs("section",{className:"rounded-[24px] border border-[#E6E3DE] bg-[#FAF8F4]",children:[y.jsxs("div",{className:"flex items-start justify-between gap-3 px-4 py-4",children:[y.jsxs("div",{className:"min-w-0",children:[n.eyebrow?y.jsx("div",{className:"panel-eyebrow",children:n.eyebrow}):null,y.jsx("div",{className:`text-[14px] font-semibold text-gray-800 ${n.eyebrow?"mt-1":""}`,children:n.title})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[n.actions,y.jsx("button",{type:"button",onClick:()=>t(i=>!i),className:"panel-icon-button shrink-0","aria-expanded":e,title:e?"Collapse section":"Expand section",children:y.jsx(LL,{size:14,className:`transition-transform ${e?"":"-rotate-90"}`})})]})]}),e?y.jsx("div",{className:n.bodyClassName||"border-t border-[#EEEAE4] px-4 pb-4",children:n.children}):null]})}function A6(n){return n.open?y.jsx("div",{className:"modal-overlay",onClick:n.onClose,children:y.jsxs("div",{className:"modal-shell",style:n.width?{width:n.width}:void 0,onClick:e=>e.stopPropagation(),children:[y.jsxs("div",{className:"modal-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:n.eyebrow}),y.jsx("div",{className:"panel-title !mt-0",children:n.title})]}),y.jsx("button",{type:"button",onClick:n.onClose,title:"Close dialog.",className:"panel-icon-button",children:y.jsx(nv,{size:16})})]}),y.jsx("div",{className:"modal-body",children:n.children}),y.jsx("div",{className:"modal-footer",children:n.actions})]})}):null}function Put(n){var t;const{selectedDraft:e}=n;return e?y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Inspector"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:"Draft metadata"})]}),y.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto p-4",children:[y.jsx(Pf,{eyebrow:"Identity",title:"Draft identity",defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"grid gap-3 pt-4",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Script ID"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.scriptId||"-"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Draft Revision"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.revision||"-"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Base Revision"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.baseRevision||"-"})]})]})}),y.jsx(Pf,{eyebrow:"Actors",title:"Binding and runtime ids",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["definitionActorId: ",e.definitionActorId||"-"]}),y.jsxs("div",{children:["runtimeActorId: ",e.runtimeActorId||"-"]}),y.jsxs("div",{children:["lastSourceHash: ",e.lastSourceHash||"-"]}),y.jsxs("div",{children:["updatedAt: ",Fl(e.updatedAtUtc)]})]})}),y.jsx(Pf,{eyebrow:"Contract",title:"Current app contract",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-3 pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Storage"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.scopeBacked?`Scope-backed · ${n.appContext.scopeId}`:"Local-only draft"})]}),y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Input Type"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.appContext.scriptContract.inputType})]}),y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Read Model Fields"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.appContext.scriptContract.readModelFields.join(", ")})]})]})}),y.jsx(Pf,{eyebrow:"Package",title:"Draft package",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["selectedFile: ",e.selectedFilePath||"-"]}),y.jsxs("div",{children:["entrySourcePath: ",e.package.entrySourcePath||"-"]}),y.jsxs("div",{children:["entryBehaviorTypeName: ",e.package.entryBehaviorTypeName||"-"]}),y.jsxs("div",{children:["csharpFiles: ",e.package.csharpSources.length]}),y.jsxs("div",{children:["protoFiles: ",e.package.protoFiles.length]})]})}),y.jsx(Pf,{eyebrow:"Scope Snapshot",title:"Saved scope state",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:(t=e.scopeDetail)!=null&&t.script?y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",e.scopeDetail.script.scriptId]}),y.jsxs("div",{children:["revision: ",e.scopeDetail.script.activeRevision]}),y.jsxs("div",{children:["catalogActorId: ",e.scopeDetail.script.catalogActorId||"-"]}),y.jsxs("div",{children:["updatedAt: ",Fl(e.scopeDetail.script.updatedAt)]})]}):y.jsx("div",{className:"pt-4 text-[12px] leading-6 text-gray-500",children:"This draft has not been saved into the current scope yet."})})]})]}):null}function Out(n){return n.collapsed?y.jsxs("div",{className:"flex h-full min-h-0 flex-col border-r border-[#EEEAE4] bg-[#FAF8F4]",children:[y.jsx("div",{className:"border-b border-[#EEEAE4] px-2 py-3",children:y.jsx("button",{type:"button",onClick:n.onToggleCollapsed,title:"Expand files",className:"panel-icon-button h-9 w-9 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(Y2e,{size:14})})}),y.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-2 py-3",children:n.entries.length===0?y.jsx("div",{className:"flex justify-center",children:y.jsx("div",{className:"rounded-[14px] border border-dashed border-[#E5DED3] bg-white/80 p-2 text-gray-400",children:y.jsx(Wf,{size:14})})}):n.entries.map(e=>{const t=n.selectedFilePath===e.path,i=e.kind==="csharp"&&n.entrySourcePath===e.path;return y.jsxs("button",{type:"button",onClick:()=>n.onSelectFile(e.path),title:e.path,className:`relative flex w-full items-center justify-center rounded-[14px] border px-2 py-2.5 transition-colors ${t?"border-[color:var(--accent-border)] bg-[#FFF4F1]":"border-[#EEEAE4] bg-white hover:bg-[#FFF9F4]"}`,children:[e.kind==="csharp"?y.jsx(wte,{size:14}):y.jsx(Wf,{size:14}),i?y.jsx("span",{className:"absolute right-1 top-1 rounded-full bg-[#FFF7E6] p-0.5 text-[#9B6A1C]",children:y.jsx(xte,{size:9,fill:"currentColor"})}):null]},`${e.kind}:${e.path}`)})})]}):y.jsxs("div",{className:"flex h-full min-h-0 flex-col border-r border-[#EEEAE4] bg-[#FAF8F4]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Package"}),y.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Files"}),y.jsxs("div",{className:"flex items-center gap-2",children:[n.onToggleCollapsed?y.jsx("button",{type:"button",onClick:n.onToggleCollapsed,title:"Collapse files",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(UM,{size:14})}):null,y.jsx("button",{type:"button",onClick:()=>n.onAddFile("csharp"),title:"Add C# file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(Sp,{size:14})}),y.jsx("button",{type:"button",onClick:()=>n.onAddFile("proto"),title:"Add proto file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(Wf,{size:14})})]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-3 py-3",children:n.entries.length===0?y.jsx("div",{className:"rounded-[18px] border border-dashed border-[#E5DED3] bg-white/70 px-4 py-4 text-[12px] leading-6 text-gray-500",children:"Add a C# or proto file to turn this draft into a script package."}):n.entries.map(e=>{const t=n.selectedFilePath===e.path,i=e.kind==="csharp"&&n.entrySourcePath===e.path;return y.jsxs("div",{className:`rounded-[18px] border px-3 py-3 transition-colors ${t?"border-[color:var(--accent-border)] bg-[#FFF4F1]":"border-[#EEEAE4] bg-white hover:bg-[#FFF9F4]"}`,children:[y.jsxs("button",{type:"button",onClick:()=>n.onSelectFile(e.path),className:"flex w-full items-start gap-3 text-left",children:[y.jsx("div",{className:`mt-0.5 rounded-[10px] p-2 ${e.kind==="csharp"?"bg-[#F7EDE4] text-[#9B4D19]":"bg-[#EEF3FF] text-[#315A84]"}`,children:e.kind==="csharp"?y.jsx(wte,{size:14}):y.jsx(Wf,{size:14})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"truncate text-[13px] font-medium text-gray-800",children:e.path}),y.jsx("div",{className:"mt-1 text-[11px] uppercase tracking-[0.14em] text-gray-400",children:e.kind==="csharp"?"C# source":"Proto schema"})]})]}),y.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[11px] text-gray-400",children:i?"Entry source":" "}),y.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="csharp"?y.jsx("button",{type:"button",onClick:()=>n.onSetEntry(e.path),title:"Use as entry source",className:`panel-icon-button h-8 w-8 rounded-[12px] border ${i?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#E8E4DD] bg-white text-gray-500"}`,children:y.jsx(xte,{size:14})}):null,y.jsx("button",{type:"button",onClick:()=>n.onRenameFile(e.path),title:"Rename file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-500",children:y.jsx(sRe,{size:14})}),y.jsx("button",{type:"button",onClick:()=>n.onRemoveFile(e.path),title:"Remove file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#F0D7D0] bg-white text-[#B15647]",children:y.jsx(gp,{size:14})})]})]})]},`${e.kind}:${e.path}`)})})]})}function Fut(n){return y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Scripts Studio"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:"Resource rail"}),y.jsxs("div",{className:"mt-3 search-field !min-h-[40px] !rounded-[18px] !border-[#E8E1D8] !bg-white",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search drafts or saved scripts",value:n.search,onChange:e=>n.onSearchChange(e.target.value)})]})]}),y.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto p-4",children:[y.jsx(Pf,{eyebrow:"Drafts",title:`${n.drafts.length} local draft${n.drafts.length===1?"":"s"}`,defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:y.jsx("button",{type:"button",onClick:n.onCreateDraft,className:"panel-icon-button",title:"New draft",children:y.jsx(Sp,{size:14})}),children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.filteredDrafts.length===0?y.jsx(Jh,{title:"No drafts matched",copy:"Try a different search, or create a new draft."}):n.filteredDrafts.map(e=>{var i,s;const t=k0e(e);return y.jsxs("button",{type:"button",onClick:()=>n.onSelectDraft(e.key),className:`execution-run-card ${e.key===((i=n.selectedDraft)==null?void 0:i.key)?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.revision})]}),y.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(s=e.scopeDetail)!=null&&s.script?y.jsx("span",{className:"rounded-full border border-[#DCE8C8] bg-[#F5FBEE] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#5C7A2D]",children:"scope"}):null,t?y.jsx("span",{className:"rounded-full border border-[#E9D6AE] bg-[#FFF7E6] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#9B6A1C]",children:"dirty"}):null]})]}),y.jsx("div",{className:"mt-2 text-[11px] text-gray-400",children:Fl(e.updatedAtUtc)})]},e.key)})})}),y.jsx(Pf,{eyebrow:"Saved in Scope",title:n.scopeBacked?n.scopeId||"-":"Unavailable",defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:n.scopeBacked?y.jsx("button",{type:"button",onClick:n.onRefreshScopeScripts,className:"panel-icon-button",title:"Refresh saved scripts",disabled:n.scopeScriptsPending,children:y.jsx(rk,{size:14,className:n.scopeScriptsPending?"animate-spin":""})}):void 0,children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.scopeBacked?n.filteredScopeScripts.length===0?y.jsx(Jh,{title:n.scopeScriptsPending?"Loading scope scripts":"No saved scripts matched",copy:n.scopeScriptsPending?"Pulling the scope catalog now.":"Try a different search or save the active draft."}):n.filteredScopeScripts.map(e=>{const t=e.script;return t?y.jsxs("button",{type:"button",onClick:()=>n.onOpenScopeScript(e),className:`execution-run-card ${n.scopeSelectionId===t.scriptId?"active":""}`,children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:t.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:t.activeRevision}),y.jsx("div",{className:"mt-2 text-[11px] text-gray-400",children:Fl(t.updatedAt)})]},`${e.scopeId}:${t.scriptId}`):null}):y.jsx(Jh,{title:"Scope save unavailable",copy:"This session is not bound to a resolved scope, so only local drafts are available."})})}),y.jsx(Pf,{eyebrow:"Runtimes",title:`${n.runtimeSnapshots.length} recent snapshot${n.runtimeSnapshots.length===1?"":"s"}`,defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:y.jsx("button",{type:"button",onClick:n.onRefreshRuntimeSnapshots,className:"panel-icon-button",title:"Refresh runtime snapshots",disabled:n.runtimeSnapshotsPending,children:y.jsx(rk,{size:14,className:n.runtimeSnapshotsPending?"animate-spin":""})}),children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.runtimeSnapshots.length===0?y.jsx(Jh,{title:n.runtimeSnapshotsPending?"Loading runtimes":"No runtime snapshots yet",copy:n.runtimeSnapshotsPending?"Pulling recent script runtimes now.":"Run a draft to materialize recent runtime state."}):n.runtimeSnapshots.map(e=>y.jsxs("button",{type:"button",onClick:()=>n.onSelectRuntime(e.actorId),className:`execution-run-card ${n.selectedRuntimeActorId===e.actorId?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.revision})]}),y.jsxs("span",{className:"rounded-full border border-[#E5DED3] bg-[#F7F2E8] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#8E6A3D]",children:["v",e.stateVersion]})]}),y.jsx("div",{className:"mt-2 truncate text-[11px] text-gray-400",children:Fl(e.updatedAt)})]},e.actorId))})}),y.jsx(Pf,{eyebrow:"Proposals",title:`${n.proposalDecisions.length} terminal decision${n.proposalDecisions.length===1?"":"s"}`,defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.proposalDecisions.length===0?y.jsx(Jh,{title:n.proposalDecisionsPending?"Loading proposals":"No proposal decisions yet",copy:n.proposalDecisionsPending?"Resolving terminal proposal decisions now.":"Promotion decisions will appear here after the scope catalog points at them."}):n.proposalDecisions.map(e=>{const t=n.scopeCatalogsByScriptId[e.scriptId];return y.jsxs("button",{type:"button",onClick:()=>n.onSelectProposal(e.proposalId),className:`execution-run-card ${n.selectedProposalId===e.proposalId?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.candidateRevision||e.baseRevision||"-"})]}),y.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] ${e.accepted?"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]":"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]"}`,children:e.status||(e.accepted?"accepted":"rejected")})]}),y.jsx("div",{className:"mt-2 truncate text-[11px] text-gray-400",children:t!=null&&t.updatedAt?Fl(t.updatedAt):e.proposalId})]},e.proposalId)})})})]})]})}const E0e="aevatar:scripts-studio:v4",But=`using System; +`)};const r=await o.provideRenameEdits(this.model,this.position,e,s);if(r){if(r.rejectReason)return this._provideRenameEdits(e,t+1,i.concat(r.rejectReason),s)}else return this._provideRenameEdits(e,t+1,i.concat(_(1380,"No result.")),s);return r}}async function Ndt(n,e,t,i){const s=new nQ(e,t,n),o=await s.resolveRenameLocation(wt.None);return o!=null&&o.rejectReason?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(i,wt.None)}var N1;let u_=(N1=class{static get(e){return e.getContribution(Dq.ID)}constructor(e,t,i,s,o,r,a,l){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=s,this._progressService=o,this._logService=r,this._configService=a,this._languageFeaturesService=l,this._disposableStore=new ne,this._cts=new Bi,this._renameWidget=this._disposableStore.add(this._instaService.createInstance(Nq,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}async run(){var g,p;const e=this._logService.trace.bind(this._logService,"[rename]");if(this._cts.dispose(!0),this._cts=new Bi,!this.editor.hasModel()){e("editor has no model");return}const t=this.editor.getPosition(),i=new nQ(this.editor.getModel(),t,this._languageFeaturesService.renameProvider);if(!i.hasProvider()){e("skeleton has no provider");return}const s=new Mg(this.editor,5,void 0,this._cts.token);let o;try{e("resolving rename location");const m=i.resolveRenameLocation(s.token);this._progressService.showWhile(m,250),o=await m,e("resolved rename location")}catch(m){m instanceof Ql?e("resolve rename location cancelled",JSON.stringify(m,null," ")):(e("resolve rename location failed",m instanceof Error?m:JSON.stringify(m,null," ")),(typeof m=="string"||cg(m))&&((g=ba.get(this.editor))==null||g.showMessage(m||_(1381,"An unknown error occurred while resolving rename location"),t)));return}finally{s.dispose()}if(!o){e("returning early - no loc");return}if(o.rejectReason){e(`returning early - rejected with reason: ${o.rejectReason}`,o.rejectReason),(p=ba.get(this.editor))==null||p.showMessage(o.rejectReason,t);return}if(s.token.isCancellationRequested){e("returning early - cts1 cancelled");return}const r=new Mg(this.editor,5,o.range,this._cts.token),a=this.editor.getModel(),l=this._languageFeaturesService.newSymbolNamesProvider.all(a),c=await Promise.all(l.map(async m=>[m,await m.supportsAutomaticNewSymbolNamesTriggerKind??!1])),d=(m,b)=>{let v=c.slice();return m===sE.Automatic&&(v=v.filter(([w,C])=>C)),v.map(([w])=>w.provideNewSymbolNames(a,o.range,m,b))};e("creating rename input field and awaiting its result");const h=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),u=await this._renameWidget.getInput(o.range,o.text,h,l.length>0?d:void 0,r);if(e("received response from rename input field"),typeof u=="boolean"){e(`returning early - rename input field response - ${u}`),u&&this.editor.focus(),r.dispose();return}this.editor.focus(),e("requesting rename edits");const f=rS(i.provideRenameEdits(u.newName,r.token),r.token).then(async m=>{if(!m){e("returning early - no rename edits result");return}if(!this.editor.hasModel()){e("returning early - no model after rename edits are provided");return}if(m.rejectReason){e(`returning early - rejected with reason: ${m.rejectReason}`),this._notificationService.info(m.rejectReason);return}this.editor.setSelection(D.fromPositions(this.editor.getSelection().getPosition())),e("applying edits"),this._bulkEditService.apply(m,{editor:this.editor,showPreview:u.wantsPreview,label:_(1382,"Renaming '{0}' to '{1}'",o==null?void 0:o.text,u.newName),code:"undoredo.rename",quotableLabel:_(1383,"Renaming {0} to {1}",o==null?void 0:o.text,u.newName),respectAutoSaveConfig:!0,reason:vo.rename()}).then(b=>{e("edits applied"),b.ariaSummary&&vr(_(1384,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,u.newName,b.ariaSummary))}).catch(b=>{e(`error when applying edits ${JSON.stringify(b,null," ")}`),this._notificationService.error(_(1385,"Rename failed to apply edits")),this._logService.error(b)})},m=>{e("error when providing rename edits",JSON.stringify(m,null," ")),this._notificationService.error(_(1386,"Rename failed to compute edits")),this._logService.error(m)}).finally(()=>{r.dispose()});return e("returning rename operation"),this._progressService.showWhile(f,250),f}acceptRenameInput(e){this._renameWidget.acceptInput(e)}cancelRenameInput(){this._renameWidget.cancelInput(!0,"cancelRenameInput command")}focusNextRenameSuggestion(){this._renameWidget.focusNextRenameSuggestion()}focusPreviousRenameSuggestion(){this._renameWidget.focusPreviousRenameSuggestion()}},Dq=N1,N1.ID="editor.contrib.renameController",N1);u_=Dq=Edt([ib(1,Ae),ib(2,fn),ib(3,ED),ib(4,Tg),ib(5,Li),ib(6,s3),ib(7,De)],u_);class Ddt extends Ne{constructor(){super({id:"editor.action.rename",label:ie(1388,"Rename Symbol"),precondition:le.and(H.writable,H.hasRenameProvider),kbOpts:{kbExpr:H.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1},canTriggerInlineEdits:!0})}runCommand(e,t){const i=e.get(Bt),[s,o]=Array.isArray(t)&&t||[void 0,void 0];return He.isUri(s)&&U.isIPosition(o)?i.openCodeEditor({resource:s},i.getActiveCodeEditor()).then(r=>{r&&(r.setPosition(o),r.invokeWithinContext(a=>(this.reportTelemetry(a,r),this.run(a,r))))},Je):super.runCommand(e,t)}run(e,t){const i=e.get(Li),s=u_.get(t);return s?(i.trace("[RenameAction] got controller, running..."),s.run()):(i.trace("[RenameAction] returning early - controller missing"),Promise.resolve())}}At(u_.ID,u_,4);we(Ddt);const sQ=hs.bindToContribution(u_.get);ye(new sQ({id:"acceptRenameInput",precondition:mx,handler:n=>n.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:le.and(H.focus,le.not("isComposing")),primary:3}}));ye(new sQ({id:"acceptRenameInputWithPreview",precondition:le.and(mx,le.has("config.editor.rename.enablePreview")),handler:n=>n.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:le.and(H.focus,le.not("isComposing")),primary:2051}}));ye(new sQ({id:"cancelRenameInput",precondition:mx,handler:n=>n.cancelRenameInput(),kbOpts:{weight:199,kbExpr:H.focus,primary:9,secondary:[1033]}}));ni(class extends Ps{constructor(){super({id:"focusNextRenameSuggestion",title:{...ie(1389,"Focus Next Rename Suggestion")},precondition:mx,keybinding:[{primary:18,weight:199}]})}run(e){const t=e.get(Bt).getFocusedCodeEditor();if(!t)return;const i=u_.get(t);i&&i.focusNextRenameSuggestion()}});ni(class extends Ps{constructor(){super({id:"focusPreviousRenameSuggestion",title:{...ie(1390,"Focus Previous Rename Suggestion")},precondition:mx,keybinding:[{primary:16,weight:199}]})}run(e){const t=e.get(Bt).getFocusedCodeEditor();if(!t)return;const i=u_.get(t);i&&i.focusPreviousRenameSuggestion()}});Xr("_executeDocumentRenameProvider",function(n,e,t,...i){const[s]=i;Ft(typeof s=="string");const{renameProvider:o}=n.get(De);return Ndt(o,e,t,s)});Xr("_executePrepareRename",async function(n,e,t){const{renameProvider:i}=n.get(De),o=await new nQ(e,t,i).resolveRenameLocation(wt.None);if(o!=null&&o.rejectReason)throw new Error(o.rejectReason);return o});Ji.as(ch.Configuration).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:6,description:_(1387,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});var Tdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qle=function(n,e){return function(t,i){e(t,i,n)}},Py;let i4=(Py=class extends G{constructor(e,t,i){super(),this.editor=e,this.languageConfigurationService=t,this.editorWorkerService=i,this.decorations=this.editor.createDecorationsCollection(),this.options=this.createOptions(e.getOption(81)),this.computePromise=null,this.currentOccurrences={},this._register(e.onDidChangeModel(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(e.onDidChangeModelLanguage(s=>{this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0)})),this._register(t.onDidChange(s=>{var r;const o=(r=this.editor.getModel())==null?void 0:r.getLanguageId();o&&s.affects(o)&&(this.currentOccurrences={},this.options=this.createOptions(e.getOption(81)),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(e.onDidChangeConfiguration(s=>{this.options&&!s.hasChanged(81)||(this.options=this.createOptions(e.getOption(81)),this.updateDecorations([]),this.stop(),this.computeSectionHeaders.schedule(0))})),this._register(this.editor.onDidChangeModelContent(s=>{this.computeSectionHeaders.schedule()})),this._register(e.onDidChangeModelTokens(s=>{this.computeSectionHeaders.isScheduled()||this.computeSectionHeaders.schedule(1e3)})),this.computeSectionHeaders=this._register(new ai(()=>{this.findSectionHeaders()},250)),this.computeSectionHeaders.schedule(0)}createOptions(e){if(!e||!this.editor.hasModel())return;const t=this.editor.getModel().getLanguageId();if(!t)return;const i=this.languageConfigurationService.getLanguageConfiguration(t).comments,s=this.languageConfigurationService.getLanguageConfiguration(t).foldingRules;if(!(!i&&!(s!=null&&s.markers)))return{foldingRules:s,markSectionHeaderRegex:e.markSectionHeaderRegex,findMarkSectionHeaders:e.showMarkSectionHeaders,findRegionSectionHeaders:e.showRegionSectionHeaders}}findSectionHeaders(){var i,s;if(!this.editor.hasModel()||!((i=this.options)!=null&&i.findMarkSectionHeaders)&&!((s=this.options)!=null&&s.findRegionSectionHeaders))return;const e=this.editor.getModel();if(e.isDisposed()||e.isTooLargeForSyncing())return;const t=e.getVersionId();this.editorWorkerService.findSectionHeaders(e.uri,this.options).then(o=>{e.isDisposed()||e.getVersionId()!==t||this.updateDecorations(o)})}updateDecorations(e){const t=this.editor.getModel();t&&(e=e.filter(o=>{if(!o.shouldBeInComments)return!0;const r=t.validateRange(o.range),a=t.tokenization.getLineTokens(r.startLineNumber),l=a.findTokenIndexAtOffset(r.startColumn-1),c=a.getStandardTokenType(l);return a.getLanguageId(l)===t.getLanguageId()&&c===1}));const i=Object.values(this.currentOccurrences).map(o=>o.decorationId),s=e.map(o=>Rdt(o));this.editor.changeDecorations(o=>{const r=o.deltaDecorations(i,s);this.currentOccurrences={};for(let a=0,l=r.length;a0?t[0]:[]}async function XCe(n,e,t,i,s){const o=Fdt(n,e),r=await Promise.all(o.map(async a=>{let l,c=null;try{l=await a.provideDocumentSemanticTokens(e,a===t?i:null,s)}catch(d){c=d,l=null}return(!l||!l8(l)&&!YCe(l))&&(l=null),new Odt(a,l,c)}));for(const a of r){if(a.error)throw a.error;if(a.tokens)return a}return r.length>0?r[0]:null}function Bdt(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:null}class Wdt{constructor(e,t){this.provider=e,this.tokens=t}}function Hdt(n,e){return n.has(e)}function QCe(n,e){const t=n.orderedGroups(e);return t.length>0?t[0]:[]}async function oQ(n,e,t,i){const s=QCe(n,e),o=await Promise.all(s.map(async r=>{let a;try{a=await r.provideDocumentRangeSemanticTokens(e,t,i)}catch(l){On(l),a=null}return(!a||!l8(a))&&(a=null),new Wdt(r,a)}));for(const r of o)if(r.tokens)return r;return o.length>0?o[0]:null}Rt.registerCommand("_provideDocumentSemanticTokensLegend",async(n,...e)=>{const[t]=e;Ft(t instanceof He);const i=n.get(Ui).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(De),o=Bdt(s,i);return o?o[0].getLegend():n.get(ki).executeCommand("_provideDocumentRangeSemanticTokensLegend",t)});Rt.registerCommand("_provideDocumentSemanticTokens",async(n,...e)=>{const[t]=e;Ft(t instanceof He);const i=n.get(Ui).getModel(t);if(!i)return;const{documentSemanticTokensProvider:s}=n.get(De);if(!ZCe(s,i))return n.get(ki).executeCommand("_provideDocumentRangeSemanticTokens",t,i.getFullModelRange());const o=await XCe(s,i,null,null,wt.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!l8(a))return;const l=GCe({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l});Rt.registerCommand("_provideDocumentRangeSemanticTokensLegend",async(n,...e)=>{const[t,i]=e;Ft(t instanceof He);const s=n.get(Ui).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(De),r=QCe(o,s);if(r.length===0)return;if(r.length===1)return r[0].getLegend();if(!i||!D.isIRange(i))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=await oQ(o,s,D.lift(i),wt.None);if(a)return a.provider.getLegend()});Rt.registerCommand("_provideDocumentRangeSemanticTokens",async(n,...e)=>{const[t,i]=e;Ft(t instanceof He),Ft(D.isIRange(i));const s=n.get(Ui).getModel(t);if(!s)return;const{documentRangeSemanticTokensProvider:o}=n.get(De),r=await oQ(o,s,D.lift(i),wt.None);if(!(!r||!r.tokens))return GCe({id:0,type:"full",data:r.tokens.data})});const rQ="editor.semanticHighlighting";function aM(n,e,t){var s;const i=(s=t.getValue(rQ,{overrideIdentifier:n.getLanguageId(),resource:n.uri}))==null?void 0:s.enabled;return typeof i=="boolean"?i:e.getColorTheme().semanticHighlighting}var JCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gh=function(n,e){return function(t,i){e(t,i,n)}},wp;let Tq=class extends G{constructor(e,t,i,s,o,r){super(),this._watchers=new En;const a=d=>{var h;(h=this._watchers.get(d.uri))==null||h.dispose(),this._watchers.set(d.uri,new Rq(d,e,i,o,r))},l=(d,h)=>{h.dispose(),this._watchers.delete(d.uri)},c=()=>{for(const d of t.getModels()){const h=this._watchers.get(d.uri);aM(d,i,s)?h||a(d):h&&l(d,h)}};t.getModels().forEach(d=>{aM(d,i,s)&&a(d)}),this._register(t.onModelAdded(d=>{aM(d,i,s)&&a(d)})),this._register(t.onModelRemoved(d=>{const h=this._watchers.get(d.uri);h&&l(d,h)})),this._register(s.onDidChangeConfiguration(d=>{d.affectsConfiguration(rQ)&&c()})),this._register(i.onDidColorThemeChange(c))}dispose(){ei(this._watchers.values()),this._watchers.clear(),super.dispose()}};Tq=JCe([Gh(0,x3),Gh(1,Ui),Gh(2,en),Gh(3,lt),Gh(4,hc),Gh(5,De)],Tq);var Km;let Rq=(Km=class extends G{constructor(e,t,i,s,o){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=o.documentSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentSemanticTokens",{min:wp.REQUEST_MIN_DELAY,max:wp.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new ai(()=>this._fetchDocumentSemanticTokensNow(),wp.REQUEST_MIN_DELAY)),this._currentDocumentResponse=null,this._currentDocumentRequestCancellationTokenSource=null,this._documentProvidersChangeListeners=[],this._providersChangedDuringRequest=!1,this._register(this._model.onDidChangeContent(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeAttached(()=>{this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(this._model.onDidChangeLanguage(()=>{this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(0)}));const r=()=>{ei(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const a of this._provider.all(e))typeof a.onDidChange=="function"&&this._documentProvidersChangeListeners.push(a.onDidChange(()=>{if(this._currentDocumentRequestCancellationTokenSource){this._providersChangedDuringRequest=!0;return}this._fetchDocumentSemanticTokens.schedule(0)}))};r(),this._register(this._provider.onDidChange(()=>{r(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._register(i.onDidColorThemeChange(a=>{this._setDocumentSemanticTokens(null,null,null,[]),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))})),this._fetchDocumentSemanticTokens.schedule(0)}dispose(){this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._currentDocumentRequestCancellationTokenSource&&(this._currentDocumentRequestCancellationTokenSource.cancel(),this._currentDocumentRequestCancellationTokenSource=null),ei(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!ZCe(this._provider,this._model)){this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1);return}if(!this._model.isAttachedToEditor())return;const e=new Bi,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,s=XCe(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const o=[],r=this._model.onDidChangeContent(l=>{o.push(l)}),a=new Ls(!1);s.then(l=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),!l)this._setDocumentSemanticTokens(null,null,null,o);else{const{provider:c,tokens:d}=l,h=this._semanticTokensStylingService.getStyling(c);this._setDocumentSemanticTokens(c,d||null,h,o)}},l=>{l&&(fl(l)||typeof l.message=="string"&&l.message.indexOf("busy")!==-1)||Je(l),this._currentDocumentRequestCancellationTokenSource=null,r.dispose(),(o.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))})}static _copy(e,t,i,s,o){o=Math.min(o,i.length-s,e.length-t);for(let r=0;r{(s.length>0||this._providersChangedDuringRequest)&&!this._fetchDocumentSemanticTokens.isScheduled()&&this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))};if(this._currentDocumentResponse&&(this._currentDocumentResponse.dispose(),this._currentDocumentResponse=null),this._isDisposed){e&&t&&e.releaseDocumentSemanticTokens(t.resultId);return}if(!e||!i){this._model.tokenization.setSemanticTokens(null,!1);return}if(!t){this._model.tokenization.setSemanticTokens(null,!0),r();return}if(YCe(t)){if(!o){this._model.tokenization.setSemanticTokens(null,!0);return}if(t.edits.length===0)t={resultId:t.resultId,data:o.data};else{let a=0;for(const u of t.edits)a+=(u.data?u.data.length:0)-u.deleteCount;const l=o.data,c=new Uint32Array(l.length+a);let d=l.length,h=c.length;for(let u=t.edits.length-1;u>=0;u--){const f=t.edits[u];if(f.start>l.length){i.warnInvalidEditStart(o.resultId,t.resultId,u,f.start,l.length),this._model.tokenization.setSemanticTokens(null,!0);return}const g=d-(f.start+f.deleteCount);g>0&&(wp._copy(l,d-g,c,h-g,g),h-=g),f.data&&(wp._copy(f.data,0,c,h-f.data.length,f.data.length),h-=f.data.length),d=f.start}d>0&&wp._copy(l,0,c,0,d),t={resultId:t.resultId,data:c}}}if(l8(t)){this._currentDocumentResponse=new Vdt(e,t.resultId,t.data);const a=G_e(t,i,this._model.getLanguageId());if(s.length>0)for(const l of s)for(const c of a)for(const d of l.changes)c.applyEdit(d.range,d.text);this._model.tokenization.setSemanticTokens(a,!0)}else this._model.tokenization.setSemanticTokens(null,!0);r()}},wp=Km,Km.REQUEST_MIN_DELAY=300,Km.REQUEST_MAX_DELAY=2e3,Km);Rq=wp=JCe([Gh(1,x3),Gh(2,en),Gh(3,hc),Gh(4,De)],Rq);class Vdt{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}hx(Tq);var zdt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bL=function(n,e){return function(t,i){e(t,i,n)}},Oy;let n4=(Oy=class extends G{constructor(e,t,i,s,o,r){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=s,this._editor=e,this._provider=r.documentRangeSemanticTokensProvider,this._debounceInformation=o.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new ai(()=>this._tokenizeViewportNow(),100)),this._outstandingRequests=[],this._rangeProvidersChangeListeners=[];const a=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))},l=()=>{var c;if(this._cleanupProviderListeners(),this._editor.hasModel()){const d=this._editor.getModel();for(const h of this._provider.all(d)){const u=(c=h.onDidChange)==null?void 0:c.call(h,()=>{this._cancelAll(),a()});u&&this._rangeProvidersChangeListeners.push(u)}}};this._register(this._editor.onDidScrollChange(()=>{a()})),this._register(this._editor.onDidChangeModel(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelLanguage(()=>{l(),this._cancelAll(),a()})),this._register(this._editor.onDidChangeModelContent(c=>{this._cancelAll(),a()})),l(),this._register(this._provider.onDidChange(()=>{l(),this._cancelAll(),a()})),this._register(this._configurationService.onDidChangeConfiguration(c=>{c.affectsConfiguration(rQ)&&(this._cancelAll(),a())})),this._register(this._themeService.onDidColorThemeChange(()=>{this._cancelAll(),a()})),a()}dispose(){this._cleanupProviderListeners(),super.dispose()}_cleanupProviderListeners(){ei(this._rangeProvidersChangeListeners),this._rangeProvidersChangeListeners=[]}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,i)))}_requestRange(e,t){const i=e.getVersionId(),s=rs(r=>Promise.resolve(oQ(this._provider,e,t,r))),o=new Ls(!1);return s.then(r=>{if(this._debounceInformation.update(e,o.elapsed()),!r||!r.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:a,tokens:l}=r,c=this._semanticTokensStylingService.getStyling(a);e.tokenization.setPartialSemanticTokens(t,G_e(l,c,e.getLanguageId()))}).then(()=>this._removeOutstandingRequest(s),()=>this._removeOutstandingRequest(s)),s}},Oy.ID="editor.contrib.viewportSemanticTokens",Oy);n4=zdt([bL(1,x3),bL(2,en),bL(3,lt),bL(4,hc),bL(5,De)],n4);At(n4.ID,n4,1);class jdt{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const s of t){const o=[];i.push(o),this.selectSubwords&&this._addInWordRanges(o,e,s),this._addWordRanges(o,e,s),this._addWhitespaceLine(o,e,s),o.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const s=t.getWordAtPosition(i);if(!s)return;const{word:o,startColumn:r}=s,a=i.column-r;let l=a,c=a,d=0;for(;l>=0;l--){const h=o.charCodeAt(l);if(l!==a&&(h===95||h===45))break;if(Kp(h)&&Uh(d))break;d=h}for(l+=1;c0&&t.getLineFirstNonWhitespaceColumn(i.lineNumber)===0&&t.getLineLastNonWhitespaceColumn(i.lineNumber)===0&&e.push({range:new D(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var $dt=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Udt=function(n,e){return function(t,i){e(t,i,n)}},Mq;class aQ{constructor(e,t){this.index=e,this.ranges=t}mov(e){const t=this.index+(e?1:-1);if(t<0||t>=this.ranges.length)return this;const i=new aQ(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}var D1;let ON=(D1=class{static get(e){return e.getContribution(Mq.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;(e=this._selectionListener)==null||e.dispose()}async run(e){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||await t0e(this._languageFeaturesService.selectionRangeProvider,i,t.map(o=>o.getPosition()),this._editor.getOption(129),wt.None).then(o=>{var r;if(!(!Yo(o)||o.length!==t.length)&&!(!this._editor.hasModel()||!Fi(this._editor.getSelections(),t,(a,l)=>a.equalsSelection(l)))){for(let a=0;al.containsPosition(t[a].getStartPosition())&&l.containsPosition(t[a].getEndPosition())),o[a].unshift(t[a]);this._state=o.map(a=>new aQ(0,a)),(r=this._selectionListener)==null||r.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition(()=>{var a;this._ignoreSelection||((a=this._selectionListener)==null||a.dispose(),this._state=void 0)})}}),!this._state)return;this._state=this._state.map(o=>o.mov(e));const s=this._state.map(o=>Ie.fromPositions(o.ranges[o.index].getStartPosition(),o.ranges[o.index].getEndPosition()));this._ignoreSelection=!0;try{this._editor.setSelections(s)}finally{this._ignoreSelection=!1}}},Mq=D1,D1.ID="editor.contrib.smartSelectController",D1);ON=Mq=$dt([Udt(1,De)],ON);class e0e extends Ne{constructor(e,t){super(t),this._forward=e}async run(e,t){const i=ON.get(t);i&&await i.run(this._forward)}}class qdt extends e0e{constructor(){super(!0,{id:"editor.action.smartSelect.expand",label:ie(1400,"Expand Selection"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1553,mac:{primary:3345,secondary:[1297]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:_(1398,"&&Expand Selection"),order:2}})}}Rt.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");class Kdt extends e0e{constructor(){super(!1,{id:"editor.action.smartSelect.shrink",label:ie(1401,"Shrink Selection"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:1551,mac:{primary:3343,secondary:[1295]},weight:100},menuOpts:{menuId:Te.MenubarSelectionMenu,group:"1_basic",title:_(1399,"&&Shrink Selection"),order:3}})}}At(ON.ID,ON,4);we(qdt);we(Kdt);async function t0e(n,e,t,i,s){const o=n.all(e).concat(new jdt(i.selectSubwords));o.length===1&&o.unshift(new VO);const r=[],a=[];for(const l of o)r.push(Promise.resolve(l.provideSelectionRanges(e,t,s)).then(c=>{if(Yo(c)&&c.length===t.length)for(let d=0;d{if(l.length===0)return[];l.sort((u,f)=>U.isBefore(u.getStartPosition(),f.getStartPosition())?1:U.isBefore(f.getStartPosition(),u.getStartPosition())||U.isBefore(u.getEndPosition(),f.getEndPosition())?-1:U.isBefore(f.getEndPosition(),u.getEndPosition())?1:0);const c=[];let d;for(const u of l)(!d||D.containsRange(u,d)&&!D.equalsRange(u,d))&&(c.push(u),d=u);if(!i.selectLeadingAndTrailingWhitespace)return c;const h=[c[0]];for(let u=1;uU.isIPosition(r)));const s=n.get(De).selectionRangeProvider,o=await n.get(Qo).createModelReference(t);try{return t0e(s,o.object.textEditorModel,i.map(U.lift),{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},wt.None)}finally{o.dispose()}});const Aq=Object.freeze({View:ie(1638,"View"),Help:ie(1639,"Help"),Test:ie(1640,"Test"),File:ie(1641,"File"),Preferences:ie(1642,"Preferences"),Developer:ie(1643,"Developer")});class Gdt extends Jc{constructor(){super({id:"editor.action.toggleStickyScroll",title:{...ie(1448,"Toggle Editor Sticky Scroll"),mnemonicTitle:_(1444,"&&Toggle Editor Sticky Scroll")},metadata:{description:ie(1449,"Toggle/enable the editor sticky scroll which shows the nested scopes at the top of the viewport")},category:Aq.View,toggled:{condition:le.equals("config.editor.stickyScroll.enabled",!0),title:_(1445,"Sticky Scroll"),mnemonicTitle:_(1446,"&&Sticky Scroll")},menu:[{id:Te.CommandPalette},{id:Te.MenubarAppearanceMenu,group:"4_editor",order:3},{id:Te.StickyScrollContext}]})}async runEditorCommand(e,t){var r;const i=e.get(lt),s=!i.getValue("editor.stickyScroll.enabled"),o=(r=Xc.get(t))==null?void 0:r.isFocused();i.updateValue("editor.stickyScroll.enabled",s),o&&t.focus()}}const c8=100;class Ydt extends Jc{constructor(){super({id:"editor.action.focusStickyScroll",title:{...ie(1450,"Focus Editor Sticky Scroll"),mnemonicTitle:_(1447,"&&Focus Editor Sticky Scroll")},precondition:le.and(le.has("config.editor.stickyScroll.enabled"),H.stickyScrollVisible),menu:[{id:Te.CommandPalette}]})}runEditorCommand(e,t){var i;(i=Xc.get(t))==null||i.focus()}}class Zdt extends Jc{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:ie(1451,"Select the next editor sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:18}})}runEditorCommand(e,t){var i;(i=Xc.get(t))==null||i.focusNext()}}class Xdt extends Jc{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:ie(1452,"Select the previous sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:16}})}runEditorCommand(e,t){var i;(i=Xc.get(t))==null||i.focusPrevious()}}class Qdt extends Jc{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:ie(1453,"Go to the focused sticky scroll line"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:3}})}runEditorCommand(e,t){var i;(i=Xc.get(t))==null||i.goToFocused()}}class Jdt extends Jc{constructor(){super({id:"editor.action.selectEditor",title:ie(1454,"Select Editor"),precondition:H.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:c8,primary:9}})}runEditorCommand(e,t){var i;(i=Xc.get(t))==null||i.selectEditor()}}At(Xc.ID,Xc,1);ni(Gdt);ni(Ydt);ni(Xdt);ni(Zdt);ni(Qdt);ni(Jdt);var i0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},UL=function(n,e){return function(t,i){e(t,i,n)}};class eht{constructor(e,t,i,s,o,r,a){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=s,this.command=o,this.gutterMenuLinkAction=r,this.completion=a}}let Pq=class extends KMe{constructor(e,t,i,s,o,r){super(o.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=s,this._suggestMemoryService=r}canBeReused(e,t,i){return this.model===e&&this.line===t&&this.word.word.length>0&&this.word.startColumn===i.startColumn&&this.word.endColumn=0&&a.resolve(wt.None)}return e}};Pq=i0e([UL(5,o8)],Pq);let Oq=class extends G{constructor(e,t,i,s){super(),this._languageFeatureService=e,this._clipboardService=t,this._suggestMemoryService=i,this._editorService=s,this._store.add(e.inlineCompletionsProvider.register("*",this))}async provideInlineCompletions(e,t,i,s){var f;if(i.selectedSuggestionInfo)return;let o;for(const g of this._editorService.listCodeEditors())if(g.getModel()===e){o=g;break}if(!o)return;const r=o.getOption(102);if(S0.isAllOff(r))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const a=e.tokenization.getLineTokens(t.lineNumber),l=a.getStandardTokenType(a.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if(S0.valueFor(r,l)!=="inline")return;let c=e.getWordAtPosition(t),d;if(c!=null&&c.word||(d=this._getTriggerCharacterInfo(e,t)),!(c!=null&&c.word)&&!d||(c||(c=e.getWordUntilPosition(t)),c.endColumn!==t.column))return;let h;const u=e.getValueInRange(new D(t.lineNumber,1,t.lineNumber,t.column));if(!d&&((f=this._lastResult)!=null&&f.canBeReused(e,t.lineNumber,c))){const g=new Sle(u,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=g,this._lastResult.acquire(),h=this._lastResult}else{const g=await UX(this._languageFeatureService.completionProvider,e,t,new xN(void 0,jO.createSuggestFilter(o).itemKind,d==null?void 0:d.providers),d&&{triggerKind:1,triggerCharacter:d.ch},s);let p;g.needsClipboard&&(p=await this._clipboardService.readText());const m=new zp(g.items,t.column,new Sle(u,0),zO.None,o.getOption(134),o.getOption(128),{boostFullMatch:!1,firstMatchCanBeWeak:!1},p);h=new Pq(e,t.lineNumber,c,m,g,this._suggestMemoryService)}return this._lastResult=h,h}handleItemDidShow(e,t){t.completion.resolve(wt.None)}disposeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var o;const i=e.getValueInRange(D.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const r of this._languageFeatureService.completionProvider.all(e))(o=r.triggerCharacters)!=null&&o.includes(i)&&s.add(r);if(s.size!==0)return{providers:s,ch:i}}};Oq=i0e([UL(0,De),UL(1,La),UL(2,o8),UL(3,Bt)],Oq);hx(Oq);class tht extends Ne{constructor(){super({id:"editor.action.forceRetokenize",label:ie(1532,"Developer: Force Retokenize"),precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const s=new Ls;i.tokenization.forceTokenization(i.getLineCount()),s.stop(),console.log(`tokenization took ${s.elapsed()}`)}}we(tht);const jF=class jF extends Ps{constructor(){super({id:jF.ID,title:ie(1530,"Toggle Tab Key Moves Focus"),precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},metadata:{description:ie(1531,"Determines whether the tab key moves focus around the workbench or inserts the tab character in the current editor. This is also called tab trapping, tab navigation, or tab focus mode.")},f1:!0})}run(){const t=!gS.getTabFocusMode();gS.setTabFocusMode(t),vr(t?_(1528,"Pressing Tab will now move focus to the next focusable element"):_(1529,"Pressing Tab will now insert the tab character"))}};jF.ID="editor.action.toggleTabFocusMode";let Fq=jF;ni(Fq);var iht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jle=function(n,e){return function(t,i){e(t,i,n)}};let Bq=class extends G{get enabled(){return this._enabled}set enabled(e){e?(this.el.setAttribute("aria-disabled","false"),this.el.tabIndex=0,this.el.style.pointerEvents="auto",this.el.style.opacity="1",this.el.style.cursor="pointer",this._enabled=!1):(this.el.setAttribute("aria-disabled","true"),this.el.tabIndex=-1,this.el.style.pointerEvents="none",this.el.style.opacity="0.4",this.el.style.cursor="default",this._enabled=!0),this._enabled=e}constructor(e,t,i={},s,o){super(),this._link=t,this._hoverService=s,this._enabled=!0,this.el=he(e,me("a.monaco-link",{tabIndex:t.tabIndex??0,href:t.href},t.label)),this.hoverDelegate=i.hoverDelegate??Pu("mouse"),this.setTooltip(t.title),this.el.setAttribute("role","button");const r=this._register(new ti(this.el,"click")),a=this._register(new ti(this.el,"keypress")),l=ve.chain(a.event,h=>h.map(u=>new ui(u)).filter(u=>u.keyCode===3)),c=this._register(new ti(this.el,xi.Tap)).event;this._register(Eo.addTarget(this.el));const d=ve.any(r.event,l,c);this._register(d(h=>{this.enabled&&(Ht.stop(h,!0),i!=null&&i.opener?i.opener(this._link.href):o.open(this._link.href,{allowCommands:!0}))})),this.enabled=!0}setTooltip(e){!this.hover&&e?this.hover=this._register(this._hoverService.setupManagedHover(this.hoverDelegate,this.el,e)):this.hover&&this.hover.update(e)}};Bq=iht([Jle(3,Sr),Jle(4,jg)],Bq);var n0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Wq=function(n,e){return function(t,i){e(t,i,n)}};const nht=26;let Hq=class extends G{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(Vq))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show({...e,onClose:()=>{var t;this.hide(),(t=e.onClose)==null||t.call(e)}}),this._editor.setBanner(this.banner.element,nht)}};Hq=n0e([Wq(1,Ae)],Hq);let Vq=class extends G{constructor(e,t){super(),this.instantiationService=e,this.markdownRendererService=t,this.element=me("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){if(e.ariaLabel)return e.ariaLabel;if(typeof e.message=="string")return e.message}getBannerMessage(e){if(typeof e=="string"){const t=me("span");return t.innerText=e,t}return this.markdownRendererService.render(e).element}clear(){js(this.element)}show(e){js(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=he(this.element,me("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(me(`div${$e.asCSSSelector(e.icon)}`));const s=he(this.element,me("div.message-container"));if(s.setAttribute("aria-hidden","true"),s.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=he(this.element,me("div.message-actions-container")),e.actions)for(const r of e.actions)this._register(this.instantiationService.createInstance(Bq,this.messageActionsContainer,{...r,tabIndex:-1},{}));const o=he(this.element,me("div.action-container"));this.actionBar=this._register(new jr(o)),this.actionBar.push(this._register(new ol("banner.close",_(1533,"Close Banner"),$e.asClassName(Yve),!0,()=>{typeof e.onClose=="function"&&e.onClose()})),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};Vq=n0e([Wq(0,Ae),Wq(1,ed)],Vq);var lQ=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iI=function(n,e){return function(t,i){e(t,i,n)}};const sht=Ri("extensions-warning-message",de.warning,_(1534,"Icon shown with a warning message in the extensions editor."));var Fy;let FN=(Fy=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=o=>{if(o&&o.hasMore){if(this._bannerClosed)return;const r=Math.max(o.ambiguousCharacterCount,o.nonBasicAsciiCharacterCount,o.invisibleCharacterCount);let a;if(o.nonBasicAsciiCharacterCount>=r)a={message:_(1535,"This document contains many non-basic ASCII unicode characters"),command:new WN};else if(o.ambiguousCharacterCount>=r)a={message:_(1536,"This document contains many ambiguous unicode characters"),command:new kw};else if(o.invisibleCharacterCount>=r)a={message:_(1537,"This document contains many invisible unicode characters"),command:new BN};else throw new Error("Unreachable");this._bannerController.show({id:"unicodeHighlightBanner",message:a.message,icon:sht,actions:[{label:a.command.shortLabel,href:`command:${a.command.desc.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(s.createInstance(Hq,e)),this._register(this._editor.onDidChangeModel(()=>{this._bannerClosed=!1,this._updateHighlighter()})),this._options=e.getOption(142),this._register(i.onDidChangeTrust(o=>{this._updateHighlighter()})),this._register(e.onDidChangeConfiguration(o=>{o.hasChanged(142)&&(this._options=e.getOption(142),this._updateHighlighter())})),this._updateHighlighter()}dispose(){this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),super.dispose()}_updateHighlighter(){if(this._updateState(null),this._highlighter&&(this._highlighter.dispose(),this._highlighter=null),!this._editor.hasModel())return;const e=oht(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every(i=>i===!1))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map(i=>i.codePointAt(0)),allowedLocales:Object.keys(e.allowedLocales).map(i=>i==="_os"?Aw.NumberFormat().value.resolvedOptions().locale:i==="_vscode"?VMe:i)};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new zq(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new rht(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}},Fy.ID="editor.contrib.unicodeHighlighter",Fy);FN=lQ([iI(1,Qr),iI(2,Ube),iI(3,Ae)],FN);function oht(n,e){return{nonBasicASCII:e.nonBasicASCII===Va?!n:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments===Va?!n:e.includeComments,includeStrings:e.includeStrings===Va?!n:e.includeStrings,allowedCharacters:e.allowedCharacters,allowedLocales:e.allowedLocales}}let zq=class extends G{constructor(e,t,i,s){super(),this._editor=e,this._options=t,this._updateState=i,this._editorWorkerService=s,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ai(()=>this._update(),250)),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then(t=>{if(this._model.isDisposed()||this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const s of t.ranges)i.push({range:s,options:s4.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)})}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!zY(t,e))return null;const i=t.getValueInRange(e.range);return{reason:o0e(i,this._options),inComment:jY(t,e),inString:$Y(t,e)}}};zq=lQ([iI(3,Qr)],zq);class rht extends G{constructor(e,t,i){super(),this._editor=e,this._options=t,this._updateState=i,this._model=this._editor.getModel(),this._decorations=this._editor.createDecorationsCollection(),this._updateSoon=this._register(new ai(()=>this._update(),250)),this._register(this._editor.onDidLayoutChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidScrollChange(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeHiddenAreas(()=>{this._updateSoon.schedule()})),this._register(this._editor.onDidChangeModelContent(()=>{this._updateSoon.schedule()})),this._updateSoon.schedule()}dispose(){this._decorations.clear(),super.dispose()}_update(){if(this._model.isDisposed())return;if(!this._model.mightContainNonBasicASCII()){this._decorations.clear();return}const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const s of e){const o=rY.computeUnicodeHighlights(this._model,this._options,s);for(const r of o.ranges)i.ranges.push(r);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||o.hasMore}if(!i.hasMore)for(const s of i.ranges)t.push({range:s,options:s4.instance.getDecorationFromOptions(this._options)});this._updateState(i),this._decorations.set(t)}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel(),i=t.getValueInRange(e.range);return zY(t,e)?{reason:o0e(i,this._options),inComment:jY(t,e),inString:$Y(t,e)}:null}}const s0e=_(1538,"Configure Unicode Highlight Options");let jq=class{constructor(e,t){this._editor=e,this._markdownRendererService=t,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=this._editor.getContribution(FN.ID);if(!s)return[];const o=[],r=new Set;let a=300;for(const l of t){const c=s.getDecorationInfo(l);if(!c)continue;const h=i.getValueInRange(l.range).codePointAt(0),u=L6(h);let f;switch(c.reason.kind){case 0:{aD(c.reason.confusableWith)?f=_(1539,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",u,L6(c.reason.confusableWith.codePointAt(0))):f=_(1540,"The character {0} could be confused with the character {1}, which is more common in source code.",u,L6(c.reason.confusableWith.codePointAt(0)));break}case 1:f=_(1541,"The character {0} is invisible.",u);break;case 2:f=_(1542,"The character {0} is not a basic ASCII character.",u);break}if(r.has(f))continue;r.add(f);const g={codePoint:h,reason:c.reason,inComment:c.inComment,inString:c.inString},p=_(1543,"Adjust settings"),m=gbe(o4.ID,g),b=new Co("",!0).appendMarkdown(f).appendText(" ").appendLink(m,p,s0e);o.push(new Bc(this,l.range,[b],!1,a++))}return o}renderHoverParts(e,t){return Sit(e,t,this._editor,this._markdownRendererService)}getAccessibleContent(e){return e.contents.map(t=>t.value).join(` +`)}};jq=lQ([iI(1,ed)],jq);function $q(n){return`U+${n.toString(16).padStart(4,"0")}`}function L6(n){let e=`\`${$q(n)}\``;return xv.isInvisibleCharacter(n)||(e+=` "${`${aht(n)}`}"`),e}function aht(n){return n===96?"`` ` ``":"`"+String.fromCodePoint(n)+"`"}function o0e(n,e){return rY.computeUnicodeHighlightReason(n,e)}const $F=class $F{constructor(){this.map=new Map}getDecorationFromOptions(e){return this.getDecoration(!e.includeComments,!e.includeStrings)}getDecoration(e,t){const i=`${e}${t}`;let s=this.map.get(i);return s||(s=st.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,s)),s}};$F.instance=new $F;let s4=$F;class lht extends Ne{constructor(){super({id:kw.ID,label:ie(1552,"Disable highlighting of characters in comments"),precondition:void 0}),this.shortLabel=_(1544,"Disable Highlight In Comments")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Fr.includeComments,!1,2)}}class cht extends Ne{constructor(){super({id:kw.ID,label:ie(1553,"Disable highlighting of characters in strings"),precondition:void 0}),this.shortLabel=_(1545,"Disable Highlight In Strings")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Fr.includeStrings,!1,2)}}const UF=class UF extends Ps{constructor(){super({id:UF.ID,title:ie(1554,"Disable highlighting of ambiguous characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1546,"Disable Ambiguous Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Fr.ambiguousCharacters,!1,2)}};UF.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";let kw=UF;const qF=class qF extends Ps{constructor(){super({id:qF.ID,title:ie(1555,"Disable highlighting of invisible characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1547,"Disable Invisible Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Fr.invisibleCharacters,!1,2)}};qF.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";let BN=qF;const KF=class KF extends Ps{constructor(){super({id:KF.ID,title:ie(1556,"Disable highlighting of non basic ASCII characters"),precondition:void 0,f1:!1}),this.shortLabel=_(1548,"Disable Non ASCII Highlight")}async run(e,t,i){const s=e.get(lt);s&&this.runAction(s)}async runAction(e){await e.updateValue(Fr.nonBasicASCII,!1,2)}};KF.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";let WN=KF;const GF=class GF extends Ps{constructor(){super({id:GF.ID,title:ie(1557,"Show Exclude Options"),precondition:void 0,f1:!1})}async run(e,t){const{codePoint:i,reason:s,inString:o,inComment:r}=t,a=String.fromCodePoint(i),l=e.get(No),c=e.get(lt);function d(g){return xv.isInvisibleCharacter(g)?_(1549,"Exclude {0} (invisible character) from being highlighted",$q(g)):_(1550,"Exclude {0} from being highlighted",`${$q(g)} "${a}"`)}const h=[];if(s.kind===0)for(const g of s.notAmbiguousInLocales)h.push({label:_(1551,'Allow unicode characters that are more common in the language "{0}".',g),run:async()=>{hht(c,[g])}});if(h.push({label:d(i),run:()=>dht(c,[i])}),r){const g=new lht;h.push({label:g.label,run:async()=>g.runAction(c)})}else if(o){const g=new cht;h.push({label:g.label,run:async()=>g.runAction(c)})}function u(g){return typeof g.desc.title=="string"?g.desc.title:g.desc.title.value}if(s.kind===0){const g=new kw;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(s.kind===1){const g=new BN;h.push({label:u(g),run:async()=>g.runAction(c)})}else if(s.kind===2){const g=new WN;h.push({label:u(g),run:async()=>g.runAction(c)})}else uht(s);const f=await l.pick(h,{title:s0e});f&&await f.run()}};GF.ID="editor.action.unicodeHighlight.showExcludeOptions";let o4=GF;async function dht(n,e){const t=n.getValue(Fr.allowedCharacters);let i;typeof t=="object"&&t?i=t:i={};for(const s of e)i[String.fromCodePoint(s)]=!0;await n.updateValue(Fr.allowedCharacters,i,2)}async function hht(n,e){var s;const t=(s=n.inspect(Fr.allowedLocales).user)==null?void 0:s.value;let i;typeof t=="object"&&t?i=Object.assign({},t):i={};for(const o of e)i[o]=!0;await n.updateValue(Fr.allowedLocales,i,2)}function uht(n){throw new Error(`Unexpected value: ${n}`)}ni(kw);ni(BN);ni(WN);ni(o4);At(FN.ID,FN,1);Uw.register(jq);var fht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ece=function(n,e){return function(t,i){e(t,i,n)}};const r0e="ignoreUnusualLineTerminators";function ght(n,e,t){n.setModelProperty(e.uri,r0e,t)}function pht(n,e){return n.getModelProperty(e.uri,r0e)}var By;let r4=(By=class extends G{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(143),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(143)&&(this._config=this._editor.getOption(143),this._checkForUnusualLineTerminators())})),this._register(this._editor.onDidChangeModel(()=>{this._checkForUnusualLineTerminators()})),this._register(this._editor.onDidChangeModelContent(s=>{s.isUndoing||this._checkForUnusualLineTerminators()})),this._checkForUnusualLineTerminators()}async _checkForUnusualLineTerminators(){if(this._config==="off"||!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators()||pht(this._codeEditorService,e)===!0||this._editor.getOption(104))return;if(this._config==="auto"){e.removeUnusualLineTerminators(this._editor.getSelections());return}if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=await this._dialogService.confirm({title:_(1558,"Unusual Line Terminators"),message:_(1559,"Detected unusual line terminators"),detail:_(1560,"The file '{0}' contains one or more unusual line terminator characters, like Line Separator (LS) or Paragraph Separator (PS).\n\nIt is recommended to remove them from the file. This can be configured via `editor.unusualLineTerminators`.",ic(e.uri)),primaryButton:_(1561,"&&Remove Unusual Line Terminators"),cancelButton:_(1562,"Ignore")})}finally{this._isPresentingDialog=!1}if(!i.confirmed){ght(this._codeEditorService,e,!0);return}e.removeUnusualLineTerminators(this._editor.getSelections())}},By.ID="editor.contrib.unusualLineTerminatorsDetector",By);r4=fht([ece(1,SD),ece(2,Bt)],r4);At(r4.ID,r4,1);var mht=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_ht=function(n,e){return function(t,i){e(t,i,n)}};class tce{constructor(){this.selector={language:"*"}}provideDocumentHighlights(e,t,i){const s=[],o=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});return o?e.isDisposed()?void 0:e.findMatches(o.word,!0,!1,!0,iA,!1).map(a=>({range:a.range,kind:sS.Text})):Promise.resolve(s)}provideMultiDocumentHighlights(e,t,i,s){const o=new En,r=e.getWordAtPosition({lineNumber:t.lineNumber,column:t.column});if(!r)return Promise.resolve(o);for(const a of[e,...i]){if(a.isDisposed())continue;const c=a.findMatches(r.word,!0,!1,!0,iA,!1).map(d=>({range:d.range,kind:sS.Text}));c&&o.set(a.uri,c)}return o}}let Uq=class extends G{constructor(e){super(),this._register(e.documentHighlightProvider.register("*",new tce)),this._register(e.multiDocumentHighlightProvider.register("*",new tce))}};Uq=mht([_ht(0,De)],Uq);var a0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yh=function(n,e){return function(t,i){e(t,i,n)}},sn,qq;const cQ=new Se("hasWordHighlights",!1);function l0e(n,e,t,i){const s=n.ordered(e);return VG(s.map(o=>()=>Promise.resolve(o.provideDocumentHighlights(e,t,i)).then(void 0,On)),o=>o!=null).then(o=>{if(o){const r=new En;return r.set(e.uri,o),r}return new En})}function bht(n,e,t,i,s){const o=n.ordered(e);return VG(o.map(r=>()=>{const a=s.filter(l=>Ppe(l)).filter(l=>hZ(r.selector,l.uri,l.getLanguageId(),!0,void 0,void 0)>0);return Promise.resolve(r.provideMultiDocumentHighlights(e,t,a,i)).then(void 0,On)}),r=>r!=null)}class c0e{constructor(e,t,i){this._model=e,this._selection=t,this._wordSeparators=i,this._wordRange=this._getCurrentWordRange(e,t),this._result=null}get result(){return this._result||(this._result=rs(e=>this._compute(this._model,this._selection,this._wordSeparators,e))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new D(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}cancel(){this.result.cancel()}}class vht extends c0e{constructor(e,t,i,s){super(e,t,i),this._providers=s}_compute(e,t,i,s){return l0e(this._providers,e,t.getPosition(),s).then(o=>o||new En)}}class wht extends c0e{constructor(e,t,i,s,o){super(e,t,i),this._providers=s,this._otherModels=o}_compute(e,t,i,s){return bht(this._providers,e,t.getPosition(),s,this._otherModels).then(o=>o||new En)}}function Cht(n,e,t,i){return new vht(e,t,i,n)}function yht(n,e,t,i,s){return new wht(e,t,i,n,s)}Xr("_executeDocumentHighlights",async(n,e,t)=>{const i=n.get(De),s=await l0e(i.documentHighlightProvider,e,t,wt.None);return s==null?void 0:s.get(e.uri)});var Gm;let Kq=(Gm=class{constructor(e,t,i,s,o,r,a,l){this.toUnhook=new ne,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=new En,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,this.runDelayer=this.toUnhook.add(new ec(50)),this.editor=e,this.providers=t,this.multiDocumentProviders=i,this.codeEditorService=r,this.textModelService=o,this.configurationService=a,this.logService=l,this._hasWordHighlights=cQ.bindTo(s),this._ignorePositionChangeEvent=!1,this.occurrencesHighlightEnablement=this.editor.getOption(90),this.occurrencesHighlightDelay=this.configurationService.getValue("editor.occurrencesHighlightDelay"),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition(c=>{this._ignorePositionChangeEvent||this.occurrencesHighlightEnablement!=="off"&&this.runDelayer.trigger(()=>{this._onPositionChanged(c)})})),this.toUnhook.add(e.onDidFocusEditorText(c=>{this.occurrencesHighlightEnablement!=="off"&&(this.workerRequest||this.runDelayer.trigger(()=>{this._run()}))})),this.toUnhook.add(e.onDidChangeModelContent(c=>{O5(this.model.uri,"output")||this._stopAll()})),this.toUnhook.add(e.onDidChangeModel(c=>{!c.newModelUrl&&c.oldModelUrl?this._stopSingular():sn.query&&this._run()})),this.toUnhook.add(e.onDidChangeConfiguration(c=>{var h,u;const d=this.editor.getOption(90);if(this.occurrencesHighlightEnablement!==d)switch(this.occurrencesHighlightEnablement=d,d){case"off":this._stopAll();break;case"singleFile":this._stopAll((u=(h=sn.query)==null?void 0:h.modelInfo)==null?void 0:u.modelURI);break;case"multiFile":sn.query&&this._run(!0);break;default:console.warn("Unknown occurrencesHighlight setting value:",d);break}})),this.toUnhook.add(this.configurationService.onDidChangeConfiguration(c=>{if(c.affectsConfiguration("editor.occurrencesHighlightDelay")){const d=a.getValue("editor.occurrencesHighlightDelay");this.occurrencesHighlightDelay!==d&&(this.occurrencesHighlightDelay=d)}})),this.toUnhook.add(e.onDidBlurEditorWidget(()=>{var d,h;const c=this.codeEditorService.getFocusedCodeEditor();c?((d=c.getModel())==null?void 0:d.uri.scheme)===Ge.vscodeNotebookCell&&((h=this.editor.getModel())==null?void 0:h.uri.scheme)!==Ge.vscodeNotebookCell&&this._stopAll():this._stopAll()})),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=void 0,sn.query&&this._run()}hasDecorations(){return this.decorations.length>0}restore(e){this.occurrencesHighlightEnablement!=="off"&&(this.runDelayer.cancel(),this.runDelayer.trigger(()=>{this._run(!1,e)}))}stop(){this.occurrencesHighlightEnablement!=="off"&&this._stopAll()}_getSortedHighlights(){return this.decorations.getRanges().sort(D.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))+1)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);vr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),i=(e.findIndex(o=>o.containsPosition(this.editor.getPosition()))-1+e.length)%e.length,s=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(s.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(s);const o=this._getWord();if(o){const r=this.editor.getModel().getLineContent(s.startLineNumber);vr(`${r}, ${i+1} of ${e.length} for '${o.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeSingleDecorations(){if(!this.editor.hasModel())return;const e=sn.storedDecorationIDs.get(this.editor.getModel().uri);e&&(this.editor.removeDecorations(e),sn.storedDecorationIDs.delete(this.editor.getModel().uri),this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1)))}_removeAllDecorations(e){const t=this.codeEditorService.listCodeEditors(),i=[];for(const s of t){if(!s.hasModel()||t_(s.getModel().uri,e))continue;const o=sn.storedDecorationIDs.get(s.getModel().uri);if(!o)continue;s.removeDecorations(o),i.push(s.getModel().uri);const r=f_.get(s);r!=null&&r.wordHighlighter&&r.wordHighlighter.decorations.length>0&&(r.wordHighlighter.decorations.clear(),r.wordHighlighter.workerRequest=null,r.wordHighlighter._hasWordHighlights.set(!1))}for(const s of i)sn.storedDecorationIDs.delete(s)}_stopSingular(){var e,t,i,s;this._removeSingleDecorations(),this.editor.hasTextFocus()&&(((e=this.editor.getModel())==null?void 0:e.uri.scheme)!==Ge.vscodeNotebookCell&&((i=(t=sn.query)==null?void 0:t.modelInfo)==null?void 0:i.modelURI.scheme)!==Ge.vscodeNotebookCell?(sn.query=null,this._run()):(s=sn.query)!=null&&s.modelInfo&&(sn.query.modelInfo=null)),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_stopAll(e){this._removeAllDecorations(e),this.renderDecorationsTimer!==void 0&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=void 0),this.workerRequest!==null&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){if(this.occurrencesHighlightEnablement==="off"){this._stopAll();return}if(e.source!=="api"&&e.reason!==3){this._stopAll();return}this._run()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.isDisposed()?null:this.model.getWordAtPosition({lineNumber:t,column:i})}getOtherModelsToHighlight(e){if(!e)return[];if(e.uri.scheme===Ge.vscodeNotebookCell){const o=[],r=this.codeEditorService.listCodeEditors();for(const a of r){const l=a.getModel();l&&l!==e&&l.uri.scheme===Ge.vscodeNotebookCell&&o.push(l)}return o}const i=[],s=this.codeEditorService.listCodeEditors();for(const o of s){if(!hX(o))continue;const r=o.getModel();r&&e===r.modified&&i.push(r.modified)}if(i.length)return i;if(this.occurrencesHighlightEnablement==="singleFile")return[];for(const o of s){const r=o.getModel();r&&r!==e&&i.push(r)}return i}async _run(e,t){var s,o,r;if(this.editor.hasTextFocus()){const a=this.editor.getSelection();if(!a||a.startLineNumber!==a.endLineNumber){sn.query=null,this._stopAll();return}const l=a.startColumn,c=a.endColumn,d=this._getWord();if(!d||d.startColumn>l||d.endColumn{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=d||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Je)}catch(d){this.logService.error("Unexpected error during occurrence request. Log: ",d)}finally{c.dispose()}}else if(this.model.uri.scheme===Ge.vscodeNotebookCell){const a=++this.workerRequestTokenId;if(this.workerRequestCompleted=!1,!sn.query||!sn.query.modelInfo)return;const l=await this.textModelService.createModelReference(sn.query.modelInfo.modelURI);try{this.workerRequest=this.computeWithModel(l.object.textEditorModel,sn.query.modelInfo.selection,[this.model]),(r=this.workerRequest)==null||r.result.then(c=>{a===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=c||[],this._beginRenderDecorations(t??this.occurrencesHighlightDelay))},Je)}catch(c){this.logService.error("Unexpected error during occurrence request. Log: ",c)}finally{l.dispose()}}}computeWithModel(e,t,i){return i.length?yht(this.multiDocumentProviders,e,t,this.editor.getOption(148),i):Cht(this.providers,e,t,this.editor.getOption(148))}_beginRenderDecorations(e){const t=new Date().getTime(),i=this.lastCursorPositionChangeTime+e;t>=i?(this.renderDecorationsTimer=void 0,this.renderDecorations()):this.renderDecorationsTimer=setTimeout(()=>{this.renderDecorations()},i-t)}renderDecorations(){var t,i,s;this.renderDecorationsTimer=void 0;const e=this.codeEditorService.listCodeEditors();for(const o of e){const r=f_.get(o);if(!r)continue;const a=[],l=(t=o.getModel())==null?void 0:t.uri;if(l&&this.workerRequestValue.has(l)){const c=sn.storedDecorationIDs.get(l),d=this.workerRequestValue.get(l);if(d)for(const u of d)u.range&&a.push({range:u.range,options:Xct(u.kind)});let h=[];o.changeDecorations(u=>{h=u.deltaDecorations(c??[],a)}),sn.storedDecorationIDs=sn.storedDecorationIDs.set(l,h),a.length>0&&((i=r.wordHighlighter)==null||i.decorations.set(a),(s=r.wordHighlighter)==null||s._hasWordHighlights.set(!0))}}this.workerRequest=null}dispose(){this._stopSingular(),this.toUnhook.dispose()}},sn=Gm,Gm.storedDecorationIDs=new En,Gm.query=null,Gm);Kq=sn=a0e([Yh(4,Qo),Yh(5,Bt),Yh(6,lt),Yh(7,Li)],Kq);var T1;let f_=(T1=class extends G{static get(e){return e.getContribution(qq.ID)}constructor(e,t,i,s,o,r,a){super(),this._wordHighlighter=null;const l=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&e.getModel().uri.scheme!==Ge.accessibleView&&(this._wordHighlighter=new Kq(e,i.documentHighlightProvider,i.multiDocumentHighlightProvider,t,o,s,r,a))};this._register(e.onDidChangeModel(c=>{var d,h;this._wordHighlighter&&(!c.newModelUrl&&((d=c.oldModelUrl)==null?void 0:d.scheme)!==Ge.vscodeNotebookCell&&((h=this.wordHighlighter)==null||h.stop()),this._wordHighlighter.dispose(),this._wordHighlighter=null),l()})),l()}get wordHighlighter(){return this._wordHighlighter}saveViewState(){return!!(this._wordHighlighter&&this._wordHighlighter.hasDecorations())}moveNext(){var e;(e=this._wordHighlighter)==null||e.moveNext()}moveBack(){var e;(e=this._wordHighlighter)==null||e.moveBack()}restoreViewState(e){this._wordHighlighter&&e&&this._wordHighlighter.restore(250)}dispose(){this._wordHighlighter&&(this._wordHighlighter.dispose(),this._wordHighlighter=null),super.dispose()}},qq=T1,T1.ID="editor.contrib.wordHighlighter",T1);f_=qq=a0e([Yh(1,Xe),Yh(2,De),Yh(3,Bt),Yh(4,Qo),Yh(5,lt),Yh(6,Li)],f_);class d0e extends Ne{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=f_.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}class Sht extends d0e{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:ie(1572,"Go to Next Symbol Highlight"),precondition:cQ,kbOpts:{kbExpr:H.editorTextFocus,primary:65,weight:100}})}}class xht extends d0e{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:ie(1573,"Go to Previous Symbol Highlight"),precondition:cQ,kbOpts:{kbExpr:H.editorTextFocus,primary:1089,weight:100}})}}class Lht extends Ne{constructor(){super({id:"editor.action.wordHighlight.trigger",label:ie(1574,"Trigger Symbol Highlight"),precondition:void 0,kbOpts:{kbExpr:H.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const s=f_.get(t);s&&s.restoreViewState(!0)}}At(f_.ID,f_,0);we(Sht);we(xht);we(Lht);hx(Uq);class d8 extends hs{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const s=nc(t.getOption(148),t.getOption(147)),o=t.getModel(),r=t.getSelections(),a=r.length>1,l=r.map(c=>{const d=new U(c.positionLineNumber,c.positionColumn),h=this._move(s,o,d,this._wordNavigationType,a);return this._moveTo(c,h,this._inSelectionMode)});if(o.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,l.map(c=>Wt.fromModelSelection(c))),l.length===1){const c=new U(l[0].positionLineNumber,l[0].positionColumn);t.revealPosition(c,0)}}_moveTo(e,t,i){return i?new Ie(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ie(t.lineNumber,t.column,t.lineNumber,t.column)}}class L_ extends d8{_move(e,t,i,s,o){return Xt.moveWordLeft(e,t,i,s,o)}}class k_ extends d8{_move(e,t,i,s,o){return Xt.moveWordRight(e,t,i,s)}}class kht extends L_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}class Iht extends L_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}class Eht extends L_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ex,P3))==null?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}class Nht extends L_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}class Dht extends L_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}class Tht extends L_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ex,P3))==null?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}class Rht extends L_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,s,o){return super._move(nc(jo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class Mht extends L_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,s,o){return super._move(nc(jo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class Aht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}class Pht extends k_{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ex,P3))==null?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}class Oht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}class Fht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}class Bht extends k_{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:le.and(H.textInputFocus,(e=le.and(ex,P3))==null?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}class Wht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}class Hht extends k_{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,s,o){return super._move(nc(jo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class Vht extends k_{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,s,o){return super._move(nc(jo.wordSeparators.defaultValue,e.intlSegmenterLocales),t,i,s,o)}}class h8 extends hs{constructor(e){super({canTriggerInlineEdits:!0,...e}),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const s=e==null?void 0:e.get(qi);if(!t.hasModel()||!s)return;const o=nc(t.getOption(148),t.getOption(147)),r=t.getModel(),a=t.getSelections(),l=t.getOption(10),c=t.getOption(15),d=s.getLanguageConfiguration(r.getLanguageId()).getAutoClosingPairs(),h=t._getViewModel(),u=a.map(f=>{const g=this._delete({wordSeparators:o,model:r,selection:f,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(13),autoClosingBrackets:l,autoClosingQuotes:c,autoClosingPairs:d,autoClosedCharacters:h.getCursorAutoClosedCharacters()},this._wordNavigationType);return new ao(g,"")});t.pushUndoStop(),t.executeCommands(this.id,u),t.pushUndoStop()}}class dQ extends h8{_delete(e,t){const i=Xt.deleteWordLeft(e,t);return i||new D(1,1,1,1)}}class hQ extends h8{_delete(e,t){const i=Xt.deleteWordRight(e,t);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new D(s,o,s,o)}}class zht extends dQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:H.writable})}}class jht extends dQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:H.writable})}}class $ht extends dQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}class Uht extends hQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:H.writable})}}class qht extends hQ{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:H.writable})}}class Kht extends hQ{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}class Ght extends Ne{constructor(){super({id:"deleteInsideWord",precondition:H.writable,label:ie(1575,"Delete Word")})}run(e,t,i){if(!t.hasModel())return;const s=nc(t.getOption(148),t.getOption(147)),o=t.getModel(),a=t.getSelections().map(l=>{const c=Xt.deleteInsideWord(s,o,l);return new ao(c,"")});t.pushUndoStop(),t.executeCommands(this.id,a),t.pushUndoStop()}}ye(new kht);ye(new Iht);ye(new Eht);ye(new Nht);ye(new Dht);ye(new Tht);ye(new Aht);ye(new Pht);ye(new Oht);ye(new Fht);ye(new Bht);ye(new Wht);ye(new Rht);ye(new Mht);ye(new Hht);ye(new Vht);ye(new zht);ye(new jht);ye(new $ht);ye(new Uht);ye(new qht);ye(new Kht);we(Ght);class Yht extends h8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=_3.deleteWordPartLeft(e);return i||new D(1,1,1,1)}}class Zht extends h8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:H.writable,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=_3.deleteWordPartRight(e);if(i)return i;const s=e.model.getLineCount(),o=e.model.getLineMaxColumn(s);return new D(s,o,s,o)}}class h0e extends d8{_move(e,t,i,s,o){return _3.moveWordPartLeft(e,t,i,o)}}class Xht extends h0e{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}Rt.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");class Qht extends h0e{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}Rt.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class u0e extends d8{_move(e,t,i,s,o){return _3.moveWordPartRight(e,t,i)}}class Jht extends u0e{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}class eut extends u0e{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:H.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}}ye(new Yht);ye(new Zht);ye(new Xht);ye(new Qht);ye(new Jht);ye(new eut);const IQ=class IQ extends G{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit(()=>this._onDidAttemptReadOnlyEdit()))}_onDidAttemptReadOnlyEdit(){const e=ba.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(105);t||(this.editor.isSimpleWidget?t=new Co(_(1378,"Cannot edit in read-only input")):t=new Co(_(1379,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}};IQ.ID="editor.contrib.readOnlyMessageController";let a4=IQ;At(a4.ID,a4,2);var tut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ice=function(n,e){return function(t,i){e(t,i,n)}};let Gq=class extends G{constructor(e,t,i){super(),this._textModel=e,this._languageFeaturesService=t,this._outlineModelService=i,this._currentModel=Ze(this,void 0);const s=ha("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),o=ha("_textModel.onDidChangeContent",ve.debounce(r=>this._textModel.onDidChangeContent(r),()=>{},100));this._register(ko(async(r,a)=>{s.read(r),o.read(r);const l=a.add(new ZZe),c=await this._outlineModelService.getOrCreate(this._textModel,l.token);a.isDisposed||this._currentModel.set(c,void 0)}))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(Qfe(co(o=>o.range.endLineNumber-o.range.startLineNumber,ma))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};Gq=tut([ice(1,De),ice(2,jD)],Gq);ZP.setBreadcrumbsSourceFactory((n,e)=>e.createInstance(Gq,n));var iut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k6=function(n,e){return function(t,i){e(t,i,n)}},Wy;let l4=(Wy=class extends G{constructor(e,t,i,s){super();const o=this._register($i(e)),r=this._register(s.createMenu(Te.EditorContent,e.contextKeyService)),a=qt(this,r.onDidChange,()=>r.getActions().length===0);this._register(qe(l=>{if(a.read(l))return;const d=Ot("div.floating-menu-overlay-widget");d.root.style.height="28px";const h=t.createInstance(cN,d.root,Te.EditorContent,{actionViewItemProvider:(u,f)=>{if(!(u instanceof rl))return;const g=i.lookupKeybinding(u.id);if(g)return t.createInstance(class extends l_{updateLabel(){this.options.label&&this.label&&(this.label.textContent=`${this._commandAction.label} (${g.getLabel()})`)}},u,{...f,keybindingNotRenderedWithLabel:!0})},hiddenItemStrategy:0,menuOptions:{shouldForwardArgs:!0},telemetrySource:"editor.overlayToolbar",toolbarOptions:{primaryGroup:()=>!0,useSeparatorsInPrimaryActions:!0}});l.store.add(h),l.store.add(qe(u=>{const f=o.model.read(u);h.context=f==null?void 0:f.uri})),l.store.add(o.createOverlayWidget({allowEditorOverflow:!1,domNode:d.root,minContentWidthInPx:wi(0),position:wi({preference:1})}))}))}},Wy.ID="editor.contrib.floatingToolbar",Wy);l4=iut([k6(1,Ae),k6(2,Vt),k6(3,lc)],l4);At(l4.ID,l4,1);const EQ=class EQ extends G{constructor(e){super(),this.editor=e,this.widget=null,Jl&&(this._register(e.onDidChangeConfiguration(()=>this.update())),this.update())}update(){const e=!this.editor.getOption(104);!this.widget&&e?this.widget=new Yq(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}};EQ.ID="editor.contrib.iPadShowKeyboard";let c4=EQ;const YF=class YF extends G{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(J(this._domNode,"touchstart",t=>{this.editor.focus()})),this._register(J(this._domNode,"focus",t=>{this.editor.focus()})),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return YF.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}};YF.ID="editor.contrib.ShowKeyboardWidget";let Yq=YF;At(c4.ID,c4,3);var nut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nce=function(n,e){return function(t,i){e(t,i,n)}},Zq,R1;let HN=(R1=class extends G{static get(e){return e.getContribution(Zq.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel(s=>this.stop())),this._register(this._editor.onDidChangeModelLanguage(s=>this.stop())),this._register(rn.onDidChange(s=>this.stop())),this._register(this._editor.onKeyUp(s=>s.keyCode===9&&this.stop()))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Xq(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}},Zq=R1,R1.ID="editor.contrib.inspectTokens",R1);HN=Zq=nut([nce(1,ml),nce(2,un)],HN);class sut extends Ne{constructor(){super({id:"editor.action.inspectTokens",label:Sz.inspectTokensAction,alias:"Developer: Inspect Tokens",precondition:void 0})}run(e,t){const i=HN.get(t);i==null||i.launch()}}function out(n){let e="";for(let t=0,i=n.length;tfS,tokenize:(s,o,r)=>uY(e,r),tokenizeEncoded:(s,o,r)=>o3(i,r)}}const ZF=class ZF extends G{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=rut(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition(i=>this._compute(this._editor.getPosition()))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return ZF._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let l=t.tokens1.length-1;l>=0;l--){const c=t.tokens1[l];if(e.column-1>=c.offset){i=l;break}}let s=0;for(let l=t.tokens2.length>>>1;l>=0;l--)if(e.column-1>=t.tokens2[l<<1]){s=l;break}const o=this._model.getLineContent(e.lineNumber);let r="";if(i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sce=function(n,e){return function(t,i){e(t,i,n)}},qL,M1;let Qq=(M1=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=Ji.as(Hw.Quickaccess)}provide(e){const t=new ne;return t.add(e.onDidAccept(()=>{const[i]=e.selectedItems;i&&this.quickInputService.quickAccess.show(i.prefix,{preserveValue:!0})})),t.add(e.onDidChangeValue(i=>{const s=this.registry.getQuickAccessProvider(i.substr(qL.PREFIX.length));s&&s.prefix&&s.prefix!==qL.PREFIX&&this.quickInputService.quickAccess.show(s.prefix,{preserveValue:!0})})),e.items=this.getQuickAccessProviders().filter(i=>i.prefix!==qL.PREFIX),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort((t,i)=>t.prefix.localeCompare(i.prefix)).flatMap(t=>this.createPicks(t))}createPicks(e){return e.helpEntries.map(t=>{const i=t.prefix||e.prefix,s=i||"…";return{prefix:i,label:s,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:_(1747,"{0}, {1}",s,t.description),description:t.description}})}},qL=M1,M1.PREFIX="?",M1);Qq=qL=aut([sce(0,No),sce(1,Vt)],Qq);Ji.as(Hw.Quickaccess).registerQuickAccessProvider({ctor:Qq,prefix:"",helpEntries:[{description:xz.helpQuickAccessActionLabel}]});class f0e{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t,i){var r;const s=new ne;e.canAcceptInBackground=!!((r=this.options)!=null&&r.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const o=s.add(new Gt);return o.value=this.doProvide(e,t,i),s.add(this.onDidActiveTextEditorControlChange(()=>{o.value=void 0,o.value=this.doProvide(e,t)})),s}doProvide(e,t,i){const s=new ne,o=this.activeTextEditorControl;if(o&&this.canProvideWithTextEditor(o)){const r={editor:o},a=f1e(o);if(a){let l=o.saveViewState()??void 0;s.add(a.onDidChangeCursorPosition(()=>{l=o.saveViewState()??void 0})),r.restoreViewState=()=>{l&&o===this.activeTextEditorControl&&o.restoreViewState(l)},s.add(q1(t.onCancellationRequested)(()=>{var c;return(c=r.restoreViewState)==null?void 0:c.call(r)}))}s.add(Re(()=>this.clearDecorations(o))),s.add(this.provideWithTextEditor(r,e,t,i))}else s.add(this.provideWithoutTextEditor(e,t));return s}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range,"code.jump"),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Jd(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return hX(e)?(t=e.getModel())==null?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations(i=>{const s=[];this.rangeHighlightDecorationId&&(s.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),s.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const o=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:an($me),position:ll.Full}}}],[r,a]=i.deltaDecorations(s,o);this.rangeHighlightDecorationId={rangeHighlightId:r,overviewRulerDecorationId:a}})}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations(i=>{i.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])}),this.rangeHighlightDecorationId=void 0)}}const Zb=class Zb extends f0e{constructor(){super({canAcceptInBackground:!0})}get useZeroBasedOffset(){return this.storageService.getBoolean(Zb.ZERO_BASED_OFFSET_STORAGE_KEY,-1,!1)}set useZeroBasedOffset(e){this.storageService.store(Zb.ZERO_BASED_OFFSET_STORAGE_KEY,e,-1,0)}provideWithoutTextEditor(e){const t=_(1335,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,G.None}provideWithTextEditor(e,t,i){const s=e.editor,o=new ne;o.add(t.onDidAccept(c=>{const[d]=t.selectedItems;if(d){if(!d.lineNumber)return;this.gotoLocation(e,{range:this.toRange(d.lineNumber,d.column),keyMods:t.keyMods,preserveFocus:c.inBackground}),c.inBackground||t.hide()}}));const r=()=>{const c=t.value.trim().substring(Zb.PREFIX.length),{inOffsetMode:d,lineNumber:h,column:u,label:f}=this.parsePosition(s,c);if(a.visible=!!d,t.items=[{lineNumber:h,column:u,label:f}],t.ariaLabel=f,!h){this.clearDecorations(s);return}const g=this.toRange(h,u);s.revealRangeInCenter(g,0),this.addDecorations(s,g)},a=new Ug({title:_(1336,"Use Zero-Based Offset"),icon:de.indexZero,isChecked:this.useZeroBasedOffset,inputActiveOptionBorder:ge(mD),inputActiveOptionForeground:ge(_D),inputActiveOptionBackground:ge(nx)});o.add(a.onChange(()=>{this.useZeroBasedOffset=!this.useZeroBasedOffset,r()})),t.toggles=[a],r(),o.add(t.onDidChangeValue(()=>r()));const l=f1e(s);return l&&l.getOptions().get(76).renderType===2&&(l.updateOptions({lineNumbers:"on"}),o.add(Re(()=>l.updateOptions({lineNumbers:"relative"})))),o}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){var s,o;const i=this.getModel(e);if(!i)return{label:_(1337,"Open a text editor first to go to a line.")};if(t.startsWith(":")){let r=parseInt(t.substring(1),10);const a=i.getValueLength();if(isNaN(r))return{inOffsetMode:!0,label:this.useZeroBasedOffset?_(1338,"Type a character position to go to (from 0 to {0}).",a-1):_(1339,"Type a character position to go to (from 1 to {0}).",a)};{const l=r<0;this.useZeroBasedOffset||(r-=Math.sign(r)),l&&(r+=a);const c=i.getPositionAt(r);return{...c,inOffsetMode:!0,label:_(1340,"Press 'Enter' to go to line {0} at column {1}.",c.lineNumber,c.column)}}}else{const r=t.split(/,|:|#/),a=i.getLineCount();let l=parseInt((s=r[0])==null?void 0:s.trim(),10);if(r.length<1||isNaN(l))return{label:_(1341,"Type a line number to go to (from 1 to {0}).",a)};l=l>=0?l:a+1+l,l=Math.min(Math.max(1,l),a);const c=i.getLineMaxColumn(l);let d=parseInt((o=r[1])==null?void 0:o.trim(),10);return r.length<2||isNaN(d)?{lineNumber:l,column:1,label:r.length<2?_(1342,"Press 'Enter' to go to line {0} or enter : to add a column number.",l):_(1343,"Press 'Enter' to go to line {0} or enter a column number (from 1 to {1}).",l,c)}:(d=d>=0?d:c+d,d=Math.min(Math.max(1,d),c),{lineNumber:l,column:d,label:_(1344,"Press 'Enter' to go to line {0} at column {1}.",l,d)})}}};Zb.PREFIX=":",Zb.ZERO_BASED_OFFSET_STORAGE_KEY="gotoLine.useZeroBasedOffset";let Jq=Zb;var lut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},oce=function(n,e){return function(t,i){e(t,i,n)}};let VN=class extends Jq{constructor(e,t){super(),this.editorService=e,this.storageService=t,this.onDidActiveTextEditorControlChange=ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};VN=lut([oce(0,Bt),oce(1,Jo)],VN);var A1;let g0e=(A1=class extends Ne{constructor(){super({id:A1.ID,label:_P.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:H.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(No).quickAccess.show(VN.PREFIX)}},A1.ID="editor.action.gotoLine",A1);we(g0e);Ji.as(Hw.Quickaccess).registerQuickAccessProvider({ctor:VN,prefix:VN.PREFIX,helpEntries:[{description:_P.gotoLineActionLabel,commandId:g0e.ID}]});const p0e=[void 0,[]];function I6(n,e,t=0,i=0){const s=e;return s.values&&s.values.length>1?cut(n,s.values,t,i):m0e(n,e,t,i)}function cut(n,e,t,i){let s=0;const o=[];for(const r of e){const[a,l]=m0e(n,r,t,i);if(typeof a!="number")return p0e;s+=a,o.push(...l)}return[s,dut(o)]}function m0e(n,e,t,i){const s=rw(e.original,e.originalLowercase,t,n,n.toLowerCase(),i,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],xD(s)]:p0e}function dut(n){const e=n.sort((s,o)=>s.start-o.start),t=[];let i;for(const s of e)!i||!hut(i,s)?(i=s,t.push(s)):(i.start=Math.min(i.start,s.start),i.end=Math.max(i.end,s.end));return t}function hut(n,e){return!(n.end=0,r=rce(n);let a;const l=n.split(_0e);if(l.length>1)for(const c of l){const d=rce(c),{pathNormalized:h,normalized:u,normalizedLowercase:f}=ace(c);u&&(a||(a=[]),a.push({original:c,originalLowercase:c.toLowerCase(),pathNormalized:h,normalized:u,normalizedLowercase:f,expectContiguousMatch:d}))}return{original:n,originalLowercase:e,pathNormalized:t,normalized:i,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function ace(n){let e;$s?e=n.replace(/\//g,Ud):e=n.replace(/\\/g,Ud);const t=e.replace(/[\*\u2026\s"]/g,"");return{pathNormalized:e,normalized:t,normalizedLowercase:t.toLowerCase()}}function lce(n){return Array.isArray(n)?eK(n.map(e=>e.original).join(_0e)):eK(n.original)}var uut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},cce=function(n,e){return function(t,i){e(t,i,n)}},lM,Ad;let Fv=(Ad=class extends f0e{constructor(e,t,i=Object.create(null)){super(i),this._languageFeaturesService=e,this._outlineModelService=t,this.options=i,this.options.canAcceptInBackground=!0}provideWithoutTextEditor(e){return this.provideLabelPick(e,_(1345,"To go to a symbol, first open a text editor with symbol information.")),G.None}provideWithTextEditor(e,t,i,s){const o=e.editor,r=this.getModel(o);return r?this._languageFeaturesService.documentSymbolProvider.has(r)?this.doProvideWithEditorSymbols(e,r,t,i,s):this.doProvideWithoutEditorSymbols(e,r,t,i):G.None}doProvideWithoutEditorSymbols(e,t,i,s){const o=new ne;return this.provideLabelPick(i,_(1346,"The active text editor does not provide symbol information.")),(async()=>!await this.waitForLanguageSymbolRegistry(t,o)||s.isCancellationRequested||o.add(this.doProvideWithEditorSymbols(e,t,i,s)))(),o}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}async waitForLanguageSymbolRegistry(e,t){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new Dw,s=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange(()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(s.dispose(),i.complete(!0))}));return t.add(Re(()=>i.complete(!1))),i.p}doProvideWithEditorSymbols(e,t,i,s,o){var h;const r=e.editor,a=new ne;a.add(i.onDidAccept(u=>{var g;const[f]=i.selectedItems;f&&f.range&&(this.gotoLocation(e,{range:f.range.selection,keyMods:i.keyMods,preserveFocus:u.inBackground}),(g=o==null?void 0:o.handleAccept)==null||g.call(o,f,u.inBackground),u.inBackground||i.hide())})),a.add(i.onDidTriggerItemButton(({item:u})=>{u&&u.range&&(this.gotoLocation(e,{range:u.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())}));const l=this.getDocumentSymbols(t,s),c=a.add(new Gt),d=async u=>{var f;(f=c==null?void 0:c.value)==null||f.cancel(),i.busy=!1,c.value=new Bi,i.busy=!0;try{const g=eK(i.value.substr(lM.PREFIX.length).trim()),p=await this.doGetSymbolPicks(l,g,void 0,c.value.token,t);if(s.isCancellationRequested)return;if(p.length>0){if(i.items=p,u&&g.original.length===0){const m=_E(p,b=>!!(b.type!=="separator"&&b.range&&D.containsPosition(b.range.decoration,u)));m&&(i.activeItems=[m])}}else g.original.length>0?this.provideLabelPick(i,_(1347,"No matching editor symbols")):this.provideLabelPick(i,_(1348,"No editor symbols"))}finally{s.isCancellationRequested||(i.busy=!1)}};return a.add(i.onDidChangeValue(()=>d(void 0))),d((h=r.getSelection())==null?void 0:h.getPosition()),a.add(i.onDidChangeActive(()=>{const[u]=i.activeItems;u&&u.range&&(r.revealRangeInCenter(u.range.selection,0),this.addDecorations(r,u.range.decoration))})),a}async doGetSymbolPicks(e,t,i,s,o){var b,v;const r=await e;if(s.isCancellationRequested)return[];const a=t.original.indexOf(lM.SCOPE_PREFIX)===0,l=a?1:0;let c,d;t.values&&t.values.length>1?(c=lce(t.values[0]),d=lce(t.values.slice(1))):c=t;let h;const u=(v=(b=this.options)==null?void 0:b.openSideBySideDirection)==null?void 0:v.call(b);u&&(h=[{iconClass:u==="right"?$e.asClassName(de.splitHorizontal):$e.asClassName(de.splitVertical),tooltip:u==="right"?_(1349,"Open to the Side"):_(1350,"Open to the Bottom")}]);const f=[];for(let w=0;wl){let P=!1;if(c!==t&&([E,R]=I6(L,{...t,values:void 0},l,x),typeof E=="number"&&(P=!0)),typeof E!="number"&&([E,R]=I6(L,c,l,x),typeof E!="number"))continue;if(!P&&d){if(I&&d.original.length>0&&([M,A]=I6(I,d)),typeof M!="number")continue;typeof E=="number"&&(E+=M)}}const W=C.tags&&C.tags.indexOf(1)>=0;f.push({index:w,kind:C.kind,score:E,label:L,ariaLabel:IPe(C.name,C.kind),description:I,highlights:W?void 0:{label:R,description:A},range:{selection:D.collapseToStart(C.selectionRange),decoration:C.range},uri:o.uri,symbolName:S,strikethrough:W,buttons:h})}const g=f.sort((w,C)=>a?this.compareByKindAndScore(w,C):this.compareByScore(w,C));let p=[];if(a){let L=function(){C&&typeof w=="number"&&S>0&&(C.label=Z1(N6[w]||E6,S))};var m=L;let w,C,S=0;for(const x of g)w!==x.kind?(L(),w=x.kind,S=1,C={type:"separator"},p.push(C)):S++,p.push(x);L()}else g.length>0&&(p=[{label:_(1351,"symbols ({0})",f.length),type:"separator"},...g]);return p}compareByScore(e,t){if(typeof e.score!="number"&&typeof t.score=="number")return 1;if(typeof e.score=="number"&&typeof t.score!="number")return-1;if(typeof e.score=="number"&&typeof t.score=="number"){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=N6[e.kind]||E6,s=N6[t.kind]||E6,o=i.localeCompare(s);return o===0?this.compareByScore(e,t):o}async getDocumentSymbols(e,t){const i=await this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}},lM=Ad,Ad.PREFIX="@",Ad.SCOPE_PREFIX=":",Ad.PREFIX_BY_CATEGORY=`${Ad.PREFIX}${Ad.SCOPE_PREFIX}`,Ad);Fv=lM=uut([cce(0,De),cce(1,jD)],Fv);const E6=_(1352,"properties ({0})"),N6={5:_(1353,"methods ({0})"),11:_(1354,"functions ({0})"),8:_(1355,"constructors ({0})"),12:_(1356,"variables ({0})"),4:_(1357,"classes ({0})"),22:_(1358,"structs ({0})"),23:_(1359,"events ({0})"),24:_(1360,"operators ({0})"),10:_(1361,"interfaces ({0})"),2:_(1362,"namespaces ({0})"),3:_(1363,"packages ({0})"),25:_(1364,"type parameters ({0})"),1:_(1365,"modules ({0})"),6:_(1366,"properties ({0})"),9:_(1367,"enumerations ({0})"),21:_(1368,"enumeration members ({0})"),14:_(1369,"strings ({0})"),0:_(1370,"files ({0})"),17:_(1371,"arrays ({0})"),15:_(1372,"numbers ({0})"),16:_(1373,"booleans ({0})"),18:_(1374,"objects ({0})"),19:_(1375,"keys ({0})"),7:_(1376,"fields ({0})"),13:_(1377,"constants ({0})")};var fut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},D6=function(n,e){return function(t,i){e(t,i,n)}};let tK=class extends Fv{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=ve.None}get activeTextEditorControl(){return this.editorService.getFocusedCodeEditor()??void 0}};tK=fut([D6(0,Bt),D6(1,De),D6(2,jD)],tK);const XF=class XF extends Ne{constructor(){super({id:XF.ID,label:ZE.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:H.hasDocumentSymbolProvider,kbOpts:{kbExpr:H.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(No).quickAccess.show(Fv.PREFIX,{itemActivation:Ld.NONE})}};XF.ID="editor.action.quickOutline";let d4=XF;we(d4);Ji.as(Hw.Quickaccess).registerQuickAccessProvider({ctor:tK,prefix:Fv.PREFIX,helpEntries:[{description:ZE.quickOutlineActionLabel,prefix:Fv.PREFIX,commandId:d4.ID},{description:ZE.quickOutlineByCategoryActionLabel,prefix:Fv.PREFIX_BY_CATEGORY}]});function gut(n){const e=new Map;for(const t of n)e.set(t,(e.get(t)??0)+1);return e}class nI{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),s=new Map,o=[];for(const[r,a]of this.documents){if(t.isCancellationRequested)return[];for(const l of a.chunks){const c=this.computeSimilarityScore(l,i,s);c>0&&o.push({key:r,score:c})}}return o}static termFrequencies(e){return gut(nI.splitTerms(e))}static*splitTerms(e){const t=i=>i.toLowerCase();for(const[i]of e.matchAll(new RegExp("\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b","gu"))){yield t(i);const s=i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/g);if(s.length>1)for(const o of s)o.length>2&&new RegExp("\\p{Letter}{3,}","gu").test(o)&&(yield t(o))}}updateDocuments(e){for(const{key:t}of e)this.deleteDocument(t);for(const t of e){const i=[];for(const s of t.textChunks){const o=nI.termFrequencies(s);for(const r of o.keys())this.chunkOccurrences.set(r,(this.chunkOccurrences.get(r)??0)+1);i.push({text:s,tf:o})}this.chunkCount+=i.length,this.documents.set(t.key,{chunks:i})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const i of t.chunks)for(const s of i.tf.keys()){const o=this.chunkOccurrences.get(s);if(typeof o=="number"){const r=o-1;r<=0?this.chunkOccurrences.delete(s):this.chunkOccurrences.set(s,r)}}}}computeSimilarityScore(e,t,i){let s=0;for(const[o,r]of Object.entries(t)){const a=e.tf.get(o);if(!a)continue;let l=i.get(o);typeof l!="number"&&(l=this.computeIdf(o),i.set(o,l));const c=a*l;s+=c*r}return s}computeEmbedding(e){const t=nI.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){const t=this.chunkOccurrences.get(e)??0;return t>0?Math.log((this.chunkCount+1)/t):0}computeTfidf(e){const t=Object.create(null);for(const[i,s]of e){const o=this.computeIdf(i);o>0&&(t[i]=s*o)}return t}}function put(n){var i;const e=n.slice(0);e.sort((s,o)=>o.score-s.score);const t=((i=e[0])==null?void 0:i.score)??0;if(t>0)for(const s of e)s.score/=t;return e}var k0;(function(n){n[n.NO_ACTION=0]="NO_ACTION",n[n.CLOSE_PICKER=1]="CLOSE_PICKER",n[n.REFRESH_PICKER=2]="REFRESH_PICKER",n[n.REMOVE_ITEM=3]="REMOVE_ITEM"})(k0||(k0={}));function T6(n){const e=n;return Array.isArray(e.items)}function dce(n){const e=n;return!!e.picks&&e.additionalPicks instanceof Promise}class mut extends G{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var c;const s=new ne;e.canAcceptInBackground=!!((c=this.options)!=null&&c.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;let o;const r=s.add(new Gt),a=async()=>{var m;o==null||o.dispose(!0),e.busy=!1;const d=r.value=new ne;o=d.add(new Bi(t));const h=o.token;let u=e.value.substring(this.prefix.length);(m=this.options)!=null&&m.shouldSkipTrimPickFilter||(u=u.trim());const f=this._getPicks(u,d,h,i),g=(b,v)=>{var S;let w,C;if(T6(b)?(w=b.items,C=b.active):w=b,w.length===0){if(v)return!1;(u.length>0||e.hideInput)&&((S=this.options)!=null&&S.noResultsPick)&&(U1(this.options.noResultsPick)?w=[this.options.noResultsPick(u)]:w=[this.options.noResultsPick])}return e.items=w,C&&(e.activeItems=[C]),!0},p=async b=>{let v=!1,w=!1;await Promise.all([(async()=>{typeof b.mergeDelay=="number"&&(await wu(b.mergeDelay),h.isCancellationRequested)||w||(v=g(b.picks,!0))})(),(async()=>{e.busy=!0;try{const C=await b.additionalPicks;if(h.isCancellationRequested)return;let S,L;T6(b.picks)?(S=b.picks.items,L=b.picks.active):S=b.picks;let x,I;if(T6(C)?(x=C.items,I=C.active):x=C,x.length>0||!v){let E;if(!L&&!I){const R=e.activeItems[0];R&&S.indexOf(R)!==-1&&(E=R)}g({items:[...S,...x],active:L||I||E})}}finally{h.isCancellationRequested||(e.busy=!1),w=!0}})()])};if(f!==null)if(dce(f))await p(f);else if(!(f instanceof Promise))g(f);else{e.busy=!0;try{const b=await f;if(h.isCancellationRequested)return;dce(b)?await p(b):g(b)}finally{h.isCancellationRequested||(e.busy=!1)}}};s.add(e.onDidChangeValue(()=>a())),a(),s.add(e.onDidAccept(d=>{var u;if(i!=null&&i.handleAccept){d.inBackground||e.hide(),(u=i.handleAccept)==null||u.call(i,e.activeItems[0],d.inBackground);return}const[h]=e.selectedItems;typeof(h==null?void 0:h.accept)=="function"&&(d.inBackground||e.hide(),h.accept(e.keyMods,d))}));const l=async(d,h)=>{var f;if(typeof h.trigger!="function")return;const u=((f=h.buttons)==null?void 0:f.indexOf(d))??-1;if(u>=0){const g=h.trigger(u,e.keyMods),p=typeof g=="number"?g:await g;if(t.isCancellationRequested)return;switch(p){case k0.NO_ACTION:break;case k0.CLOSE_PICKER:e.hide();break;case k0.REFRESH_PICKER:a();break;case k0.REMOVE_ITEM:{const m=e.items.indexOf(h);if(m!==-1){const b=e.items.slice(),v=b.splice(m,1),w=e.activeItems.filter(S=>S!==v[0]),C=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=b,w&&(e.activeItems=w),e.keepScrollPosition=C}break}}}};return s.add(e.onDidTriggerItemButton(({button:d,item:h})=>l(d,h))),s.add(e.onDidTriggerSeparatorButton(({button:d,separator:h})=>l(d,h))),s}}new Qc(1e4);const _ut=new Qc(1e4);function but(n){return wut(n,"NFD",_ut)}const vut=/[^\u0000-\u0080]/;function wut(n,e,t){if(!n)return n;const i=t.get(n);if(i)return i;let s;return vut.test(n)?s=n.normalize(e):s=n,t.set(n,s),s}const Cut=function(){const n=/[\u0300-\u036f]/g;return function(e){return but(e).replace(n,"")}}();var b0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jp=function(n,e){return function(t,i){e(t,i,n)}},wb,Gn,ou;let iK=(ou=class extends mut{constructor(e,t,i,s,o,r){super(wb.PREFIX,e),this.keybindingService=i,this.commandService=s,this.telemetryService=o,this.dialogService=r,this.commandsHistory=this._register(t.createInstance(nK)),this.options=e}async _getPicks(e,t,i,s){var g,p;const o=await this.getCommandPicks(i);if(i.isCancellationRequested)return[];const r=q1(()=>{const m=new nI;m.updateDocuments(o.map(v=>({key:v.commandId,textChunks:[this.getTfIdfChunk(v)]})));const b=m.calculateScores(e,i);return put(b).filter(v=>v.score>wb.TFIDF_THRESHOLD).slice(0,wb.TFIDF_MAX_RESULTS)}),a=this.normalizeForFiltering(e),l=[];for(const m of o){m.labelNoAccents??(m.labelNoAccents=this.normalizeForFiltering(m.label));const b=wb.WORD_FILTER(a,m.labelNoAccents)??void 0;let v;if(m.commandAlias&&(m.aliasNoAccents??(m.aliasNoAccents=this.normalizeForFiltering(m.commandAlias)),v=wb.WORD_FILTER(a,m.aliasNoAccents)??void 0),b||v)m.highlights={label:b,detail:this.options.showAlias?v:void 0},l.push(m);else if(e===m.commandId)l.push(m);else if(e.length>=3){const w=r();if(i.isCancellationRequested)return[];const C=w.find(S=>S.key===m.commandId);C&&(m.tfIdfScore=C.score,l.push(m))}}const c=new Map;for(const m of l){const b=c.get(m.label);b?(m.description=m.commandId,b.description=b.commandId):c.set(m.label,m)}l.sort((m,b)=>{if(m.tfIdfScore&&b.tfIdfScore)return m.tfIdfScore===b.tfIdfScore?m.label.localeCompare(b.label):b.tfIdfScore-m.tfIdfScore;if(m.tfIdfScore)return 1;if(b.tfIdfScore)return-1;const v=this.commandsHistory.peek(m.commandId),w=this.commandsHistory.peek(b.commandId);if(v&&w)return v>w?-1:1;if(v)return-1;if(w)return 1;if(this.options.suggestedCommandIds){const L=this.options.suggestedCommandIds.has(m.commandId),x=this.options.suggestedCommandIds.has(b.commandId);if(L&&x)return 0;if(L)return-1;if(x)return 1}const C=m.commandCategory===Aq.Developer.value,S=b.commandCategory===Aq.Developer.value;return C&&!S?1:!C&&S?-1:m.label.localeCompare(b.label)});const d=[];let h=!1,u=!0,f=!!this.options.suggestedCommandIds;for(let m=0;m{var v;const m=await this.getAdditionalCommandPicks(o,l,e,i);if(i.isCancellationRequested)return[];const b=m.map(w=>this.toCommandPick(w,s));return u&&((v=b[0])==null?void 0:v.type)!=="separator"&&b.unshift({type:"separator",label:_(1744,"similar commands")}),b})()}:d}toCommandPick(e,t){if(e.type==="separator")return e;const i=this.keybindingService.lookupKeybinding(e.commandId),s=i?_(1745,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return{...e,ariaLabel:s,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:async()=>{var o;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:(t==null?void 0:t.from)??"quick open"});try{(o=e.args)!=null&&o.length?await this.commandService.executeCommand(e.commandId,...e.args):await this.commandService.executeCommand(e.commandId)}catch(r){fl(r)||this.dialogService.error(_(1746,"Command '{0}' resulted in an error",e.label),nO(r))}}}}getTfIdfChunk({label:e,commandAlias:t,commandDescription:i}){let s=e;return t&&t!==e&&(s+=` - ${t}`),i&&i.value!==e&&(s+=` - ${i.value===i.original?i.value:`${i.value} (${i.original})`}`),s}normalizeForFiltering(e){const t=Cut(e);return t.length!==e.length?(this.telemetryService.publicLog2("QuickAccess:FilterLengthMismatch",{originalLength:e.length,normalizedLength:t.length}),e):t}},wb=ou,ou.PREFIX=">",ou.TFIDF_THRESHOLD=.5,ou.TFIDF_MAX_RESULTS=5,ou.WORD_FILTER=fZ(jE,Eje,nbe),ou);iK=wb=b0e([jp(1,Ae),jp(2,Vt),jp(3,ki),jp(4,To),jp(5,SD)],iK);var Pd;let nK=(Pd=class extends G{constructor(e,t,i){super(),this.storageService=e,this.configurationService=t,this.logService=i,this.configuredCommandsHistoryLength=0,this.updateConfiguration(),this.load(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>this.updateConfiguration(e))),this._register(this.storageService.onWillSaveState(e=>{e.reason===Lm.SHUTDOWN&&this.saveState()}))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=Gn.getConfiguredCommandHistoryLength(this.configurationService),Gn.cache&&Gn.cache.limit!==this.configuredCommandsHistoryLength&&(Gn.cache.limit=this.configuredCommandsHistoryLength,Gn.hasChanges=!0))}load(){const e=this.storageService.get(Gn.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(s){this.logService.error(`[CommandsHistory] invalid data: ${s}`)}const i=Gn.cache=new Qc(this.configuredCommandsHistoryLength,1);if(t){let s;t.usesLRU?s=t.entries:s=t.entries.sort((o,r)=>o.value-r.value),s.forEach(o=>i.set(o.key,o.value))}Gn.counter=this.storageService.getNumber(Gn.PREF_KEY_COUNTER,0,Gn.counter)}push(e){Gn.cache&&(Gn.cache.set(e,Gn.counter++),Gn.hasChanges=!0)}peek(e){var t;return(t=Gn.cache)==null?void 0:t.peek(e)}saveState(){if(!Gn.cache||!Gn.hasChanges)return;const e={usesLRU:!0,entries:[]};Gn.cache.forEach((t,i)=>e.entries.push({key:i,value:t})),this.storageService.store(Gn.PREF_KEY_CACHE,JSON.stringify(e),0,0),this.storageService.store(Gn.PREF_KEY_COUNTER,Gn.counter,0,0),Gn.hasChanges=!1}static getConfiguredCommandHistoryLength(e){var s,o;const i=(o=(s=e.getValue().workbench)==null?void 0:s.commandPalette)==null?void 0:o.history;return typeof i=="number"?i:Gn.DEFAULT_COMMANDS_HISTORY_LENGTH}},Gn=Pd,Pd.DEFAULT_COMMANDS_HISTORY_LENGTH=50,Pd.PREF_KEY_CACHE="commandPalette.mru.cache",Pd.PREF_KEY_COUNTER="commandPalette.mru.counter",Pd.counter=1,Pd.hasChanges=!1,Pd);nK=Gn=b0e([jp(0,Jo),jp(1,lt),jp(2,Li)],nK);class yut extends iK{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r)}getCodeEditorCommandPicks(){var i;const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const s of e.getSupportedActions()){let o;(i=s.metadata)!=null&&i.description&&(mKe(s.metadata.description)?o=s.metadata.description:o={original:s.metadata.description,value:s.metadata.description}),t.push({commandId:s.id,commandAlias:s.alias,commandDescription:o,label:vZ(s.label)||s.id})}return t}}var Sut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},NC=function(n,e){return function(t,i){e(t,i,n)}};let zN=class extends yut{get activeTextEditorControl(){return this.codeEditorService.getFocusedCodeEditor()??void 0}constructor(e,t,i,s,o,r){super({showAlias:!1},e,i,s,o,r),this.codeEditorService=t}async getCommandPicks(){return this.getCodeEditorCommandPicks()}hasAdditionalCommandPicks(){return!1}async getAdditionalCommandPicks(){return[]}};zN=Sut([NC(0,Ae),NC(1,Bt),NC(2,Vt),NC(3,ki),NC(4,To),NC(5,SD)],zN);const QF=class QF extends Ne{constructor(){super({id:QF.ID,label:bP.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:H.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(No).quickAccess.show(zN.PREFIX)}};QF.ID="editor.action.quickCommand";let h4=QF;we(h4);Ji.as(Hw.Quickaccess).registerQuickAccessProvider({ctor:zN,prefix:zN.PREFIX,helpEntries:[{description:bP.quickCommandHelp,commandId:h4.ID}]});var xut=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DC=function(n,e){return function(t,i){e(t,i,n)}};let sK=class extends yw{constructor(e,t,i,s,o,r,a){super(!0,e,t,i,s,o,r,a)}};sK=xut([DC(1,Xe),DC(2,Bt),DC(3,fn),DC(4,Ae),DC(5,Jo),DC(6,lt)],sK);At(yw.ID,sK,4);class Lut extends Ne{constructor(){super({id:"editor.action.toggleHighContrast",label:kz.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(ml),s=i.getColorTheme();Gd(s.type)?(i.setTheme(this._originalThemeName||(Ng(s.type)?vy:Pf)),this._originalThemeName=null):(i.setTheme(Ng(s.type)?Av:Pv),this._originalThemeName=s.themeName)}}we(Lut);const v0e={},R6={};class uQ{static getOrCreate(e){return R6[e]||(R6[e]=new uQ(e)),R6[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,i)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=i})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,v0e[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}}function kut(n){const e=n.id;v0e[e]=n,w0.register(n);const t=uQ.getOrCreate(e);w0.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),w0.onLanguageEncountered(e,async()=>{const i=await t.load();w0.setLanguageConfiguration(e,i.conf)})}kut({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>WJe(()=>Promise.resolve().then(()=>qft),void 0)});const w0e="aevatar.scripting.package.v1";function fQ(n,e){const t=String(n||e).replace(/\\/g,"/").trim().replace(/^\.\/+/,"").replace(/^\/+/,"");return!t||t===".."||t.includes("../")?e:t}function hce(n,e){const t=new Map;for(const i of n||[]){const s=fQ((i==null?void 0:i.path)||e,e);t.set(s,String((i==null?void 0:i.content)||""))}return Array.from(t.entries()).sort((i,s)=>i[0].localeCompare(s[0])).map(([i,s])=>({path:i,content:s}))}function Wu(n,e=[],t="",i=""){var a;const s=hce(n,"Behavior.cs"),o=hce(e,"schema.proto"),r=s.some(l=>l.path===i)?i:((a=s[0])==null?void 0:a.path)||"";return{format:w0e,csharpSources:s,protoFiles:o,entryBehaviorTypeName:String(t||"").trim(),entrySourcePath:r}}function cM(n,e="Behavior.cs"){return Wu([{path:e,content:n}],[],"",e)}function gQ(n){const e=String(n||"");if(!e.trimStart().startsWith("{"))return cM(e);try{const i=JSON.parse(e);if((i==null?void 0:i.format)!==w0e)return cM(e);const s=Array.isArray(i.cSharpSources)?i.cSharpSources:Array.isArray(i.csharpSources)?i.csharpSources:Array.isArray(i.CsharpSources)?i.CsharpSources:[];return Wu(s.map(o=>({path:String((o==null?void 0:o.path)||(o==null?void 0:o.Path)||"Behavior.cs"),content:String((o==null?void 0:o.content)||(o==null?void 0:o.Content)||"")})),Array.isArray(i.protoFiles)?i.protoFiles.map(o=>({path:String((o==null?void 0:o.path)||"schema.proto"),content:String((o==null?void 0:o.content)||"")})):Array.isArray(i.ProtoFiles)?i.ProtoFiles.map(o=>({path:String((o==null?void 0:o.path)||(o==null?void 0:o.Path)||"schema.proto"),content:String((o==null?void 0:o.content)||(o==null?void 0:o.Content)||"")})):[],i.entryBehaviorTypeName||i.EntryBehaviorTypeName||"",i.entrySourcePath||i.EntrySourcePath||"")}catch{return cM(e)}}function Iut(n){if(!n||typeof n!="object")return null;try{return gQ(JSON.stringify(n))}catch{return null}}function KL(n){var t;const e=Wu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath);return e.protoFiles.length===0&&e.csharpSources.length===1&&!e.entryBehaviorTypeName.trim()?((t=e.csharpSources[0])==null?void 0:t.content)||"":JSON.stringify({format:e.format,cSharpSources:e.csharpSources,protoFiles:e.protoFiles,entryBehaviorTypeName:e.entryBehaviorTypeName})}function oK(n){return[...n.csharpSources.map(e=>({kind:"csharp",path:e.path,content:e.content})),...n.protoFiles.map(e=>({kind:"proto",path:e.path,content:e.content}))]}function Il(n,e){const t=oK(n);return t.length===0?null:t.find(i=>i.path===e)||t[0]}function uce(n,e,t){const i=C0e(n,e);if(!i)return n;const s=i==="csharp"?n.csharpSources.map(o=>o.path===e?{...o,content:t}:o):n.protoFiles.map(o=>o.path===e?{...o,content:t}:o);return Wu(i==="csharp"?s:n.csharpSources,i==="proto"?s:n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath)}function Eut(n,e,t,i=""){const s=fQ(t,e==="csharp"?"Behavior.cs":"schema.proto"),o=e==="csharp"?[...n.csharpSources,{path:s,content:i}]:[...n.protoFiles,{path:s,content:i}];return Wu(e==="csharp"?o:n.csharpSources,e==="proto"?o:n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath||(e==="csharp"?s:""))}function Nut(n,e,t){const i=C0e(n,e);if(!i)return n;const s=fQ(t,e),o=i==="csharp"?n.csharpSources.map(a=>a.path===e?{...a,path:s}:a):n.csharpSources,r=i==="proto"?n.protoFiles.map(a=>a.path===e?{...a,path:s}:a):n.protoFiles;return Wu(o,r,n.entryBehaviorTypeName,n.entrySourcePath===e?s:n.entrySourcePath)}function Dut(n,e){var o;const t=n.csharpSources.filter(r=>r.path!==e),i=n.protoFiles.filter(r=>r.path!==e),s=t.some(r=>r.path===n.entrySourcePath)?n.entrySourcePath:((o=t[0])==null?void 0:o.path)||"";return Wu(t,i,n.entryBehaviorTypeName,s)}function Tut(n,e){return n.csharpSources.some(t=>t.path===e)?Wu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,e):n}function Rut(n,e){return Wu(n.csharpSources,n.protoFiles,e,n.entrySourcePath)}function C0e(n,e){return n.csharpSources.some(t=>t.path===e)?"csharp":n.protoFiles.some(t=>t.path===e)?"proto":null}function Ml(n){return n?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(n)):"-"}function y0e(n){var i,s;if(!((i=n==null?void 0:n.scopeDetail)!=null&&i.source))return!1;const e=n.scopeDetail.source.sourceText||"",t=((s=n.scopeDetail.script)==null?void 0:s.activeRevision)||n.scopeDetail.source.revision||"";return e!==KL(n.package)||t&&t!==n.revision}function eu(n){return y.jsx("div",{className:"flex h-full min-h-[180px] items-center justify-center rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-6 text-center",children:y.jsxs("div",{className:"max-w-[360px]",children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:n.title}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-500",children:n.copy})]})})}function M6(n){return y.jsxs("button",{type:"button",onClick:n.onClick,className:`execution-run-card ${n.active?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:n.title}),y.jsx("div",{className:"mt-1 text-[11px] text-gray-400",children:n.meta})]}),n.status?y.jsx("span",{className:"rounded-full border border-[#E5DED3] bg-[#F7F2E8] px-2.5 py-1 text-[10px] uppercase tracking-[0.14em] text-[#8E6A3D]",children:n.status}):null]}),y.jsx("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:n.summary})]})}function Of(n){const[e,t]=$.useState(n.defaultOpen??!0);return y.jsxs("section",{className:"rounded-[24px] border border-[#E6E3DE] bg-[#FAF8F4]",children:[y.jsxs("div",{className:"flex items-start justify-between gap-3 px-4 py-4",children:[y.jsxs("div",{className:"min-w-0",children:[n.eyebrow?y.jsx("div",{className:"panel-eyebrow",children:n.eyebrow}):null,y.jsx("div",{className:`text-[14px] font-semibold text-gray-800 ${n.eyebrow?"mt-1":""}`,children:n.title})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[n.actions,y.jsx("button",{type:"button",onClick:()=>t(i=>!i),className:"panel-icon-button shrink-0","aria-expanded":e,title:e?"Collapse section":"Expand section",children:y.jsx(LL,{size:14,className:`transition-transform ${e?"":"-rotate-90"}`})})]})]}),e?y.jsx("div",{className:n.bodyClassName||"border-t border-[#EEEAE4] px-4 pb-4",children:n.children}):null]})}function sf(n){return n.open?y.jsx("div",{className:"modal-overlay",onClick:n.onClose,children:y.jsxs("div",{className:"modal-shell",style:n.width?{width:n.width}:void 0,onClick:e=>e.stopPropagation(),children:[y.jsxs("div",{className:"modal-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:n.eyebrow}),y.jsx("div",{className:"panel-title !mt-0",children:n.title})]}),y.jsx("button",{type:"button",onClick:n.onClose,title:"Close dialog.",className:"panel-icon-button",children:y.jsx(i0,{size:16})})]}),y.jsx("div",{className:"modal-body",children:n.children}),y.jsx("div",{className:"modal-footer",children:n.actions})]})}):null}function Mut(n){var t;const{selectedDraft:e}=n;return e?y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Inspector"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:"Draft metadata"})]}),y.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto p-4",children:[y.jsx(Of,{eyebrow:"Identity",title:"Draft identity",defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"grid gap-3 pt-4",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Script ID"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.scriptId||"-"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Draft Revision"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.revision||"-"})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Base Revision"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:e.baseRevision||"-"})]})]})}),y.jsx(Of,{eyebrow:"Actors",title:"Binding and runtime ids",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["definitionActorId: ",e.definitionActorId||"-"]}),y.jsxs("div",{children:["runtimeActorId: ",e.runtimeActorId||"-"]}),y.jsxs("div",{children:["lastSourceHash: ",e.lastSourceHash||"-"]}),y.jsxs("div",{children:["updatedAt: ",Ml(e.updatedAtUtc)]})]})}),y.jsx(Of,{eyebrow:"Contract",title:"Current app contract",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-3 pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Storage"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.scopeBacked?`Scope-backed · ${n.appContext.scopeId}`:"Local-only draft"})]}),y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Input Type"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.appContext.scriptContract.inputType})]}),y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:"Read Model Fields"}),y.jsx("div",{className:"mt-1 break-all text-[13px] text-gray-700",children:n.appContext.scriptContract.readModelFields.join(", ")})]})]})}),y.jsx(Of,{eyebrow:"Package",title:"Draft package",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["selectedFile: ",e.selectedFilePath||"-"]}),y.jsxs("div",{children:["entrySourcePath: ",e.package.entrySourcePath||"-"]}),y.jsxs("div",{children:["entryBehaviorTypeName: ",e.package.entryBehaviorTypeName||"-"]}),y.jsxs("div",{children:["csharpFiles: ",e.package.csharpSources.length]}),y.jsxs("div",{children:["protoFiles: ",e.package.protoFiles.length]})]})}),y.jsx(Of,{eyebrow:"Scope Snapshot",title:"Saved scope state",defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:(t=e.scopeDetail)!=null&&t.script?y.jsxs("div",{className:"space-y-2 break-all pt-4 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",e.scopeDetail.script.scriptId]}),y.jsxs("div",{children:["revision: ",e.scopeDetail.script.activeRevision]}),y.jsxs("div",{children:["catalogActorId: ",e.scopeDetail.script.catalogActorId||"-"]}),y.jsxs("div",{children:["updatedAt: ",Ml(e.scopeDetail.script.updatedAt)]})]}):y.jsx("div",{className:"pt-4 text-[12px] leading-6 text-gray-500",children:"This draft has not been saved into the current scope yet."})})]})]}):null}function Aut(n){return y.jsxs("div",{className:"flex h-full min-h-0 flex-col border-r border-[#EEEAE4] bg-[#FAF8F4]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Package"}),y.jsxs("div",{className:"mt-1 flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Files"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>n.onAddFile("csharp"),title:"Add C# file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(xf,{size:14})}),y.jsx("button",{type:"button",onClick:()=>n.onAddFile("proto"),title:"Add proto file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-600",children:y.jsx(e0,{size:14})})]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto px-3 py-3",children:n.entries.length===0?y.jsx("div",{className:"rounded-[18px] border border-dashed border-[#E5DED3] bg-white/70 px-4 py-4 text-[12px] leading-6 text-gray-500",children:"Add a C# or proto file to turn this draft into a script package."}):n.entries.map(e=>{const t=n.selectedFilePath===e.path,i=e.kind==="csharp"&&n.entrySourcePath===e.path;return y.jsxs("div",{className:`rounded-[18px] border px-3 py-3 transition-colors ${t?"border-[color:var(--accent-border)] bg-[#FFF4F1]":"border-[#EEEAE4] bg-white hover:bg-[#FFF9F4]"}`,children:[y.jsxs("button",{type:"button",onClick:()=>n.onSelectFile(e.path),className:"flex w-full items-start gap-3 text-left",children:[y.jsx("div",{className:`mt-0.5 rounded-[10px] p-2 ${e.kind==="csharp"?"bg-[#F7EDE4] text-[#9B4D19]":"bg-[#EEF3FF] text-[#315A84]"}`,children:e.kind==="csharp"?y.jsx(G2e,{size:14}):y.jsx(e0,{size:14})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"truncate text-[13px] font-medium text-gray-800",children:e.path}),y.jsx("div",{className:"mt-1 text-[11px] uppercase tracking-[0.14em] text-gray-400",children:e.kind==="csharp"?"C# source":"Proto schema"})]})]}),y.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[11px] text-gray-400",children:i?"Entry source":" "}),y.jsxs("div",{className:"flex items-center gap-2",children:[e.kind==="csharp"?y.jsx("button",{type:"button",onClick:()=>n.onSetEntry(e.path),title:"Use as entry source",className:`panel-icon-button h-8 w-8 rounded-[12px] border ${i?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#E8E4DD] bg-white text-gray-500"}`,children:y.jsx(oRe,{size:14})}):null,y.jsx("button",{type:"button",onClick:()=>n.onRenameFile(e.path),title:"Rename file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#E8E4DD] bg-white text-gray-500",children:y.jsx(eRe,{size:14})}),y.jsx("button",{type:"button",onClick:()=>n.onRemoveFile(e.path),title:"Remove file",className:"panel-icon-button h-8 w-8 rounded-[12px] border border-[#F0D7D0] bg-white text-[#B15647]",children:y.jsx(gp,{size:14})})]})]})]},`${e.kind}:${e.path}`)})})]})}function Put(n){return y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"border-b border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4",children:[y.jsx("div",{className:"panel-eyebrow",children:"Scripts Studio"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:"Resource rail"}),y.jsxs("div",{className:"mt-3 search-field !min-h-[40px] !rounded-[18px] !border-[#E8E1D8] !bg-white",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search drafts or saved scripts",value:n.search,onChange:e=>n.onSearchChange(e.target.value)})]})]}),y.jsxs("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto p-4",children:[y.jsx(Of,{eyebrow:"Drafts",title:`${n.drafts.length} local draft${n.drafts.length===1?"":"s"}`,defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:y.jsx("button",{type:"button",onClick:n.onCreateDraft,className:"panel-icon-button",title:"New draft",children:y.jsx(xf,{size:14})}),children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.filteredDrafts.length===0?y.jsx(eu,{title:"No drafts matched",copy:"Try a different search, or create a new draft."}):n.filteredDrafts.map(e=>{var i,s;const t=y0e(e);return y.jsxs("button",{type:"button",onClick:()=>n.onSelectDraft(e.key),className:`execution-run-card ${e.key===((i=n.selectedDraft)==null?void 0:i.key)?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.revision})]}),y.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[(s=e.scopeDetail)!=null&&s.script?y.jsx("span",{className:"rounded-full border border-[#DCE8C8] bg-[#F5FBEE] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#5C7A2D]",children:"scope"}):null,t?y.jsx("span",{className:"rounded-full border border-[#E9D6AE] bg-[#FFF7E6] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#9B6A1C]",children:"dirty"}):null]})]}),y.jsx("div",{className:"mt-2 text-[11px] text-gray-400",children:Ml(e.updatedAtUtc)})]},e.key)})})}),y.jsx(Of,{eyebrow:"Saved in Scope",title:n.scopeBacked?n.scopeId||"-":"Unavailable",defaultOpen:!0,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:n.scopeBacked?y.jsx("button",{type:"button",onClick:n.onRefreshScopeScripts,className:"panel-icon-button",title:"Refresh saved scripts",disabled:n.scopeScriptsPending,children:y.jsx(rk,{size:14,className:n.scopeScriptsPending?"animate-spin":""})}):void 0,children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.scopeBacked?n.filteredScopeScripts.length===0?y.jsx(eu,{title:n.scopeScriptsPending?"Loading scope scripts":"No saved scripts matched",copy:n.scopeScriptsPending?"Pulling the scope catalog now.":"Try a different search or save the active draft."}):n.filteredScopeScripts.map(e=>{const t=e.script;return t?y.jsxs("button",{type:"button",onClick:()=>n.onOpenScopeScript(e),className:`execution-run-card ${n.scopeSelectionId===t.scriptId?"active":""}`,children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:t.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:t.activeRevision}),y.jsx("div",{className:"mt-2 text-[11px] text-gray-400",children:Ml(t.updatedAt)})]},`${e.scopeId}:${t.scriptId}`):null}):y.jsx(eu,{title:"Scope save unavailable",copy:"This session is not bound to a resolved scope, so only local drafts are available."})})}),y.jsx(Of,{eyebrow:"Runtimes",title:`${n.runtimeSnapshots.length} recent snapshot${n.runtimeSnapshots.length===1?"":"s"}`,defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",actions:y.jsx("button",{type:"button",onClick:n.onRefreshRuntimeSnapshots,className:"panel-icon-button",title:"Refresh runtime snapshots",disabled:n.runtimeSnapshotsPending,children:y.jsx(rk,{size:14,className:n.runtimeSnapshotsPending?"animate-spin":""})}),children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.runtimeSnapshots.length===0?y.jsx(eu,{title:n.runtimeSnapshotsPending?"Loading runtimes":"No runtime snapshots yet",copy:n.runtimeSnapshotsPending?"Pulling recent script runtimes now.":"Run a draft to materialize recent runtime state."}):n.runtimeSnapshots.map(e=>y.jsxs("button",{type:"button",onClick:()=>n.onSelectRuntime(e.actorId),className:`execution-run-card ${n.selectedRuntimeActorId===e.actorId?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.revision})]}),y.jsxs("span",{className:"rounded-full border border-[#E5DED3] bg-[#F7F2E8] px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] text-[#8E6A3D]",children:["v",e.stateVersion]})]}),y.jsx("div",{className:"mt-2 truncate text-[11px] text-gray-400",children:Ml(e.updatedAt)})]},e.actorId))})}),y.jsx(Of,{eyebrow:"Proposals",title:`${n.proposalDecisions.length} terminal decision${n.proposalDecisions.length===1?"":"s"}`,defaultOpen:!1,bodyClassName:"border-t border-[#EEEAE4] px-4 pb-4",children:y.jsx("div",{className:"max-h-[320px] space-y-2 overflow-y-auto pt-4 pr-1",children:n.proposalDecisions.length===0?y.jsx(eu,{title:n.proposalDecisionsPending?"Loading proposals":"No proposal decisions yet",copy:n.proposalDecisionsPending?"Resolving terminal proposal decisions now.":"Promotion decisions will appear here after the scope catalog points at them."}):n.proposalDecisions.map(e=>{const t=n.scopeCatalogsByScriptId[e.scriptId];return y.jsxs("button",{type:"button",onClick:()=>n.onSelectProposal(e.proposalId),className:`execution-run-card ${n.selectedProposalId===e.proposalId?"active":""}`,children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"truncate text-[13px] font-semibold text-gray-800",children:e.scriptId}),y.jsx("div",{className:"mt-1 truncate text-[11px] text-gray-400",children:e.candidateRevision||e.baseRevision||"-"})]}),y.jsx("span",{className:`rounded-full border px-2 py-0.5 text-[10px] uppercase tracking-[0.14em] ${e.accepted?"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]":"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]"}`,children:e.status||(e.accepted?"accepted":"rejected")})]}),y.jsx("div",{className:"mt-2 truncate text-[11px] text-gray-400",children:t!=null&&t.updatedAt?Ml(t.updatedAt):e.proposalId})]},e.proposalId)})})})]})]})}const S0e="aevatar:scripts-studio:v4",Out=`using System; using System.Threading; using System.Threading.Tasks; using Aevatar.Scripting.Abstractions; @@ -1248,21 +1243,21 @@ public sealed class DraftBehavior : ScriptBehavior")||e.includes("scriptbehavior")||e.includes("google.protobuf.wellknowntypes")&&e.includes("stringvalue")&&e.includes("struct")}function jN(n,e){const t=n?Bu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath):pQ(String(e||"")),i=Tl(t,t.entrySourcePath),s=(i==null?void 0:i.content)||"";return s.trim()?Wut(s)?{package:_ce(),migrated:!0}:{package:t,migrated:!1}:{package:_ce(),migrated:!0}}function N0(n,e={}){const t=new Date().toISOString(),i=jN(e.package),s=Tl(i.package,e.selectedFilePath||i.package.entrySourcePath);return{key:e.key||`draft-${Date.now()}-${n}`,scriptId:e.scriptId||`script-${n}`,revision:e.revision||`draft-rev-${n}`,baseRevision:e.baseRevision||"",reason:e.reason||"",input:e.input||"",package:i.package,selectedFilePath:(s==null?void 0:s.path)||i.package.entrySourcePath||"Behavior.cs",definitionActorId:e.definitionActorId||"",runtimeActorId:e.runtimeActorId||"",updatedAtUtc:e.updatedAtUtc||t,lastSourceHash:e.lastSourceHash||"",lastRun:e.lastRun||null,lastSnapshot:e.lastSnapshot||null,lastPromotion:e.lastPromotion||null,scopeDetail:e.scopeDetail||null}}function Hut(){if(typeof window>"u")return[N0(1)];try{const n=window.localStorage.getItem(E0e);if(!n)return[N0(1)];const e=JSON.parse(n);return!Array.isArray(e)||e.length===0?[N0(1)]:e.map((t,i)=>{const s=jN((t==null?void 0:t.package)||null,String((t==null?void 0:t.source)||"")),o=Tl(s.package,String((t==null?void 0:t.selectedFilePath)||s.package.entrySourcePath||""));return{key:String((t==null?void 0:t.key)||`draft-${Date.now()}-${i+1}`),scriptId:String((t==null?void 0:t.scriptId)||`script-${i+1}`),revision:String((t==null?void 0:t.revision)||`draft-rev-${i+1}`),baseRevision:String((t==null?void 0:t.baseRevision)||""),reason:String((t==null?void 0:t.reason)||""),input:String((t==null?void 0:t.input)||""),package:s.package,selectedFilePath:(o==null?void 0:o.path)||s.package.entrySourcePath||"Behavior.cs",definitionActorId:s.migrated?"":String((t==null?void 0:t.definitionActorId)||""),runtimeActorId:s.migrated?"":String((t==null?void 0:t.runtimeActorId)||""),updatedAtUtc:String((t==null?void 0:t.updatedAtUtc)||new Date().toISOString()),lastSourceHash:s.migrated?"":String((t==null?void 0:t.lastSourceHash)||""),lastRun:s.migrated?null:(t==null?void 0:t.lastRun)||null,lastSnapshot:s.migrated?null:(t==null?void 0:t.lastSnapshot)||null,lastPromotion:s.migrated?null:(t==null?void 0:t.lastPromotion)||null,scopeDetail:s.migrated?null:(t==null?void 0:t.scopeDetail)||null}})}catch{return[N0(1)]}}function Vut(n){if(!(n!=null&&n.readModelPayloadJson))return{input:"",output:"",status:"",lastCommandId:"",notes:[]};try{const e=JSON.parse(n.readModelPayloadJson);return{input:typeof(e==null?void 0:e.input)=="string"?e.input:"",output:typeof(e==null?void 0:e.output)=="string"?e.output:"",status:typeof(e==null?void 0:e.status)=="string"?e.status:"",lastCommandId:typeof(e==null?void 0:e.last_command_id)=="string"?e.last_command_id:"",notes:Array.isArray(e==null?void 0:e.notes)?e.notes.filter(t=>typeof t=="string"):[]}}catch{return{input:"",output:"",status:"",lastCommandId:"",notes:[]}}}function zut(n,e){return n?n.diagnostics.filter(t=>!t.startLine||!t.startColumn?!1:!t.filePath||t.filePath===e).map(t=>({startLineNumber:t.startLine||1,startColumn:t.startColumn||1,endLineNumber:Math.max(t.endLine||t.startLine||1,t.startLine||1),endColumn:Math.max(t.endColumn||(t.startColumn||1)+1,(t.startColumn||1)+1),severity:t.severity==="error"?Vk.Error:t.severity==="warning"?Vk.Warning:Vk.Info,message:t.code?`[${t.code}] ${t.message}`:t.message,code:t.code||void 0,source:t.origin||void 0})):[]}function jut(n){const e=n.filePath||"source";return!n.startLine||!n.startColumn?e:`${e}:${n.startLine}:${n.startColumn}`}function $ut(n,e){return e||!n?"Checking":n.errorCount>0?`${n.errorCount} error${n.errorCount===1?"":"s"}${n.warningCount>0?` · ${n.warningCount} warning${n.warningCount===1?"":"s"}`:""}`:n.warningCount>0?`${n.warningCount} warning${n.warningCount===1?"":"s"}`:"Clean"}function Uut(n){if(!n)return"-";try{return JSON.stringify(JSON.parse(n),null,2)}catch{return n}}function qut(n,e,t){var a,l,c,d,h,u,f,g,p,m,b;const i=jN((t==null?void 0:t.package)||null,((a=n.source)==null?void 0:a.sourceText)||""),s=Tl(i.package,(t==null?void 0:t.selectedFilePath)||i.package.entrySourcePath),o=((l=n.script)==null?void 0:l.scriptId)||(t==null?void 0:t.scriptId)||`script-${e}`,r=((c=n.script)==null?void 0:c.activeRevision)||((d=n.source)==null?void 0:d.revision)||(t==null?void 0:t.revision)||`draft-rev-${e}`;return N0(e,{key:t==null?void 0:t.key,scriptId:o,revision:r,baseRevision:((h=n.script)==null?void 0:h.activeRevision)||((u=n.source)==null?void 0:u.revision)||(t==null?void 0:t.baseRevision)||"",reason:(t==null?void 0:t.reason)||"",input:(t==null?void 0:t.input)||"",package:i.package,selectedFilePath:(s==null?void 0:s.path)||i.package.entrySourcePath||"Behavior.cs",definitionActorId:((f=n.script)==null?void 0:f.definitionActorId)||((g=n.source)==null?void 0:g.definitionActorId)||(t==null?void 0:t.definitionActorId)||"",runtimeActorId:(t==null?void 0:t.runtimeActorId)||"",updatedAtUtc:((p=n.script)==null?void 0:p.updatedAt)||(t==null?void 0:t.updatedAtUtc),lastSourceHash:((m=n.source)==null?void 0:m.sourceHash)||((b=n.script)==null?void 0:b.activeSourceHash)||(t==null?void 0:t.lastSourceHash)||"",lastRun:(t==null?void 0:t.lastRun)||null,lastSnapshot:(t==null?void 0:t.lastSnapshot)||null,lastPromotion:(t==null?void 0:t.lastPromotion)||null,scopeDetail:n})}function Kut(n){return new Promise(e=>window.setTimeout(e,n))}function Gut({appContext:n,onFlash:e}){var Cx,M_,mh,A_,Jg,ep,yx,$u,Uu;const t=$.useRef(null),i=$.useRef(0),[s,o]=$.useState(()=>Hut()),[r,a]=$.useState(""),[l,c]=$.useState(""),[d,h]=$.useState([]),[u,f]=$.useState({}),[g,p]=$.useState([]),[m,b]=$.useState({}),[v,w]=$.useState(!1),[C,S]=$.useState(!1),[L,x]=$.useState(!1),[E,I]=$.useState(!1),[R,M]=$.useState(!1),[A,W]=$.useState(!1),[P,B]=$.useState(!1),[V,K]=$.useState(!1),[z,j]=$.useState("library"),[Q,Y]=$.useState(!1),[te,ce]=$.useState(!1),[Ce,xe]=$.useState(""),[je,ke]=$.useState(""),[Le,Ve]=$.useState(""),[ct,dt]=$.useState(""),[Be,tt]=$.useState(null),[Tt,Si]=$.useState(""),[Vt,In]=$.useState(null),[Nn,Os]=$.useState(!1),[Da,Mo]=$.useState(!1),[_l,Ta]=$.useState(""),[xr,go]=$.useState(!1),[ei,gn]=$.useState(null),[bl,Lr]=$.useState(!1),[td,vl]=$.useState(!0),[ch,Ks]=$.useState("source"),[hs,qn]=$.useState("runtime"),[kr,tn]=$.useState(""),[us,Xr]=$.useState(""),Dn=n.scopeResolved&&n.scriptStorageMode==="scope";$.useEffect(()=>{var he,ge;if(!r&&((he=s[0])!=null&&he.key)){a(s[0].key);return}r&&!s.some(Pe=>Pe.key===r)&&a(((ge=s[0])==null?void 0:ge.key)||"")},[s,r]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(E0e,JSON.stringify(s))}catch{}},[s]);const Yg=$.useMemo(()=>{const he=l.trim().toLowerCase();return he?s.filter(ge=>[ge.scriptId,ge.revision,ge.baseRevision].join(" ").toLowerCase().includes(he)):s},[s,l]),_c=$.useMemo(()=>{const he=l.trim().toLowerCase();return he?d.filter(ge=>{var Pe,We;return[((Pe=ge.script)==null?void 0:Pe.scriptId)||"",((We=ge.script)==null?void 0:We.activeRevision)||"",ge.scopeId||""].join(" ").toLowerCase().includes(he)}):d},[d,l]),X=$.useMemo(()=>s.find(he=>he.key===r)||s[0]||null,[s,r]),wl=$.useMemo(()=>Be?Tl(Be,Tt||Be.entrySourcePath):null,[Tt,Be]),Cn=$.useMemo(()=>X?rK(X.package):[],[X]),Ii=$.useMemo(()=>X?Tl(X.package,X.selectedFilePath):null,[X]),Qr=$.useMemo(()=>{var he,ge;return(ge=(he=X==null?void 0:X.scopeDetail)==null?void 0:he.source)!=null&&ge.sourceText?pQ(X.scopeDetail.source.sourceText):null},[(M_=(Cx=X==null?void 0:X.scopeDetail)==null?void 0:Cx.source)==null?void 0:M_.sourceText]),Qe=$.useMemo(()=>{var Pe,We;const he=((We=(Pe=X==null?void 0:X.scopeDetail)==null?void 0:Pe.script)==null?void 0:We.scriptId)||"";if(he&&u[he])return u[he];const ge=(X==null?void 0:X.scriptId)||"";return ge&&u[ge]||null},[u,(A_=(mh=X==null?void 0:X.scopeDetail)==null?void 0:mh.script)==null?void 0:A_.scriptId,X==null?void 0:X.scriptId]),dh=$.useMemo(()=>Object.values(m).sort((he,ge)=>{const Pe=(Qe==null?void 0:Qe.lastProposalId)===he.proposalId?1:0,We=(Qe==null?void 0:Qe.lastProposalId)===ge.proposalId?1:0;return Pe!==We?We-Pe:ge.candidateRevision.localeCompare(he.candidateRevision)}),[Qe==null?void 0:Qe.lastProposalId,m]),fi=$.useMemo(()=>{var he;return kr?g.find(ge=>ge.actorId===kr)||(((he=X==null?void 0:X.lastSnapshot)==null?void 0:he.actorId)===kr?X.lastSnapshot:null):X!=null&&X.lastSnapshot?X.lastSnapshot:X!=null&&X.runtimeActorId&&g.find(ge=>ge.actorId===X.runtimeActorId)||null},[g,X==null?void 0:X.lastSnapshot,X==null?void 0:X.runtimeActorId,kr]),gi=$.useMemo(()=>{var he;return us?m[us]||(((he=X==null?void 0:X.lastPromotion)==null?void 0:he.proposalId)===us?X.lastPromotion:null):X!=null&&X.lastPromotion?X.lastPromotion:Qe!=null&&Qe.lastProposalId&&m[Qe.lastProposalId]||null},[Qe==null?void 0:Qe.lastProposalId,m,X==null?void 0:X.lastPromotion,us]),Ra=Vut(fi),Jo=$ut(ei,xr),po=$.useMemo(()=>zut(ei,(Ii==null?void 0:Ii.path)||(ei==null?void 0:ei.primarySourcePath)||"Behavior.cs"),[Ii==null?void 0:Ii.path,ei]),er=(ei==null?void 0:ei.diagnostics)||[],id=xr||ei!=null,Tn=k0e(X);$.useEffect(()=>{gn(null),Lr(!1)},[X==null?void 0:X.key]),$.useEffect(()=>{var ge;const he=(ge=t.current)==null?void 0:ge.getModel();if(he)return zk.setModelMarkers(he,"aevatar-script-validation",po),()=>{zk.setModelMarkers(he,"aevatar-script-validation",[])}},[po,X==null?void 0:X.key]),$.useEffect(()=>{if(!X)return;const he=i.current+1;i.current=he;const ge=new AbortController,Pe=window.setTimeout(async()=>{go(!0);try{const We=await xl.validateDraftScript({scriptId:X.scriptId,scriptRevision:X.revision,package:X.package},ge.signal);if(i.current!==he)return;gn(We)}catch(We){if(ge.signal.aborted||i.current!==he)return;gn({success:!1,scriptId:X.scriptId,scriptRevision:X.revision,primarySourcePath:X.selectedFilePath||"Behavior.cs",errorCount:1,warningCount:0,diagnostics:[{severity:"error",code:"SCRIPT_VALIDATION_REQUEST",message:(We==null?void 0:We.message)||"Validation request failed.",filePath:"",startLine:null,startColumn:null,endLine:null,endColumn:null,origin:"host"}]})}finally{i.current===he&&go(!1)}},320);return()=>{ge.abort(),window.clearTimeout(Pe)}},[X==null?void 0:X.key,X==null?void 0:X.scriptId,X==null?void 0:X.revision,X==null?void 0:X.selectedFilePath,X==null?void 0:X.package]),$.useEffect(()=>{if(!Dn){h([]),f({}),b({});return}rt(!0)},[Dn,n.scopeId]),$.useEffect(()=>{if(!n.scriptsEnabled){p([]);return}Rn(!0)},[n.scriptsEnabled]),$.useEffect(()=>{const he=ge=>{ge.altKey||ge.shiftKey||!(ge.metaKey||ge.ctrlKey)||ge.key.toLowerCase()!=="s"||(ge.preventDefault(),I_())};return window.addEventListener("keydown",he),()=>window.removeEventListener("keydown",he)},[X==null?void 0:X.key,X==null?void 0:X.scriptId,X==null?void 0:X.revision,X==null?void 0:X.package,X==null?void 0:X.baseRevision,Dn]),$.useEffect(()=>{var he,ge;if(X&&(tn(((he=X.lastSnapshot)==null?void 0:he.actorId)||X.runtimeActorId||""),Xr(((ge=X.lastPromotion)==null?void 0:ge.proposalId)||""),!(hs==="runtime"&&(X.lastRun||X.lastSnapshot))&&!(hs==="save"&&X.scopeDetail)&&!(hs==="promotion"&&X.lastPromotion))){if(X.lastRun||X.lastSnapshot){qn("runtime");return}if(X.scopeDetail){qn("save");return}X.lastPromotion&&qn("promotion")}},[X==null?void 0:X.key,X==null?void 0:X.lastRun,X==null?void 0:X.lastSnapshot,X==null?void 0:X.scopeDetail,X==null?void 0:X.lastPromotion,hs]);const Er=he=>{he.editor.defineTheme("aevatar-script-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"8D7B68"},{token:"keyword",foreground:"9B4D19",fontStyle:"bold"},{token:"string",foreground:"356A4C"},{token:"number",foreground:"A05A24"},{token:"type.identifier",foreground:"315A84"}],colors:{"editor.background":"#FCFBF8","editor.foreground":"#2A2723","editorLineNumber.foreground":"#B6AA99","editorLineNumber.activeForeground":"#6A5E4E","editorLineNumber.dimmedForeground":"#D5CCC0","editor.lineHighlightBackground":"#F5EFE5","editor.selectionBackground":"#DCE8FF","editor.inactiveSelectionBackground":"#ECF2FF","editorCursor.foreground":"#C06836","editorWhitespace.foreground":"#E7DED2","editorIndentGuide.background1":"#EDE5D9","editorIndentGuide.activeBackground1":"#D4C8B8","editorOverviewRuler.border":"#00000000","editorGutter.background":"#FCFBF8","editorWidget.background":"#FFFCF8","editorWidget.border":"#E7DED4","scrollbarSlider.background":"#D8CCBD88","scrollbarSlider.hoverBackground":"#C8B9A588","scrollbarSlider.activeBackground":"#B7A59188"}})},mo=he=>{t.current=he;const ge=he.getModel();ge&&zk.setModelMarkers(ge,"aevatar-script-validation",po)};function Wu(he){var Pe,We,Mt;const ge=he.filePath||(X==null?void 0:X.selectedFilePath)||"";if(X&&ge&&ge!==X.selectedFilePath){Ks("source"),Hn(X.key,at=>({...at,selectedFilePath:ge})),window.setTimeout(()=>Wu(he),0);return}!he.startLine||!he.startColumn||(Ks("source"),(Pe=t.current)==null||Pe.revealPositionInCenter({lineNumber:he.startLine,column:he.startColumn}),(We=t.current)==null||We.setPosition({lineNumber:he.startLine,column:he.startColumn}),(Mt=t.current)==null||Mt.focus())}function Hn(he,ge){o(Pe=>Pe.map(We=>We.key===he?{...ge(We),updatedAtUtc:new Date().toISOString()}:We))}function nd(){const he=N0(s.length+1);o(ge=>[he,...ge]),a(he.key)}function hh(he){X&&(Hn(X.key,ge=>({...ge,selectedFilePath:he})),Ks("source"),vl(!0))}function Zg(he){if(!X)return;const ge=he==="csharp"?`NewFile${X.package.csharpSources.length+1}.cs`:`schema${X.package.protoFiles.length+1}.proto`,Pe=window.prompt(`Add ${he==="csharp"?"C#":"proto"} file`,ge);if(!(Pe!=null&&Pe.trim()))return;const We=Dut(X.package,he,Pe.trim()),Mt=Tl(We,Pe.trim());Hn(X.key,at=>({...at,package:We,selectedFilePath:(Mt==null?void 0:Mt.path)||at.selectedFilePath})),Ks("source"),vl(!0)}function Ct(he){if(!X)return;const ge=window.prompt("Rename file",he);if(!(ge!=null&&ge.trim())||ge.trim()===he)return;const Pe=Tut(X.package,he,ge.trim()),We=Tl(Pe,ge.trim());Hn(X.key,Mt=>({...Mt,package:Pe,selectedFilePath:Mt.selectedFilePath===he&&(We==null?void 0:We.path)||Mt.selectedFilePath})),vl(!0)}function ae(he){if(!X)return;const ge=Rut(X.package,he),Pe=Tl(ge,X.selectedFilePath);Hn(X.key,We=>({...We,package:ge,selectedFilePath:(Pe==null?void 0:Pe.path)||""}))}function Ee(he){X&&(Hn(X.key,ge=>({...ge,package:Mut(ge.package,he),selectedFilePath:he})),vl(!0))}async function rt(he=!1){if(Dn){w(!0);try{const ge=await xl.listScripts(!0),Pe=Array.isArray(ge)?[...ge].sort((We,Mt)=>{var yt,Lt;const at=Date.parse(((yt=Mt.script)==null?void 0:yt.updatedAt)||""),zt=Date.parse(((Lt=We.script)==null?void 0:Lt.updatedAt)||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(zt)?0:zt)}):[];h(Pe),await Et(Pe),he||e("Scope scripts refreshed","success")}catch(ge){he||e((ge==null?void 0:ge.message)||"Failed to load saved scripts","error")}finally{w(!1)}}}async function Et(he){const ge=Array.from(new Set(he.map(Pe=>{var We;return((We=Pe.script)==null?void 0:We.scriptId)||""}).filter(Boolean)));if(ge.length===0){f({}),b({});return}x(!0);try{const Pe=await Promise.all(ge.map(async yt=>{try{const Lt=await xl.getScriptCatalog(yt);return[yt,Lt]}catch{return null}})),We={},Mt=new Set;for(const yt of Pe)yt!=null&&yt[1]&&(We[yt[0]]=yt[1],yt[1].lastProposalId&&Mt.add(yt[1].lastProposalId));if(f(We),Mt.size===0){b({});return}const at=await Promise.all(Array.from(Mt).map(async yt=>{try{const Lt=await xl.getEvolutionDecision(yt);return[yt,Lt]}catch{return null}})),zt={};for(const yt of at)yt!=null&&yt[1]&&(zt[yt[0]]=yt[1]);b(zt)}finally{x(!1)}}async function Rn(he=!1){S(!0);try{const ge=await xl.listScriptRuntimes(24),Pe=Array.isArray(ge)?[...ge].sort((We,Mt)=>{const at=Date.parse(Mt.updatedAt||""),zt=Date.parse(We.updatedAt||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(zt)?0:zt)}):[];p(Pe),he||e("Runtime snapshots refreshed","success")}catch(ge){he||e((ge==null?void 0:ge.message)||"Failed to load runtime snapshots","error")}finally{S(!1)}}function li(he){p(ge=>{const Pe=ge.filter(We=>We.actorId!==he.actorId);return Pe.unshift(he),Pe.sort((We,Mt)=>{const at=Date.parse(Mt.updatedAt||""),zt=Date.parse(We.updatedAt||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(zt)?0:zt)})})}function Ls(he){var at,zt,yt;const ge=((at=he.script)==null?void 0:at.scriptId)||((zt=he.source)==null?void 0:zt.revision)||`script-${s.length+1}`,Pe=of(ge,"script"),We=s.find(Lt=>of(Lt.scriptId,"script")===Pe),Mt=qut(he,s.length+1,We);We?(o(Lt=>Lt.map(Mn=>Mn.key===We.key?Mt:Mn)),a(We.key)):(o(Lt=>[Mt,...Lt]),a(Mt.key)),qn("save"),Xr(((yt=u[ge])==null?void 0:yt.lastProposalId)||""),e("Saved script loaded into the editor","success")}async function ks(he,ge=!1){const Pe=he.trim();if(!Pe)return ge||e("Run the draft first","info"),null;M(!0);try{const We=await xl.getRuntimeReadModel(Pe);return o(Mt=>Mt.map(at=>at.runtimeActorId===We.actorId?{...at,lastSnapshot:We,runtimeActorId:We.actorId||at.runtimeActorId,definitionActorId:We.definitionActorId||at.definitionActorId,updatedAtUtc:new Date().toISOString()}:at)),li(We),tn(We.actorId||Pe),qn("runtime"),ge||ju("activity"),ge||e("Runtime snapshot refreshed","success"),We}catch(We){return ge||e((We==null?void 0:We.message)||"Failed to load runtime snapshot","error"),null}finally{M(!1)}}async function Ir(he){const ge=he.trim();if(!ge)return null;for(let Pe=0;Pe<6;Pe+=1){const We=await ks(ge,!0);if(We)return We;await Kut(320)}return null}async function Hu(he){tn(he),qn("runtime"),ju("activity"),g.find(Pe=>Pe.actorId===he)||await ks(he,!0)}function Qn(he){Xr(he),qn("promotion"),ju("activity")}async function Vu(){var ge,Pe;const he=((Pe=(ge=X==null?void 0:X.scopeDetail)==null?void 0:ge.script)==null?void 0:Pe.scriptId)||(X==null?void 0:X.scriptId)||"";if(!(!Dn||!he))try{const We=await xl.getScriptCatalog(he);if(f(Mt=>({...Mt,[he]:We})),We.lastProposalId)try{const Mt=await xl.getEvolutionDecision(We.lastProposalId);b(at=>({...at,[We.lastProposalId]:Mt}))}catch{}e("Catalog history refreshed","success")}catch(We){e((We==null?void 0:We.message)||"Failed to load catalog history","error")}}async function uh(){var ge;const he=(gi==null?void 0:gi.proposalId)||(Qe==null?void 0:Qe.lastProposalId)||((ge=X==null?void 0:X.lastPromotion)==null?void 0:ge.proposalId)||"";if(he){x(!0);try{const Pe=await xl.getEvolutionDecision(he);b(We=>({...We,[he]:Pe})),Xr(he),e("Proposal decision refreshed","success")}catch(Pe){e((Pe==null?void 0:Pe.message)||"Failed to load proposal decision","error")}finally{x(!1)}}}async function I_(){var Mt;if(!X)return;const he=KL(X.package);if(!he.trim()){e("Script source is required","error");return}if(!Dn){e("Draft is already stored locally on this device","success");return}const ge=of(X.scriptId,"script"),Pe=of(X.revision,"draft"),We=(X.baseRevision||"").trim()||void 0;W(!0);try{const at=await xl.saveScript({scriptId:ge,revisionId:Pe,expectedBaseRevision:We,package:X.package}),zt=jN(null,((Mt=at.source)==null?void 0:Mt.sourceText)||he).package,yt=Tl(zt,X.selectedFilePath);Hn(X.key,Lt=>{var Mn,P_,O_,Jn,tp,od,F_,B_,bc;return{...Lt,scriptId:((Mn=at.script)==null?void 0:Mn.scriptId)||ge,revision:((P_=at.script)==null?void 0:P_.activeRevision)||((O_=at.source)==null?void 0:O_.revision)||Pe,baseRevision:((Jn=at.script)==null?void 0:Jn.activeRevision)||((tp=at.source)==null?void 0:tp.revision)||Pe,package:zt,selectedFilePath:(yt==null?void 0:yt.path)||Lt.selectedFilePath,definitionActorId:((od=at.script)==null?void 0:od.definitionActorId)||((F_=at.source)==null?void 0:F_.definitionActorId)||Lt.definitionActorId,lastSourceHash:((B_=at.source)==null?void 0:B_.sourceHash)||((bc=at.script)==null?void 0:bc.activeSourceHash)||Lt.lastSourceHash,scopeDetail:at}}),qn("save"),ju("activity"),Xr(""),await rt(!0),e("Script saved to the current scope","success")}catch(at){e((at==null?void 0:at.message)||"Failed to save script","error")}finally{W(!1)}}async function vx(he){var ge;if(!he.trim())return e("Nothing to copy","info"),!1;if(!((ge=navigator.clipboard)!=null&&ge.writeText))return e("Clipboard is unavailable in this browser context","error"),!1;try{return await navigator.clipboard.writeText(he),!0}catch(Pe){return e((Pe==null?void 0:Pe.message)||"Failed to copy to clipboard","error"),!1}}function wx(){X&&(Ta(X.input),Mo(!0))}async function Cl(){X&&await Qw(_l)}async function Qw(he){if(!X)return;const ge=jN(X.package);if(!KL(ge.package).trim()){e("Script source is required","error");return}const We=of(X.scriptId,"script"),Mt=of(X.revision,"draft");ge.migrated&&Hn(X.key,at=>({...at,package:ge.package,selectedFilePath:ge.package.entrySourcePath||at.selectedFilePath,definitionActorId:"",runtimeActorId:"",lastSourceHash:"",lastRun:null,lastSnapshot:null,lastPromotion:null,scopeDetail:null})),Hn(X.key,at=>({...at,input:he})),I(!0);try{const at=await xl.runDraftScript({scriptId:We,scriptRevision:Mt,package:ge.package,input:he,definitionActorId:ge.migrated?"":X.definitionActorId,runtimeActorId:ge.migrated?"":X.runtimeActorId});Hn(X.key,yt=>({...yt,input:he,scriptId:at.scriptId||We,revision:at.scriptRevision||Mt,definitionActorId:at.definitionActorId||yt.definitionActorId,runtimeActorId:at.runtimeActorId||yt.runtimeActorId,lastSourceHash:at.sourceHash||yt.lastSourceHash,lastRun:at})),Mo(!1),qn("runtime"),ju("activity"),tn(at.runtimeActorId||"");const zt=await Ir(at.runtimeActorId||"");await Rn(!0),e(zt?"Draft run completed":"Draft accepted. Runtime snapshot is catching up.",zt?"success":"info")}catch(at){e((at==null?void 0:at.message)||"Draft run failed","error")}finally{I(!1)}}async function Xg(){var at,zt;if(!X)return;if(!KL(X.package).trim()){e("Script source is required","error");return}const ge=of(X.scriptId,"script"),Pe=of(X.revision,"draft"),We=(X.baseRevision||((zt=(at=X.scopeDetail)==null?void 0:at.script)==null?void 0:zt.activeRevision)||"").trim(),Mt=We?of(We,"base"):"";B(!0);try{const yt=await uRe.proposeEvolution({scriptId:ge,baseRevision:Mt,candidateRevision:Pe,candidatePackage:X.package,candidateSourceHash:"",reason:X.reason,proposalId:`${ge}-${Pe}-${Date.now()}`});Hn(X.key,Lt=>({...Lt,scriptId:ge,revision:Pe,baseRevision:yt!=null&&yt.accepted?Pe:Lt.baseRevision,lastPromotion:yt})),b(Lt=>({...Lt,[yt.proposalId]:yt})),Xr(yt.proposalId||""),Y(!1),qn("promotion"),ju("activity"),Dn&&await rt(!0),e(yt!=null&&yt.accepted?"Promotion accepted":(yt==null?void 0:yt.failureReason)||"Promotion rejected",yt!=null&&yt.accepted?"success":"error")}catch(yt){e((yt==null?void 0:yt.message)||"Promotion failed","error")}finally{B(!1)}}async function fh(){if(!X)return;if(!Ce.trim()){e("Describe the script you want","error");return}const he=X.key;In(he),Os(!0),ke(""),Ve(""),dt(""),tt(null),Si("");try{const ge=await $fe.authorScript({prompt:Ce.trim(),currentSource:(Ii==null?void 0:Ii.content)||"",currentPackage:X.package,currentFilePath:X.selectedFilePath,metadata:{script_id:X.scriptId,revision:X.revision}},{onReasoning:zt=>ke(zt),onText:zt=>Ve(zt)}),Pe=Nut(ge.scriptPackage),We=ge.currentFilePath||X.selectedFilePath,Mt=Pe?Tl(Pe,We):null,at=(Mt==null?void 0:Mt.content)||ge.text||"";Ve(ge.text||at),dt(at),tt(Pe),Si((Mt==null?void 0:Mt.path)||We),e(Pe?"AI package is ready to apply":"AI source is ready to apply","success")}catch(ge){e((ge==null?void 0:ge.message)||"Failed to generate script source","error")}finally{Os(!1)}}function N_(){const he=Vt||(X==null?void 0:X.key)||"";if(!he){e("Open a draft before applying generated source","error");return}if(!ct.trim()){e("Generate source before applying it","info");return}if(!s.find(Pe=>Pe.key===he)){e("The original draft is no longer available","error");return}Hn(he,Pe=>{var We;return{...Pe,package:Be||gce(Pe.package,Pe.selectedFilePath,ct),selectedFilePath:Be&&((We=Tl(Be,Tt||Pe.selectedFilePath))==null?void 0:We.path)||Pe.selectedFilePath}}),a(he),Ks("source"),e(Be?"AI package applied to the editor":"AI source applied to the editor","success")}async function Qg(){await vx(ct)&&e("Generated source copied","success")}if(!X)return null;if(!n.scriptsEnabled)return y.jsx("section",{className:"flex-1 min-h-0 bg-[#F2F1EE] p-6",children:y.jsx("div",{className:"flex h-full items-center justify-center rounded-[32px] border border-[#E6E3DE] bg-white/96 p-8 shadow-[0_26px_64px_rgba(17,24,39,0.08)]",children:y.jsxs("div",{className:"max-w-[360px] text-center",children:[y.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-[18px] bg-[#F3F0EA] text-gray-400",children:y.jsx(YE,{size:20})}),y.jsx("div",{className:"mt-4 text-[18px] font-semibold text-gray-800",children:"Scripts unavailable"})]})})});const zu=Array.isArray((Jg=gi==null?void 0:gi.validationReport)==null?void 0:Jg.diagnostics)?((ep=gi==null?void 0:gi.validationReport)==null?void 0:ep.diagnostics)||[]:[],Jw=fi?`${Ra.status||"updated"} · ${Ra.output||"output pending"}`:X.lastRun?`Accepted · ${X.lastRun.runId}`:"Run the draft to materialize output.",eC=Dn?Qe?`${Qe.scriptId} · ${Qe.activeRevision}`:(yx=X.scopeDetail)!=null&&yx.script?`${X.scopeDetail.script.scriptId} · ${X.scopeDetail.script.activeRevision}`:"Save this draft into the current scope.":"Local draft only. Sign in to save it into a scope.",D_=gi?`${gi.status||"unknown"}${gi.failureReason?` · ${gi.failureReason}`:""}`:Qe!=null&&Qe.lastProposalId?`Latest proposal · ${Qe.lastProposalId}`:"Submit a promotion proposal when this draft is ready.",T_=((Uu=($u=X.scopeDetail)==null?void 0:$u.script)==null?void 0:Uu.scriptId)||"",tC=td,gh=ch==="package",sd=gh?"package":V?"panels":null,iC=sd!==null,yl=(he=!1)=>`rounded-full border px-3 py-1.5 text-[11px] uppercase tracking-[0.14em] transition-colors ${he?"border-[color:var(--accent-border)] bg-[#FFF4F1] text-[color:var(--accent-text)]":"border-[#E5DED3] bg-white text-gray-500 hover:bg-[#F9F6F0]"}`;function ju(he){j(he),K(!0),Ks("source")}function nC(he){if(he==="panels"){if(V&&!gh){K(!1);return}Ks("source"),K(!0);return}if(gh){Ks("source");return}K(!1),Ks("package")}function UD(){if(gh){Ks("source");return}K(!1)}function ph(){var he,ge,Pe,We,Mt,at,zt,yt,Lt,Mn,P_,O_,Jn,tp,od,F_,B_,bc;return hs==="runtime"?X.lastRun||fi?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Runtime output"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:(fi==null?void 0:fi.actorId)||((he=X.lastRun)==null?void 0:he.runId)||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[fi!=null&&fi.actorId||X.runtimeActorId?y.jsx("button",{type:"button",onClick:()=>{ks((fi==null?void 0:fi.actorId)||X.runtimeActorId)},className:"panel-icon-button execution-logs-copy-action",title:"Refresh runtime result","aria-label":"Refresh runtime result",disabled:R,children:y.jsx(rk,{size:14,className:R?"animate-spin":""})}):null,y.jsx("div",{className:"rounded-full border border-[#E5DED3] bg-white px-3 py-1 text-[11px] uppercase tracking-[0.14em] text-gray-500",children:Ra.status||((ge=X.lastRun)!=null&&ge.accepted?"accepted":"pending")})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Input"}),y.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Ra.input||X.input||"-"})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Output"}),y.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Ra.output||"-"})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Runtime details"}),y.jsxs("div",{className:"mt-3 grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Notes"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:Ra.notes.length>0?Ra.notes.join(", "):"-"})]}),y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Metadata"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",(fi==null?void 0:fi.scriptId)||X.scriptId||"-"]}),y.jsxs("div",{children:["runtimeActorId: ",(fi==null?void 0:fi.actorId)||X.runtimeActorId||"-"]}),y.jsxs("div",{children:["definitionActorId: ",(fi==null?void 0:fi.definitionActorId)||X.definitionActorId||"-"]}),y.jsxs("div",{children:["stateVersion: ",(fi==null?void 0:fi.stateVersion)??"-"]}),y.jsxs("div",{children:["updatedAt: ",Fl(fi==null?void 0:fi.updatedAt)]})]})]})]}),y.jsx("pre",{className:"mt-4 max-h-[320px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Uut(fi==null?void 0:fi.readModelPayloadJson)})]})]}):y.jsx(Jh,{title:"No runtime output yet",copy:"Run the current draft. The materialized read model will appear here."}):hs==="save"?Dn?Qe||(Pe=X.scopeDetail)!=null&&Pe.script?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Catalog state"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:(Qe==null?void 0:Qe.scopeId)||((We=X.scopeDetail)==null?void 0:We.scopeId)||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>{Vu()},className:"panel-icon-button execution-logs-copy-action",title:"Refresh catalog history","aria-label":"Refresh catalog history",children:y.jsx(rk,{size:14})}),y.jsx("div",{className:`rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.14em] ${Tn?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]"}`,children:Tn?"Unsaved changes":"Saved"})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Script"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",(Qe==null?void 0:Qe.scriptId)||((at=(Mt=X.scopeDetail)==null?void 0:Mt.script)==null?void 0:at.scriptId)||"-"]}),y.jsxs("div",{children:["revision: ",(Qe==null?void 0:Qe.activeRevision)||((yt=(zt=X.scopeDetail)==null?void 0:zt.script)==null?void 0:yt.activeRevision)||"-"]}),y.jsxs("div",{children:["updatedAt: ",Fl((Qe==null?void 0:Qe.updatedAt)||((Mn=(Lt=X.scopeDetail)==null?void 0:Lt.script)==null?void 0:Mn.updatedAt))]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Actors"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["catalogActorId: ",(Qe==null?void 0:Qe.catalogActorId)||((O_=(P_=X.scopeDetail)==null?void 0:P_.script)==null?void 0:O_.catalogActorId)||"-"]}),y.jsxs("div",{children:["definitionActorId: ",(Qe==null?void 0:Qe.activeDefinitionActorId)||((tp=(Jn=X.scopeDetail)==null?void 0:Jn.script)==null?void 0:tp.definitionActorId)||"-"]}),y.jsxs("div",{children:["sourceHash: ",(Qe==null?void 0:Qe.activeSourceHash)||((F_=(od=X.scopeDetail)==null?void 0:od.script)==null?void 0:F_.activeSourceHash)||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"History and stored package"}),y.jsxs("div",{className:"mt-3 grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Revision History"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:(B_=Qe==null?void 0:Qe.revisionHistory)!=null&&B_.length?Qe.revisionHistory.join(" → "):(Qe==null?void 0:Qe.activeRevision)||"-"}),y.jsxs("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:["latestProposal: ",(Qe==null?void 0:Qe.lastProposalId)||"-"]})]}),y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Stored Package"}),y.jsxs("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:["files: ",Qr?rK(Qr).length:0," · entry: ",(Qr==null?void 0:Qr.entrySourcePath)||"-"]}),y.jsx("pre",{className:"mt-3 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Qr&&((bc=Tl(Qr,Qr.entrySourcePath))==null?void 0:bc.content)||"-"})]})]})]})]}):y.jsx(Jh,{title:"Not saved into the scope",copy:"Use Save to persist this draft and make it show up in the saved scripts list."}):y.jsx(Jh,{title:"Scope save unavailable",copy:"This app session does not have a resolved scope. The draft is still kept locally in your browser storage."}):gi?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Promotion proposal"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:gi.proposalId||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>{uh()},className:"panel-icon-button execution-logs-copy-action",title:"Refresh proposal decision","aria-label":"Refresh proposal decision",disabled:L,children:y.jsx(rk,{size:14,className:L?"animate-spin":""})}),y.jsx("div",{className:`rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.14em] ${gi.accepted?"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]":"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]"}`,children:gi.status||(gi.accepted?"accepted":"rejected")})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Revision"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["base: ",gi.baseRevision||"-"]}),y.jsxs("div",{children:["candidate: ",gi.candidateRevision||"-"]}),y.jsxs("div",{children:["scriptId: ",gi.scriptId||"-"]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Decision"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["catalogActorId: ",gi.catalogActorId||(Qe==null?void 0:Qe.catalogActorId)||"-"]}),y.jsxs("div",{children:["definitionActorId: ",gi.definitionActorId||"-"]}),y.jsxs("div",{children:["failureReason: ",gi.failureReason||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Validation diagnostics"}),zu.length>0?y.jsx("div",{className:"mt-3 space-y-2",children:zu.map((_i,ip)=>y.jsx("div",{className:"rounded-[16px] border border-[#EEEAE4] bg-[#FAF8F4] px-3 py-3 text-[12px] leading-6 text-gray-600",children:_i},`${_i}-${ip}`))}):y.jsx("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:"No validation diagnostics were returned."})]})]}):y.jsx(Jh,{title:"No promotion submitted",copy:Qe!=null&&Qe.lastProposalId?"The scope catalog points at a proposal id, but no terminal decision is visible yet.":"When the draft is stable, use Promote to send an evolution proposal and inspect the decision here."})}function R_(){var he,ge,Pe;return z==="library"?y.jsx("div",{className:"h-full min-h-0 overflow-hidden p-4",children:y.jsx(Fut,{drafts:s,filteredDrafts:Yg,filteredScopeScripts:_c,runtimeSnapshots:g,proposalDecisions:dh,scopeCatalogsByScriptId:u,selectedDraft:X,scopeSelectionId:T_,selectedRuntimeActorId:kr,selectedProposalId:us,search:l,scopeBacked:Dn,scopeId:n.scopeId,scopeScriptsPending:v,runtimeSnapshotsPending:C,proposalDecisionsPending:L,onSearchChange:c,onCreateDraft:nd,onSelectDraft:a,onOpenScopeScript:Ls,onRefreshScopeScripts:()=>{rt()},onSelectRuntime:We=>{Hu(We)},onRefreshRuntimeSnapshots:()=>{Rn()},onSelectProposal:Qn})}):z==="details"?y.jsx("div",{className:"h-full min-h-0 overflow-hidden p-4",children:y.jsx(Put,{selectedDraft:X,scopeBacked:Dn,appContext:n})}):y.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:y.jsxs("div",{className:"space-y-3",children:[y.jsx(M6,{active:hs==="runtime",title:"Draft Run",meta:fi?Fl(fi.updatedAt):X.lastRun?Fl(X.updatedAtUtc):"Not run yet",summary:Jw,status:Ra.status||((he=X.lastRun)!=null&&he.accepted?"accepted":""),onClick:()=>qn("runtime")}),y.jsx(M6,{active:hs==="save",title:"Catalog",meta:Qe?Fl(Qe.updatedAt):(ge=X.scopeDetail)!=null&&ge.script?Fl(X.scopeDetail.script.updatedAt):Dn?"Not saved yet":"Local only",summary:eC,status:Dn?Tn?"dirty":Qe||(Pe=X.scopeDetail)!=null&&Pe.script?"saved":"pending":"local",onClick:()=>qn("save")}),y.jsx(M6,{active:hs==="promotion",title:"Promotion",meta:(gi==null?void 0:gi.candidateRevision)||(Qe==null?void 0:Qe.lastProposalId)||"No candidate",summary:D_,status:(gi==null?void 0:gi.status)||"",onClick:()=>qn("promotion")}),y.jsx("div",{className:"rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:ph()})]})})}function sC(){return y.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid gap-4",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Entry contract"}),y.jsxs("div",{className:"mt-3 space-y-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Entry Behavior Type"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"DraftBehavior",value:X.package.entryBehaviorTypeName,onChange:he=>Hn(X.key,ge=>({...ge,package:Aut(ge.package,he.target.value)}))})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Entry Source Path"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:X.package.entrySourcePath||"-"})]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Package summary"}),y.jsxs("div",{className:"mt-3 space-y-2 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["format: ",X.package.format]}),y.jsxs("div",{children:["csharp files: ",X.package.csharpSources.length]}),y.jsxs("div",{children:["proto files: ",X.package.protoFiles.length]}),y.jsxs("div",{children:["selected file: ",X.selectedFilePath||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[20px] border border-[#EEEAE4] bg-white px-4 py-4",open:!0,children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Persisted source preview"}),y.jsx("pre",{className:"mt-3 max-h-[420px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:KL(X.package)||"-"})]})]})})}return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"studio-editor-header",children:y.jsx("div",{className:"studio-editor-toolbar",children:y.jsxs("div",{className:"studio-title-bar",children:[y.jsxs("div",{className:"studio-title-group",children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"panel-eyebrow",children:"Scripts Studio"}),y.jsx("input",{className:"studio-title-input mt-1",value:X.scriptId,onChange:he=>Hn(X.key,ge=>({...ge,scriptId:he.target.value})),placeholder:"script-id","aria-label":"Script ID"}),y.jsxs("div",{className:"mt-0.5 flex items-center gap-2 overflow-hidden text-[11px] text-gray-400",children:[y.jsx("span",{className:"truncate",children:X.revision||"draft revision"}),y.jsx("span",{"aria-hidden":"true",children:"·"}),y.jsx("span",{className:"truncate",children:n.hostMode==="embedded"?"Embedded host":"Proxy host"}),y.jsx("span",{"aria-hidden":"true",children:"·"}),y.jsx("span",{className:"truncate",children:Dn?`Scope ${n.scopeId||"-"}`:"Local draft"})]})]}),id?y.jsx("div",{className:`rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-[0.14em] ${xr?"border-[#E5DED3] bg-[#F7F2E8] text-[#8E6A3D]":ei!=null&&ei.errorCount?"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]":ei!=null&&ei.warningCount?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#D9E5CB] bg-[#F5FBEE] text-[#5C7A2D]"}`,children:Jo}):null]}),y.jsxs("div",{className:"studio-header-actions",children:[y.jsx("button",{type:"button",onClick:()=>Y(!0),"data-tooltip":"Promote","aria-label":"Promote",className:"panel-icon-button header-toolbar-action header-export-action",children:y.jsx(Op,{size:15})}),y.jsx("button",{type:"button",onClick:()=>{I_()},"data-tooltip":Dn?"Save":"Save local","aria-label":Dn?"Save script":"Save local draft",disabled:A,className:"panel-icon-button header-toolbar-action header-save-action",children:y.jsx(oRe,{size:15})}),y.jsx("button",{type:"button",onClick:wx,"data-tooltip":"Run","aria-label":"Run script",disabled:E,className:"panel-icon-button header-toolbar-action header-run-action",children:y.jsx(s0,{size:15})})]})]})})}),y.jsxs("section",{className:"relative flex-1 min-h-0 overflow-hidden bg-[#F2F1EE]",children:[y.jsx("div",{className:"absolute inset-0 p-4 sm:p-5",children:y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-[#EEEAE4] bg-[#FAF8F4] px-5 py-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Editor"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:(Ii==null?void 0:Ii.path)||X.selectedFilePath||"Behavior.cs"})]}),y.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2",children:y.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.14em] text-gray-400",children:[Tn?y.jsx("span",{className:"rounded-full border border-[#E9D6AE] bg-[#FFF7E6] px-3 py-1 text-[#9B6A1C]",children:"Unsaved scope changes"}):null,y.jsx("span",{children:Fl(X.updatedAtUtc)})]})})]}),y.jsx("div",{className:"min-h-0 flex-1 bg-[#FCFBF8]",children:y.jsxs("div",{className:"flex h-full min-h-0",children:[y.jsx("div",{className:tC?"w-[268px] min-w-[240px] max-w-[320px]":"w-[56px] min-w-[56px] max-w-[56px]",children:y.jsx(Out,{entries:Cn,selectedFilePath:(Ii==null?void 0:Ii.path)||X.selectedFilePath,entrySourcePath:X.package.entrySourcePath,collapsed:!tC,onToggleCollapsed:()=>vl(he=>!he),onSelectFile:hh,onAddFile:Zg,onRenameFile:Ct,onRemoveFile:ae,onSetEntry:Ee})}),y.jsxs("div",{className:"relative min-h-0 flex-1",children:[y.jsxs("div",{className:"absolute right-4 top-4 z-20 flex items-center gap-2",children:[y.jsx(mce,{active:iC&&sd==="panels",label:"Panels",icon:y.jsx(zfe,{size:16}),onClick:()=>nC("panels")}),y.jsx(mce,{active:iC&&sd==="package",label:"Package",icon:y.jsx(Wf,{size:16}),onClick:()=>nC("package")})]}),y.jsx(CMe,{path:`file:///scripts/${X.key}/${(Ii==null?void 0:Ii.path)||(ei==null?void 0:ei.primarySourcePath)||"Behavior.cs"}`,language:(Ii==null?void 0:Ii.kind)==="proto"?"plaintext":"csharp",theme:"aevatar-script-light",value:(Ii==null?void 0:Ii.content)||"",beforeMount:Er,onMount:mo,onChange:he=>Hn(X.key,ge=>({...ge,package:gce(ge.package,ge.selectedFilePath,he??"")})),loading:y.jsx("div",{className:"flex h-full items-center justify-center text-[12px] uppercase tracking-[0.14em] text-gray-400",children:"Loading"}),options:{automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,smoothScrolling:!0,fontSize:13,lineHeight:23,fontLigatures:!0,tabSize:4,insertSpaces:!0,renderWhitespace:"selection",renderValidationDecorations:"on",lineNumbersMinChars:3,quickSuggestions:!1,suggestOnTriggerCharacters:!1,wordWrap:"off",stickyScroll:{enabled:!1},bracketPairColorization:{enabled:!0},guides:{indentation:!0,bracketPairs:!0},folding:!0,padding:{top:18,bottom:18},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10}}})]})]})}),y.jsx("div",{className:"border-t border-[#EEEAE4] bg-[#FFFCF8] px-4 py-3",children:y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Compiler"}),y.jsx("div",{className:"mt-1 truncate text-[13px] text-gray-700",children:xr?"Checking":er[0]?er[0].message:"Clean"})]}),er.length>0?y.jsxs("button",{type:"button",onClick:()=>Lr(!0),className:yl(bl),children:["Problems ",er.length]}):y.jsx("div",{className:"rounded-full border border-[#DCE8C8] bg-[#F5FBEE] px-3 py-1.5 text-[11px] uppercase tracking-[0.14em] text-[#5C7A2D]",children:"Clean"})]})})]})}),y.jsxs("aside",{className:`right-drawer ${iC?"open":""}`,children:[y.jsxs("div",{className:"panel-header border-b border-[#F1ECE5]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:sd==="package"?"Package":"Panels"}),y.jsx("div",{className:"panel-title",children:sd==="package"?"Manifest":z==="library"?"Library":z==="activity"?"Activity":"Details"})]}),y.jsx("button",{type:"button",onClick:UD,title:"Close drawer.",className:"panel-icon-button",children:y.jsx(UM,{size:16})})]}),sd==="panels"?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"border-b border-[#F1ECE5] px-4 py-3",children:y.jsxs("div",{className:"flex flex-wrap gap-2",children:[y.jsx("button",{type:"button",onClick:()=>j("library"),className:yl(z==="library"),children:"Library"}),y.jsx("button",{type:"button",onClick:()=>j("activity"),className:yl(z==="activity"),children:"Activity"}),y.jsx("button",{type:"button",onClick:()=>j("details"),className:yl(z==="details"),children:"Details"})]})}),y.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:R_()})]}):sC()]}),y.jsxs("div",{className:"absolute bottom-6 right-6 z-30 flex items-end gap-3",children:[te?y.jsxs("div",{className:"ask-ai-surface flex max-h-[calc(100%-136px)] w-[420px] flex-col overflow-hidden",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[#F1ECE5] px-4 py-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Source"}),y.jsx("div",{className:"panel-title !mt-0",children:"Ask AI"})]}),y.jsx("button",{type:"button",onClick:()=>ce(!1),title:"Close Ask AI.",className:"panel-icon-button",children:y.jsx(nv,{size:14})})]}),y.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto p-4",children:[y.jsx("p",{className:"text-[12px] leading-6 text-gray-500",children:"Describe the script change you want. Closing this panel does not stop an in-flight generation."}),y.jsx("textarea",{rows:5,className:"panel-textarea mt-4",placeholder:"Build a script that validates an email address, normalizes it, and returns a JSON summary.",value:Ce,onChange:he=>xe(he.target.value)}),y.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[11px] text-gray-400",children:Nn?"Generating and compiling file content...":ct?`Ready to apply ${Be?`${Be.csharpSources.length+Be.protoFiles.length} files`:"the active file"}`:"Return format: script package JSON"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{type:"button",onClick:()=>{Qg()},className:"ghost-action !px-3",disabled:!ct.trim(),children:[y.jsx(CR,{size:14})," Copy"]}),y.jsxs("button",{type:"button",onClick:N_,className:"ghost-action !px-3",disabled:!ct.trim(),children:[y.jsx(Op,{size:14})," Apply"]}),y.jsxs("button",{type:"button",onClick:()=>{fh()},className:"ghost-action !px-3",disabled:Nn,children:[y.jsx(iv,{size:14})," ",Nn?"Thinking":"Generate"]})]})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Thinking"}),y.jsx("pre",{className:"mt-2 max-h-[180px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-600",children:je||"LLM reasoning will stream here."})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Generated Preview"}),y.jsx("div",{className:"text-[10px] uppercase tracking-[0.16em] text-gray-400",children:ct?"Ready to apply":"Waiting for generated package"})]}),Be?y.jsxs("div",{className:"mt-2 text-[11px] leading-5 text-gray-400",children:[(wl==null?void 0:wl.path)||Tt||"-"," · ",Be.csharpSources.length," C# · ",Be.protoFiles.length," proto"]}):null,y.jsx("pre",{className:"mt-2 max-h-[240px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:ct||Le||"Generated file content will appear here."})]})]})]}):null,y.jsx("button",{type:"button",onClick:()=>ce(he=>!he),title:"Ask AI to generate script code.",className:`ask-ai-trigger flex h-14 w-14 items-center justify-center rounded-[20px] border transition-transform hover:-translate-y-0.5 ${te||Nn?"border-[color:var(--accent-border)] text-[color:var(--accent-text)]":"border-[#E8E2D9]"}`,children:y.jsx(iv,{size:20})})]})]}),y.jsx(A6,{open:bl,eyebrow:"Compiler",title:"Validation diagnostics",onClose:()=>Lr(!1),width:"min(920px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>Lr(!1),className:"ghost-action",children:"Close"}),children:y.jsx("div",{className:"min-h-[420px]",children:er.length>0?y.jsx("div",{className:"max-h-[560px] space-y-2 overflow-auto pr-1",children:er.map((he,ge)=>y.jsxs("button",{type:"button",onClick:()=>{Wu(he),Lr(!1)},className:`w-full rounded-[18px] border px-3 py-3 text-left transition-colors ${he.severity==="error"?"border-[#F3D3CD] bg-[#FFF5F2] hover:bg-[#FFF0EB]":he.severity==="warning"?"border-[#EADBB8] bg-[#FFF8EB] hover:bg-[#FFF4DE]":"border-[#E6E0D7] bg-white hover:bg-[#FBFAF7]"}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"truncate text-[12px] font-semibold uppercase tracking-[0.12em] text-gray-500",children:he.code||he.severity}),y.jsx("div",{className:"truncate text-[11px] text-gray-400",children:jut(he)})]}),y.jsx("div",{className:"mt-2 text-[13px] leading-6 text-gray-700",children:he.message})]},`${he.code}-${he.filePath}-${he.startLine}-${he.startColumn}-${ge}`))}):y.jsx(Jh,{title:"No diagnostics",copy:"The current draft validated cleanly."})})}),y.jsx(A6,{open:Q,eyebrow:"Governance",title:"Promote draft",onClose:()=>Y(!1),width:"min(760px, 100%)",actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>Y(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{type:"button",onClick:()=>{Xg()},disabled:P,className:"solid-action",children:[y.jsx(Op,{size:14})," ",P?"Promoting":"Promote"]})]}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Base Revision"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"base revision",value:X.baseRevision,onChange:he=>Hn(X.key,ge=>({...ge,baseRevision:he.target.value}))})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Candidate Revision"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"candidate revision",value:X.revision,onChange:he=>Hn(X.key,ge=>({...ge,revision:he.target.value}))})]})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Reason"}),y.jsx("textarea",{rows:5,className:"panel-textarea mt-1",placeholder:"Describe why this revision should be promoted",value:X.reason,onChange:he=>Hn(X.key,ge=>({...ge,reason:he.target.value}))})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Latest Decision"}),y.jsx("div",{className:"mt-2 text-[13px] leading-6 text-gray-700",children:X.lastPromotion?`${X.lastPromotion.status||"-"}${X.lastPromotion.failureReason?` · ${X.lastPromotion.failureReason}`:""}`:"No promotion has been submitted for this draft."}),zu.length>0?y.jsx("div",{className:"mt-4 space-y-2",children:zu.map((he,ge)=>y.jsx("div",{className:"rounded-[16px] border border-[#EEEAE4] bg-white px-3 py-3 text-[12px] leading-6 text-gray-600",children:he},`${he}-${ge}`))}):null]})]})}),y.jsx(A6,{open:Da,eyebrow:"Runtime",title:"Run Draft",onClose:()=>Mo(!1),actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>Mo(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{type:"button",onClick:()=>{Cl()},disabled:E,className:"solid-action",children:[y.jsx(s0,{size:14})," ",E?"Running":"Run draft"]})]}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] px-4 py-4 text-[12px] leading-6 text-gray-600",children:["This input is passed into the script through ",y.jsx("code",{className:"rounded bg-white px-1.5 py-0.5 text-[11px]",children:"AppScriptCommand"}),". The execution result will appear in the Activity dialog."]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:X.scriptId}),y.jsx("textarea",{rows:7,className:"panel-textarea mt-1 run-prompt-textarea",placeholder:"Enter the draft input to execute",value:_l,onChange:he=>Ta(he.target.value)})]})]})})]})}const u4=[{key:"data",label:"Data",color:"#3B82F6",items:["transform","assign","retrieve_facts","cache"]},{key:"control",label:"Control",color:"#8B5CF6",items:["guard","conditional","switch","while","delay","wait_signal","checkpoint"]},{key:"ai",label:"AI",color:"#EC4899",items:["llm_call","tool_call","evaluate","reflect"]},{key:"composition",label:"Composition",color:"#F59E0B",items:["foreach","parallel","race","map_reduce","workflow_call","dynamic_workflow","vote"]},{key:"integration",label:"Integration",color:"#10B981",items:["connector_call","emit"]},{key:"human",label:"Human",color:"#06B6D4",items:["human_input","human_approval"]},{key:"validation",label:"Validation",color:"#64748B",items:["workflow_yaml_validate"]}];u4.flatMap(n=>n.items);const Yut="llm_call",I0e=new Set(["llm_call","tool_call","evaluate","reflect","while","parallel","race","connector_call"]),N0e={transform:{op:"trim"},assign:{target:"result",value:"$input"},retrieve_facts:{query:"",top_k:"3"},cache:{cache_key:"$input",ttl_seconds:"600",child_step_type:"llm_call"},guard:{check:"not_empty",on_fail:"fail"},conditional:{condition:'${eq($input, "ok")}'},switch:{on:"$input"},while:{step:"llm_call",max_iterations:"5",condition:"${lt(iteration, 5)}"},delay:{duration_ms:"1000"},wait_signal:{signal_name:"continue",timeout_ms:"60000"},checkpoint:{name:"checkpoint_1"},llm_call:{prompt_prefix:"Review the input and produce the next step."},tool_call:{tool:"web_search"},evaluate:{criteria:"correctness",scale:"1-5",threshold:"4"},reflect:{max_rounds:"3",criteria:"accuracy and conciseness"},foreach:{delimiter:"\\n---\\n",sub_step_type:"llm_call"},parallel:{workers:"assistant",parallel_count:"3",vote_step_type:"vote"},race:{workers:"assistant",count:"2"},map_reduce:{delimiter:"\\n---\\n",map_step_type:"llm_call",reduce_step_type:"llm_call"},workflow_call:{workflow:"child_workflow",lifecycle:"scope"},dynamic_workflow:{original_input:"$input"},vote:{},connector_call:{connector:"",operation:"",path:"",method:"POST",timeout_ms:"10000",retry:"0",on_error:"fail"},emit:{event_type:"workflow.completed",payload:"$input"},human_input:{prompt:"Please provide the missing input.",variable:"human_response"},human_approval:{prompt:"Approve this step?",on_reject:"fail"},workflow_yaml_validate:{}};function P6(){return{workflowId:null,directoryId:null,fileName:"",filePath:"",name:"draft",description:"",closedWorldMode:!1,yaml:"",findings:[],dirty:!1,lastSavedAt:null}}function Dm(n=1,e={}){return{key:e.key||`role_${crypto.randomUUID()}`,id:e.id??(n===1?"assistant":`role_${n}`),name:e.name??(n===1?"Assistant":`Role ${n}`),systemPrompt:e.systemPrompt??"",provider:e.provider??"",model:e.model??"",connectorsText:e.connectorsText??""}}function yb(){return[Dm(1)]}function bce(n,e=1){return Dm(e,{id:(n==null?void 0:n.id)||"",name:(n==null?void 0:n.name)||(n==null?void 0:n.id)||"",systemPrompt:(n==null?void 0:n.systemPrompt)||(n==null?void 0:n.system_prompt)||"",provider:(n==null?void 0:n.provider)||"",model:(n==null?void 0:n.model)||"",connectorsText:Array.isArray(n==null?void 0:n.connectors)?n.connectors.join(` -`):(n==null?void 0:n.connectorsText)||""})}function vce(n){return{id:n.id.trim(),name:(n.name||n.id).trim(),systemPrompt:n.systemPrompt||"",provider:n.provider.trim(),model:n.model.trim(),connectors:Ll(n.connectorsText)}}function Zut(n="http",e=""){return{key:`connector_${crypto.randomUUID()}`,name:e,type:n,enabled:!0,timeoutMs:"30000",retry:"0",http:{baseUrl:"",allowedMethods:["POST"],allowedPaths:["/"],allowedInputKeys:[],defaultHeaders:{}},cli:{command:"",fixedArguments:[],allowedOperations:[],allowedInputKeys:[],workingDirectory:"",environment:{}},mcp:{serverName:"",command:"",arguments:[],environment:{},defaultTool:"",allowedTools:[],allowedInputKeys:[]}}}function wce(n){var e,t,i,s,o,r,a,l,c,d,h,u,f,g,p,m,b,v;return{key:`connector_${crypto.randomUUID()}`,name:(n==null?void 0:n.name)||"",type:(n==null?void 0:n.type)||"http",enabled:(n==null?void 0:n.enabled)!==!1,timeoutMs:String((n==null?void 0:n.timeoutMs)??3e4),retry:String((n==null?void 0:n.retry)??0),http:{baseUrl:((e=n==null?void 0:n.http)==null?void 0:e.baseUrl)||"",allowedMethods:Array.isArray((t=n==null?void 0:n.http)==null?void 0:t.allowedMethods)?[...n.http.allowedMethods]:["POST"],allowedPaths:Array.isArray((i=n==null?void 0:n.http)==null?void 0:i.allowedPaths)?[...n.http.allowedPaths]:["/"],allowedInputKeys:Array.isArray((s=n==null?void 0:n.http)==null?void 0:s.allowedInputKeys)?[...n.http.allowedInputKeys]:[],defaultHeaders:{...((o=n==null?void 0:n.http)==null?void 0:o.defaultHeaders)||{}}},cli:{command:((r=n==null?void 0:n.cli)==null?void 0:r.command)||"",fixedArguments:Array.isArray((a=n==null?void 0:n.cli)==null?void 0:a.fixedArguments)?[...n.cli.fixedArguments]:[],allowedOperations:Array.isArray((l=n==null?void 0:n.cli)==null?void 0:l.allowedOperations)?[...n.cli.allowedOperations]:[],allowedInputKeys:Array.isArray((c=n==null?void 0:n.cli)==null?void 0:c.allowedInputKeys)?[...n.cli.allowedInputKeys]:[],workingDirectory:((d=n==null?void 0:n.cli)==null?void 0:d.workingDirectory)||"",environment:{...((h=n==null?void 0:n.cli)==null?void 0:h.environment)||{}}},mcp:{serverName:((u=n==null?void 0:n.mcp)==null?void 0:u.serverName)||"",command:((f=n==null?void 0:n.mcp)==null?void 0:f.command)||"",arguments:Array.isArray((g=n==null?void 0:n.mcp)==null?void 0:g.arguments)?[...n.mcp.arguments]:[],environment:{...((p=n==null?void 0:n.mcp)==null?void 0:p.environment)||{}},defaultTool:((m=n==null?void 0:n.mcp)==null?void 0:m.defaultTool)||"",allowedTools:Array.isArray((b=n==null?void 0:n.mcp)==null?void 0:b.allowedTools)?[...n.mcp.allowedTools]:[],allowedInputKeys:Array.isArray((v=n==null?void 0:n.mcp)==null?void 0:v.allowedInputKeys)?[...n.mcp.allowedInputKeys]:[]}}}function Cce(n){return{name:n.name.trim(),type:n.type,enabled:n.enabled,timeoutMs:xce(n.timeoutMs,3e4),retry:xce(n.retry,0),http:{baseUrl:n.http.baseUrl.trim(),allowedMethods:n.http.allowedMethods.map(e=>e.trim().toUpperCase()).filter(Boolean),allowedPaths:n.http.allowedPaths.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.http.allowedInputKeys.map(e=>e.trim()).filter(Boolean),defaultHeaders:n.http.defaultHeaders},cli:{command:n.cli.command.trim(),fixedArguments:n.cli.fixedArguments.map(e=>e.trim()).filter(Boolean),allowedOperations:n.cli.allowedOperations.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.cli.allowedInputKeys.map(e=>e.trim()).filter(Boolean),workingDirectory:n.cli.workingDirectory.trim(),environment:n.cli.environment},mcp:{serverName:n.mcp.serverName.trim(),command:n.mcp.command.trim(),arguments:n.mcp.arguments.map(e=>e.trim()).filter(Boolean),environment:n.mcp.environment,defaultTool:n.mcp.defaultTool.trim(),allowedTools:n.mcp.allowedTools.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.mcp.allowedInputKeys.map(e=>e.trim()).filter(Boolean)}}}function Xut(n,e){const t=new Set(n.map(r=>r.name)),i=`${e}_connector`;let s=1,o=i;for(;t.has(o);)s+=1,o=`${i}_${s}`;return o}function Ll(n){return String(n||"").split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function D0e(n){return u4.find(e=>e.items.includes(n))||{key:"custom",label:"Custom",color:"#6B7280",items:[]}}function Qut(n,e,t,i,s,o={}){var d,h;const r=structuredClone(N0e[n]||{}),a=n==="connector_call"&&((d=tft(s))==null?void 0:d.name)||"";a&&cM(r,a,s);const l=eft(n,t),c=I0e.has(n)?o.targetRole??((h=i[0])==null?void 0:h.id)??"":o.targetRole??"";return{id:`node_${crypto.randomUUID()}`,type:"aevatarNode",position:e,data:{label:o.label||l,stepId:l,stepType:n,targetRole:c,parameters:{...r,...structuredClone(o.parameters||{})}}}}function Jut(n){return structuredClone(N0e[n]||{})}function yce(n){return I0e.has(n)}function eft(n,e){const t=n.replace(/[^a-z0-9]+/gi,"_").toLowerCase(),i=new Set(e.map(r=>r.data.stepId));let s=e.length+1,o=`${t}_${s}`;for(;i.has(o);)s+=1,o=`${t}_${s}`;return o}function cM(n,e,t){if(!e)return n;const i=t.find(s=>s.name===e);return n.connector=e,i?i.type==="http"?((!n.method||!i.http.allowedMethods.includes(String(n.method).toUpperCase()))&&(n.method=i.http.allowedMethods[0]||"POST"),!n.path&&i.http.allowedPaths.length>0&&(n.path=i.http.allowedPaths[0]),n):i.type==="cli"?(!n.operation&&i.cli.allowedOperations.length>0&&(n.operation=i.cli.allowedOperations[0]),n):(n.operation||(n.operation=i.mcp.defaultTool||i.mcp.allowedTools[0]||""),n):n}function tft(n){return n.find(e=>e.enabled)||n[0]||null}function eR(n,e,t=yb()){const i=(n==null?void 0:n.document)||(n==null?void 0:n.rootWorkflow)||n,s=Array.isArray(i==null?void 0:i.roles)&&i.roles.length>0?i.roles.map((h,u)=>Dm(u+1,{id:h.id||"",name:h.name||h.id||"",systemPrompt:h.systemPrompt||"",provider:h.provider||"",model:h.model||"",connectorsText:Array.isArray(h.connectors)?h.connectors.join(` -`):""})):t,o=Array.isArray(i==null?void 0:i.steps)?i.steps:[],r=fft(e)?(e==null?void 0:e.nodePositions)||{}:{},a=gft(o),l=o.map((h,u)=>{const f=r[h.id]||a[h.id];return{id:`node_${crypto.randomUUID()}`,type:"aevatarNode",position:{x:Number.isFinite(f==null?void 0:f.x)?f.x:220+u*300,y:Number.isFinite(f==null?void 0:f.y)?f.y:180},data:{label:h.id,stepId:h.id,stepType:h.type||h.originalType||Yut,targetRole:h.targetRole||h.target_role||"",parameters:lft(h.parameters)}}}),c=new Map(l.map(h=>[h.data.stepId,h])),d=[];return o.forEach((h,u)=>{var g;const f=c.get(h.id);if(h.next&&f&&c.has(h.next)){const p=c.get(h.next);d.push(dM(f.id,p.id))}else if(!h.next&&(!h.branches||Object.keys(h.branches).length===0)&&f&&u{if(typeof m=="string"&&f&&c.has(m)){const b=c.get(m);d.push(dM(f.id,b.id,p))}})}),{roles:s,nodes:l,edges:d}}function O6(n,e,t,i){const s=new Map;return i.forEach(o=>{const r=s.get(o.source)||[];r.push(o),s.set(o.source,r)}),{name:n.name.trim()||"draft",description:n.description.trim(),configuration:{closedWorldMode:n.closedWorldMode},roles:e.filter(o=>o.id.trim()).map(o=>({id:o.id.trim(),name:o.name.trim()||o.id.trim(),systemPrompt:o.systemPrompt||"",provider:o.provider.trim()||null,model:o.model.trim()||null,connectors:Ll(o.connectorsText)})),steps:t.map(o=>{var c;const r=s.get(o.id)||[],a=r.find(d=>{var h;return((h=d.data)==null?void 0:h.kind)==="next"}),l=r.filter(d=>{var h;return((h=d.data)==null?void 0:h.kind)==="branch"});return{id:o.data.stepId,type:o.data.stepType,originalType:o.data.stepType,targetRole:o.data.targetRole||null,usedRoleAlias:!1,parameters:cft(o.data.parameters),next:a&&((c=t.find(d=>d.id===a.target))==null?void 0:c.data.stepId)||null,branches:Object.fromEntries(l.map(d=>{var h,u;return[((h=d.data)==null?void 0:h.branchLabel)||"_default",((u=t.find(f=>f.id===d.target))==null?void 0:u.data.stepId)||null]}).filter(([,d])=>!!d)),children:[],importedFromChildren:!1,retry:null,onError:null,timeoutMs:null}})}}function Sce(n,e){return{nodePositions:Object.fromEntries(e.map(t=>[t.data.stepId,{x:t.position.x,y:t.position.y}])),viewport:{x:0,y:0,zoom:1},mode:"manual",layoutVersion:2,groups:{},collapsed:[],entryWorkflow:n.name.trim()||"draft"}}function dM(n,e,t){const i=!!t,s=i?"#8B5CF6":"#2F6FEC";return{id:`edge_${n}_${e}_${t||"next"}`,source:n,target:e,type:"smoothstep",label:t,animated:!1,data:{kind:i?"branch":"next",branchLabel:t},style:{stroke:s,strokeWidth:2.5},markerEnd:{type:U1.ArrowClosed,width:11,height:11,color:s},zIndex:4,labelStyle:{fill:"#6B7280",fontSize:12}}}function ift(n,e){const t=new Set(e.filter(i=>{var s;return i.source===n&&((s=i.data)==null?void 0:s.kind)==="branch"}).map(i=>{var s;return(s=i.data)==null?void 0:s.branchLabel}));return t.has("true")?t.has("false")?"true":"false":"true"}function nft(n){const e=n.trim();if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch{return n}return e==="true"?!0:e==="false"?!1:e==="null"?null:n}function mQ(n){return n==null?"":typeof n=="string"?n:typeof n=="boolean"||typeof n=="number"?String(n):JSON.stringify(n,null,2)}function sft(n){var r,a,l,c,d,h;if(!n)return null;const e=new Map,t=new Set,i=[];let s=null;for(const u of n.frames||[]){const f=hft(u.payload),g=u.receivedAtUtc;if(!f)continue;const p=((r=f.custom)==null?void 0:r.name)||"",m=((a=f.custom)==null?void 0:a.payload)||null;if(p==="aevatar.step.request"){const b=(m==null?void 0:m.stepId)||((l=f.stepStarted)==null?void 0:l.stepName);if(!b)continue;const v=iR(e,b);v.status="active",v.stepType=(m==null?void 0:m.stepType)||v.stepType||"",v.targetRole=(m==null?void 0:m.targetRole)||v.targetRole||"",v.startedAt=g,s=b,i.push({tone:"started",title:`${b} started`,meta:[m==null?void 0:m.stepType,m==null?void 0:m.targetRole].filter(Boolean).join(" · "),previewText:fp(m==null?void 0:m.input),clipboardText:df(m==null?void 0:m.input),timestamp:g,stepId:b,interaction:null});continue}if(p==="aevatar.human_input.request"){const b=m==null?void 0:m.stepId,v=m==null?void 0:m.runId,w=Lce(m==null?void 0:m.suspensionType);if(!b||!v||!w)continue;const C=iR(e,b);C.status="waiting",C.stepType=C.stepType||w,s=b;const S=uft(m==null?void 0:m.timeoutSeconds),L={kind:w,runId:v,stepId:b,prompt:String((m==null?void 0:m.prompt)||"").trim(),timeoutSeconds:S,variableName:String((m==null?void 0:m.variableName)||"").trim()};i.push({tone:"pending",title:w==="human_approval"?`${b} waiting for approval`:`${b} waiting for input`,meta:[w==="human_approval"?"human approval":"human input",L.variableName?`variable ${L.variableName}`:null,S?`timeout ${S}s`:null].filter(Boolean).join(" · "),previewText:fp(L.prompt),clipboardText:df(L.prompt),timestamp:g,stepId:b,interaction:L});continue}if(p==="aevatar.step.completed"){const b=(m==null?void 0:m.stepId)||((c=f.stepFinished)==null?void 0:c.stepName);if(!b)continue;const v=iR(e,b);v.status=(m==null?void 0:m.success)===!1?"failed":"completed",v.completedAt=g,v.success=(m==null?void 0:m.success)!==!1,v.error=(m==null?void 0:m.error)||"",v.nextStepId=(m==null?void 0:m.nextStepId)||"",v.branchKey=(m==null?void 0:m.branchKey)||"",m!=null&&m.nextStepId&&t.add(`${b}->${m.nextStepId}`),s=b,i.push({tone:(m==null?void 0:m.success)===!1?"failed":"completed",title:`${b} ${(m==null?void 0:m.success)===!1?"failed":"completed"}`,meta:[v.stepType,m!=null&&m.branchKey?`branch ${m.branchKey}`:null,m!=null&&m.nextStepId?`next ${m.nextStepId}`:null].filter(Boolean).join(" · "),previewText:fp((m==null?void 0:m.error)||(m==null?void 0:m.output)),clipboardText:df((m==null?void 0:m.error)||(m==null?void 0:m.output)),timestamp:g,stepId:b,interaction:null});continue}if(p==="studio.human.resume"){const b=m==null?void 0:m.stepId;if(!b)continue;const v=iR(e,b);v.status="active",s=b;const w=Lce(m==null?void 0:m.suspensionType),C=(m==null?void 0:m.approved)!==!1;i.push({tone:"run",title:w==="human_approval"?`${b} ${C?"approved":"rejected"}`:`${b} input submitted`,meta:w==="human_approval"?`human approval · ${C?"approved":"rejected"}`:"human input submitted",previewText:fp(m==null?void 0:m.userInput),clipboardText:df(m==null?void 0:m.userInput),timestamp:g,stepId:b,interaction:null});continue}if(p==="studio.run.stop.requested"){i.push({tone:"pending",title:"Stop requested",meta:"",previewText:fp(m==null?void 0:m.reason),clipboardText:df(m==null?void 0:m.reason),timestamp:g,stepId:s,interaction:null});continue}if(p==="aevatar.run.stopped"){i.push({tone:"run",title:"Run stopped",meta:"",previewText:fp(m==null?void 0:m.reason),clipboardText:df(m==null?void 0:m.reason),timestamp:g,stepId:s,interaction:null});continue}if((d=f.runError)!=null&&d.message){i.push({tone:"failed",title:"Run failed",meta:f.runError.code||"",previewText:fp(f.runError.message),clipboardText:df(f.runError.message),timestamp:g,stepId:s,interaction:null});continue}if(f.runStopped){i.push({tone:"run",title:"Run stopped",meta:"",previewText:fp(f.runStopped.reason),clipboardText:df(f.runStopped.reason),timestamp:g,stepId:s,interaction:null});continue}if(f.runFinished){i.push({tone:"run",title:"Run finished",meta:"",previewText:"",clipboardText:"",timestamp:g,stepId:s,interaction:null});continue}p==="aevatar.run.context"&&i.push({tone:"run",title:"Run started",meta:(m==null?void 0:m.workflowName)||n.workflowName||"",previewText:"",clipboardText:"",timestamp:g,stepId:null,interaction:null})}let o=null;for(let u=i.length-1;u>=0;u-=1){const f=i[u].stepId;if(i[u].interaction&&f&&((h=e.get(f))==null?void 0:h.status)==="waiting"){o=u;break}}for(let u=i.length-1;u>=0&&o===null;u-=1)if(i[u].stepId){o=u;break}return{stepStates:e,traversedEdges:t,logs:i,latestStepId:s,defaultLogIndex:o}}function T0e(n,e){if(!n)return null;const t=Number.isInteger(e)?n.logs[e]:null;return(t==null?void 0:t.stepId)||n.latestStepId||null}function oft(n,e,t){const i=T0e(e,t);return n.map(s=>{const o=e==null?void 0:e.stepStates.get(s.data.stepId);return{...s,draggable:!1,selectable:!0,data:{...s.data,executionStatus:(o==null?void 0:o.status)||"idle",executionFocused:i===s.data.stepId}}})}function rft(n,e,t,i){const s=T0e(t,i),o=new Map(e.map(r=>[r.id,r.data.stepId]));return n.map(r=>{var u;const a=o.get(r.source),l=o.get(r.target),c=a&&l?t==null?void 0:t.traversedEdges.has(`${a}->${l}`):!1,d=s&&(a===s||l===s),h=d?"#2F6FEC":c?"#22C55E":((u=r.data)==null?void 0:u.kind)==="branch"?"#8B5CF6":"#94A3B8";return{...r,type:r.type||"smoothstep",animated:!!d,style:{stroke:h,strokeWidth:d?2.8:2.5},markerEnd:{type:U1.ArrowClosed,width:11,height:11,color:h},zIndex:4}})}function aft(n,e){var t;if(!((t=n==null?void 0:n.logs)!=null&&t.length)||!e)return null;for(let i=n.logs.length-1;i>=0;i-=1)if(n.logs[i].stepId===e)return i;return null}function tR(n){return typeof n=="string"?n.toLowerCase():Number(n)===2?"error":"warning"}function lft(n){return Object.fromEntries(Object.entries(n||{}).map(([e,t])=>[e,dft(t)]))}function cft(n){return Object.fromEntries(Object.entries(n||{}).filter(([e])=>e.trim()))}function dft(n){return n==null?n:structuredClone(n)}function xce(n,e){const t=parseInt(String(n||"").trim(),10);return Number.isFinite(t)?t:e}function iR(n,e){return n.has(e)||n.set(e,{stepId:e,status:"idle",stepType:"",targetRole:"",startedAt:null,completedAt:null,success:null,error:"",nextStepId:"",branchKey:""}),n.get(e)}function hft(n){try{return JSON.parse(n)}catch{return null}}function df(n){const e=mQ(n).trim();return e||""}function fp(n){const e=df(n);return e.length>180?`${e.slice(0,177)}...`:e}function Lce(n){const e=String(n||"").trim().toLowerCase();return e==="human_input"||e==="human_approval"?e:null}function uft(n){const e=Number(n);return Number.isFinite(e)&&e>0?e:null}function fft(n){return(n==null?void 0:n.mode)==="manual"&&(n==null?void 0:n.nodePositions)&&typeof n.nodePositions=="object"}function gft(n){var p;const e=new Set(n.map(m=>String((m==null?void 0:m.id)||"").trim()).filter(Boolean));if(e.size===0)return{};const t=new Map,i=new Map;for(const m of e)t.set(m,[]),i.set(m,0);n.forEach((m,b)=>{var L;const v=String((m==null?void 0:m.id)||"").trim();if(!v||!e.has(v))return;const w=[],C=String((m==null?void 0:m.next)||"").trim();if(C&&e.has(C))w.push(C);else if(!(m!=null&&m.next)&&(!(m!=null&&m.branches)||Object.keys(m.branches).length===0)&&bpft(x,E)).map(([,x])=>String(x||"").trim()).filter(x=>x&&e.has(x));for(const x of[...w,...S]){const E=t.get(v)||[];E.includes(x)||(E.push(x),t.set(v,E),i.set(x,(i.get(x)||0)+1))}});const s=new Map,o=new Map,r=new Set,a=new Set,l=String(((p=n[0])==null?void 0:p.id)||"").trim();l&&a.add(l);for(const m of n){const b=String((m==null?void 0:m.id)||"").trim();b&&(i.get(b)||0)===0&&a.add(b)}for(const m of n){const b=String((m==null?void 0:m.id)||"").trim();b&&a.add(b)}function c(m,b){if(r.has(m))return;r.add(m),o.set(m,b);const v=t.get(m)||[],w=[];for(const C of v)r.has(C)||(w.push(C),c(C,b+1));s.set(m,w)}for(const m of a)r.has(m)||c(m,0);const d=new Map;function h(m){const b=s.get(m)||[];if(b.length===0)return d.set(m,1),1;const v=b.reduce((C,S)=>C+h(S),0),w=Math.max(1,v);return d.set(m,w),w}for(const m of a)o.has(m)&&!d.has(m)&&h(m);const u={};let f=0;function g(m,b){const v=s.get(m)||[],w=d.get(m)||1,C=o.get(m)||0,S=b+(w-1)/2;u[m]={x:240+C*330,y:180+S*200};let L=b;for(const x of v){const E=d.get(x)||1;g(x,L),L+=E}}for(const m of a)!o.has(m)||u[m]||(g(m,f),f+=(d.get(m)||1)+.8);return u}function pft(n,e){const t=s=>{const o=String(s||"").trim().toLowerCase();return o==="true"?0:o==="false"?1:o==="_default"||o==="default"?2:3},i=t(n)-t(e);return i!==0?i:String(n||"").localeCompare(String(e||""))}const R0e={data:Q2e,control:eRe,ai:iv,composition:Vfe,integration:wR,human:kL,validation:ZE,custom:YE},mft={aevatarNode:Tft},_ft=["studio","workflows","scripts","roles","connectors","settings"],bft=["studio","workflows","scripts","roles","connectors"],vft=[{id:"blue",label:"Blue",description:"Cool and calm for daily editing.",swatches:["#2F6FEC","#7FA9FF","#EAF2FF"]},{id:"coral",label:"Coral",description:"The warmer look you had before.",swatches:["#F0483E","#FF8A6B","#FFF1EC"]},{id:"forest",label:"Forest",description:"A softer green studio palette.",swatches:["#2F8F6A","#6BBC94","#EAF7F0"]}],GL=typeof window>"u"?"http://127.0.0.1:5100":window.location.origin,M0e="aevatar.app.workspace-page",A0e="aevatar.app.previous-workspace-page";function wft(){return{hostMode:"embedded",scopeId:null,scopeResolved:!1,scopeSource:"",workflowStorageMode:"workspace",scriptStorageMode:"draft",scriptsEnabled:!1,scriptContract:{inputType:"",readModelFields:[]}}}function Cft(n){var t,i,s;const e=n!=null&&n.scopeResolved&&(n!=null&&n.scopeId)?n.scopeId:null;return{hostMode:(n==null?void 0:n.mode)==="proxy"?"proxy":"embedded",scopeId:e,scopeResolved:!!e,scopeSource:(n==null?void 0:n.scopeSource)||"",workflowStorageMode:(n==null?void 0:n.workflowStorageMode)==="scope"?"scope":"workspace",scriptStorageMode:(n==null?void 0:n.scriptStorageMode)==="scope"?"scope":"draft",scriptsEnabled:!!((t=n==null?void 0:n.features)!=null&&t.scripts),scriptContract:{inputType:((i=n==null?void 0:n.scriptContract)==null?void 0:i.inputType)||"",readModelFields:Array.isArray((s=n==null?void 0:n.scriptContract)==null?void 0:s.readModelFields)?n.scriptContract.readModelFields:[]}}}function kce(n){return!!((n==null?void 0:n.status)===401||n!=null&&n.loginUrl||typeof(n==null?void 0:n.message)=="string"&&n.message.includes("Sign-in may be required.")||typeof(n==null?void 0:n.rawBody)=="string"&&(n.rawBody.startsWith("e.length?`, +${n.length-e.length} more`:"";return`Loaded studio with defaults for ${e.join(", ")}${t}.`}function Sft(){if(typeof window>"u")return{isPopout:!1,executionId:null};const n=new URL(window.location.href),e=n.searchParams.get("executionId");return{isPopout:n.searchParams.get("executionLogs")==="popout",executionId:e&&e.trim()?e.trim():null}}function Ece(n){const e=new URL(window.location.href);return e.searchParams.set("executionLogs","popout"),e.searchParams.set("executionId",n),e.toString()}function xft(n){return!!(n&&_ft.includes(n))}function Lft(n){return!!(n&&bft.includes(n))}function kft(){if(typeof window>"u")return"studio";try{const n=window.localStorage.getItem(M0e);return xft(n)?n:"studio"}catch{return"studio"}}function Eft(){if(typeof window>"u")return"studio";try{const n=window.localStorage.getItem(A0e);return Lft(n)?n:"studio"}catch{return"studio"}}function P0e(n){const e=n.size??44;return y.jsxs("svg",{viewBox:"0 0 400 400",width:e,height:e,className:n.className,"aria-hidden":"true",shapeRendering:"crispEdges",children:[y.jsx("rect",{width:"400",height:"400",rx:"28",fill:"#18181B"}),y.jsx("rect",{x:"12",y:"20",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"102",y:"20",width:"44",height:"142",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"66",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"20",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"20",width:"44",height:"142",fill:"#FAFAFA"}),y.jsx("rect",{x:"330",y:"66",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"181",width:"170",height:"32",fill:"#FAFAFA"}),y.jsx("rect",{x:"230",y:"181",width:"170",height:"32",fill:"#FAFAFA"}),y.jsx("rect",{x:"180",y:"181",width:"40",height:"40",fill:"#FAFAFA"}),y.jsx("rect",{x:"12",y:"304",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"102",y:"242",width:"44",height:"109",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"274",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"304",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"242",width:"44",height:"109",fill:"#FAFAFA"}),y.jsx("rect",{x:"330",y:"274",width:"70",height:"30",fill:"#FAFAFA"})]})}function Ift(n){const e=String((n==null?void 0:n.prompt)||"").trim();return{executionId:(n==null?void 0:n.executionId)||"",workflowName:(n==null?void 0:n.workflowName)||"",status:(n==null?void 0:n.status)||"running",promptPreview:e.length<=120?e:`${e.slice(0,117)}...`,startedAtUtc:(n==null?void 0:n.startedAtUtc)||new Date().toISOString(),completedAtUtc:(n==null?void 0:n.completedAtUtc)||null,actorId:(n==null?void 0:n.actorId)||null,error:(n==null?void 0:n.error)||null}}function Nft(){return{loading:!0,enabled:!0,authenticated:!1,providerDisplayName:"NyxID",loginUrl:"/auth/login",logoutUrl:"/auth/logout",name:"",email:"",picture:"",errorMessage:""}}function Dft(n){return{...n?{scope_id:n}:{},"workflow.authoring.enabled":"true","workflow.intent":"workflow_authoring"}}function Tft({data:n,selected:e}){const t=D0e(n.stepType),i=R0e[t.key]||YE,s=Mi(d=>d.transform[2]),o=s<.68,r=s<.42,a=n.executionStatus&&n.executionStatus!=="idle"?`node-status-${n.executionStatus}`:"",l=r?104:o?154:244,c=Rft(n.parameters);return y.jsxs("div",{className:["workflow-node",o?"compact":"",r?"micro":"",e?"selected":"",n.executionFocused?"execution-focus":"",a].join(" "),style:{width:l},children:[y.jsx(nS,{type:"target",position:It.Left,style:{background:t.color}}),r?y.jsxs("div",{className:"workflow-node-micro",children:[y.jsx("div",{className:"workflow-node-icon workflow-node-icon-micro",style:{background:`${t.color}18`},children:y.jsx(i,{size:14,color:t.color})}),y.jsx("div",{className:"workflow-node-micro-meta",children:y.jsx("div",{className:"workflow-node-title",children:n.stepId})}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`workflow-node-status-dot ${n.executionStatus}`}):null]}):o?y.jsxs("div",{className:"workflow-node-compact",children:[y.jsx("div",{className:"workflow-node-icon",style:{background:`${t.color}18`},children:y.jsx(i,{size:14,color:t.color})}),y.jsxs("div",{className:"workflow-node-compact-meta",children:[y.jsx("div",{className:"workflow-node-title",children:n.stepId}),y.jsx("div",{className:"workflow-node-subtitle",children:n.targetRole||n.stepType})]}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`workflow-node-status-dot ${n.executionStatus}`}):null]}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-100",children:[y.jsx("div",{className:"workflow-node-icon",style:{background:`${t.color}18`},children:y.jsx(i,{size:15,color:t.color})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:n.stepId}),y.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:n.stepType})]}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`node-run-pill ${n.executionStatus}`,children:n.executionStatus}):null]}),y.jsxs("div",{className:"px-3 py-2 text-[11px] text-gray-500 space-y-1",children:[n.targetRole?y.jsxs("div",{children:[y.jsx("span",{className:"text-gray-400",children:"role:"})," ",n.targetRole]}):null,y.jsx("div",{className:"truncate",children:c})]})]}),y.jsx(nS,{type:"source",position:It.Right,style:{background:t.color}})]})}function Rft(n){const e=Object.entries(n||{}).find(([,o])=>o!==""&&o!==null&&o!==void 0);if(!e)return"No parameters";const[t,i]=e,s=mQ(i);return`${t}: ${s.length>44?`${s.slice(0,41)}...`:s}`}function Ice(n){return String(n||"").trim().toLowerCase()}function Sb(n){return n?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(n)):"-"}function Mft(n,e){if(!n)return"";const t=new Date(n).getTime(),i=e?new Date(e).getTime():Date.now();if(!Number.isFinite(t)||!Number.isFinite(i)||i<=t)return"";const s=i-t;if(s<1e3)return`${Math.round(s)}ms`;const o=s/1e3;if(o<60)return`${o<10?o.toFixed(1):Math.round(o)}s`;const r=Math.floor(o/60),a=Math.round(o%60);if(r<60)return`${r}m ${a}s`;const l=Math.floor(r/60),c=r%60;return`${l}h ${c}m`}function O0e(n){const e=[`[${Sb(n.timestamp)}] ${n.title}`];return n.meta&&e.push(n.meta),n.clipboardText&&e.push(n.clipboardText),e.join(` -`)}function Aft(n){var e;return(e=n==null?void 0:n.logs)!=null&&e.length?n.logs.map(t=>O0e(t)).join(` +`,fce=globalThis;fce.MonacoEnvironment||(fce.MonacoEnvironment={getWorker(){return new OJe}});bG.config({monaco:PJe});function of(n,e){const t=String(n||"").trim().toLowerCase().replace(/[^a-z0-9._ -]+/g,"").replace(/[._ ]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(t)return t;const i=new Date().toISOString().replace(/-/g,"").replace(/:/g,"").replace(/\./g,"").replace("T","").replace("Z","").slice(0,14);return`${e}-${i}`}function gce(){return cM(Out)}function Fut(n){const e=String(n||"").replace(/\s+/g," ").trim().toLowerCase();return e.includes("oncommand")||e.includes("scriptbehavior")||e.includes("google.protobuf.wellknowntypes")&&e.includes("stringvalue")&&e.includes("struct")}function jN(n,e){const t=n?Wu(n.csharpSources,n.protoFiles,n.entryBehaviorTypeName,n.entrySourcePath):gQ(String(e||"")),i=Il(t,t.entrySourcePath),s=(i==null?void 0:i.content)||"";return s.trim()?Fut(s)?{package:gce(),migrated:!0}:{package:t,migrated:!1}:{package:gce(),migrated:!0}}function I0(n,e={}){const t=new Date().toISOString(),i=jN(e.package),s=Il(i.package,e.selectedFilePath||i.package.entrySourcePath);return{key:e.key||`draft-${Date.now()}-${n}`,scriptId:e.scriptId||`script-${n}`,revision:e.revision||`draft-rev-${n}`,baseRevision:e.baseRevision||"",reason:e.reason||"",input:e.input||"",package:i.package,selectedFilePath:(s==null?void 0:s.path)||i.package.entrySourcePath||"Behavior.cs",definitionActorId:e.definitionActorId||"",runtimeActorId:e.runtimeActorId||"",updatedAtUtc:e.updatedAtUtc||t,lastSourceHash:e.lastSourceHash||"",lastRun:e.lastRun||null,lastSnapshot:e.lastSnapshot||null,lastPromotion:e.lastPromotion||null,scopeDetail:e.scopeDetail||null}}function But(){if(typeof window>"u")return[I0(1)];try{const n=window.localStorage.getItem(S0e);if(!n)return[I0(1)];const e=JSON.parse(n);return!Array.isArray(e)||e.length===0?[I0(1)]:e.map((t,i)=>{const s=jN((t==null?void 0:t.package)||null,String((t==null?void 0:t.source)||"")),o=Il(s.package,String((t==null?void 0:t.selectedFilePath)||s.package.entrySourcePath||""));return{key:String((t==null?void 0:t.key)||`draft-${Date.now()}-${i+1}`),scriptId:String((t==null?void 0:t.scriptId)||`script-${i+1}`),revision:String((t==null?void 0:t.revision)||`draft-rev-${i+1}`),baseRevision:String((t==null?void 0:t.baseRevision)||""),reason:String((t==null?void 0:t.reason)||""),input:String((t==null?void 0:t.input)||""),package:s.package,selectedFilePath:(o==null?void 0:o.path)||s.package.entrySourcePath||"Behavior.cs",definitionActorId:s.migrated?"":String((t==null?void 0:t.definitionActorId)||""),runtimeActorId:s.migrated?"":String((t==null?void 0:t.runtimeActorId)||""),updatedAtUtc:String((t==null?void 0:t.updatedAtUtc)||new Date().toISOString()),lastSourceHash:s.migrated?"":String((t==null?void 0:t.lastSourceHash)||""),lastRun:s.migrated?null:(t==null?void 0:t.lastRun)||null,lastSnapshot:s.migrated?null:(t==null?void 0:t.lastSnapshot)||null,lastPromotion:s.migrated?null:(t==null?void 0:t.lastPromotion)||null,scopeDetail:s.migrated?null:(t==null?void 0:t.scopeDetail)||null}})}catch{return[I0(1)]}}function Wut(n){if(!(n!=null&&n.readModelPayloadJson))return{input:"",output:"",status:"",lastCommandId:"",notes:[]};try{const e=JSON.parse(n.readModelPayloadJson);return{input:typeof(e==null?void 0:e.input)=="string"?e.input:"",output:typeof(e==null?void 0:e.output)=="string"?e.output:"",status:typeof(e==null?void 0:e.status)=="string"?e.status:"",lastCommandId:typeof(e==null?void 0:e.last_command_id)=="string"?e.last_command_id:"",notes:Array.isArray(e==null?void 0:e.notes)?e.notes.filter(t=>typeof t=="string"):[]}}catch{return{input:"",output:"",status:"",lastCommandId:"",notes:[]}}}function Hut(n,e){return n?n.diagnostics.filter(t=>!t.startLine||!t.startColumn?!1:!t.filePath||t.filePath===e).map(t=>({startLineNumber:t.startLine||1,startColumn:t.startColumn||1,endLineNumber:Math.max(t.endLine||t.startLine||1,t.startLine||1),endColumn:Math.max(t.endColumn||(t.startColumn||1)+1,(t.startColumn||1)+1),severity:t.severity==="error"?Vk.Error:t.severity==="warning"?Vk.Warning:Vk.Info,message:t.code?`[${t.code}] ${t.message}`:t.message,code:t.code||void 0,source:t.origin||void 0})):[]}function Vut(n){const e=n.filePath||"source";return!n.startLine||!n.startColumn?e:`${e}:${n.startLine}:${n.startColumn}`}function zut(n,e){return e||!n?"Checking":n.errorCount>0?`${n.errorCount} error${n.errorCount===1?"":"s"}${n.warningCount>0?` · ${n.warningCount} warning${n.warningCount===1?"":"s"}`:""}`:n.warningCount>0?`${n.warningCount} warning${n.warningCount===1?"":"s"}`:"Clean"}function jut(n){if(!n)return"-";try{return JSON.stringify(JSON.parse(n),null,2)}catch{return n}}function $ut(n,e,t){var a,l,c,d,h,u,f,g,p,m,b;const i=jN((t==null?void 0:t.package)||null,((a=n.source)==null?void 0:a.sourceText)||""),s=Il(i.package,(t==null?void 0:t.selectedFilePath)||i.package.entrySourcePath),o=((l=n.script)==null?void 0:l.scriptId)||(t==null?void 0:t.scriptId)||`script-${e}`,r=((c=n.script)==null?void 0:c.activeRevision)||((d=n.source)==null?void 0:d.revision)||(t==null?void 0:t.revision)||`draft-rev-${e}`;return I0(e,{key:t==null?void 0:t.key,scriptId:o,revision:r,baseRevision:((h=n.script)==null?void 0:h.activeRevision)||((u=n.source)==null?void 0:u.revision)||(t==null?void 0:t.baseRevision)||"",reason:(t==null?void 0:t.reason)||"",input:(t==null?void 0:t.input)||"",package:i.package,selectedFilePath:(s==null?void 0:s.path)||i.package.entrySourcePath||"Behavior.cs",definitionActorId:((f=n.script)==null?void 0:f.definitionActorId)||((g=n.source)==null?void 0:g.definitionActorId)||(t==null?void 0:t.definitionActorId)||"",runtimeActorId:(t==null?void 0:t.runtimeActorId)||"",updatedAtUtc:((p=n.script)==null?void 0:p.updatedAt)||(t==null?void 0:t.updatedAtUtc),lastSourceHash:((m=n.source)==null?void 0:m.sourceHash)||((b=n.script)==null?void 0:b.activeSourceHash)||(t==null?void 0:t.lastSourceHash)||"",lastRun:(t==null?void 0:t.lastRun)||null,lastSnapshot:(t==null?void 0:t.lastSnapshot)||null,lastPromotion:(t==null?void 0:t.lastPromotion)||null,scopeDetail:n})}function Uut(n){return new Promise(e=>window.setTimeout(e,n))}function qut({appContext:n,onFlash:e}){var rd,Qg,T_,Cx,R_,_h,M_,Jg,ep,yx,ju,$u;const t=$.useRef(null),i=$.useRef(0),[s,o]=$.useState(()=>But()),[r,a]=$.useState(""),[l,c]=$.useState(""),[d,h]=$.useState([]),[u,f]=$.useState({}),[g,p]=$.useState([]),[m,b]=$.useState({}),[v,w]=$.useState(!1),[C,S]=$.useState(!1),[L,x]=$.useState(!1),[I,E]=$.useState(!1),[R,M]=$.useState(!1),[A,W]=$.useState(!1),[P,B]=$.useState(!1),[V,K]=$.useState(!1),[z,j]=$.useState(!1),[X,Y]=$.useState(!1),[te,ce]=$.useState(!1),[Ce,xe]=$.useState(!1),[Be,Ee]=$.useState(""),[Le,ze]=$.useState(""),[Ct,ct]=$.useState(""),[Ue,tt]=$.useState(""),[_t,yi]=$.useState(null),[Pt,Cn]=$.useState(""),[Xn,Ks]=$.useState(null),[kr,Ir]=$.useState(!1),[fc,Er]=$.useState(!1),[Ta,po]=$.useState(""),[gn,yn]=$.useState(!1),[tn,Ra]=$.useState(null),[gc,_l]=$.useState(!1),[id,Os]=$.useState(!1),[Jr,er]=$.useState(!1),[pc,Mi]=$.useState("source"),[Dn,ks]=$.useState("runtime"),[Nr,nd]=$.useState(""),[Dr,fs]=$.useState(""),Bn=n.scopeResolved&&n.scriptStorageMode==="scope";$.useEffect(()=>{var ue,pe;if(!r&&((ue=s[0])!=null&&ue.key)){a(s[0].key);return}r&&!s.some(Oe=>Oe.key===r)&&a(((pe=s[0])==null?void 0:pe.key)||"")},[s,r]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(S0e,JSON.stringify(s))}catch{}},[s]);const Sn=$.useMemo(()=>{const ue=l.trim().toLowerCase();return ue?s.filter(pe=>[pe.scriptId,pe.revision,pe.baseRevision].join(" ").toLowerCase().includes(ue)):s},[s,l]),mc=$.useMemo(()=>{const ue=l.trim().toLowerCase();return ue?d.filter(pe=>{var Oe,We;return[((Oe=pe.script)==null?void 0:Oe.scriptId)||"",((We=pe.script)==null?void 0:We.activeRevision)||"",pe.scopeId||""].join(" ").toLowerCase().includes(ue)}):d},[d,l]),Q=$.useMemo(()=>s.find(ue=>ue.key===r)||s[0]||null,[s,r]),hh=$.useMemo(()=>_t?Il(_t,Pt||_t.entrySourcePath):null,[Pt,_t]),uh=$.useMemo(()=>Q?oK(Q.package):[],[Q]),Ki=$.useMemo(()=>Q?Il(Q.package,Q.selectedFilePath):null,[Q]),tr=$.useMemo(()=>{var ue,pe;return(pe=(ue=Q==null?void 0:Q.scopeDetail)==null?void 0:ue.source)!=null&&pe.sourceText?gQ(Q.scopeDetail.source.sourceText):null},[(Qg=(rd=Q==null?void 0:Q.scopeDetail)==null?void 0:rd.source)==null?void 0:Qg.sourceText]),it=$.useMemo(()=>{var Oe,We;const ue=((We=(Oe=Q==null?void 0:Q.scopeDetail)==null?void 0:Oe.script)==null?void 0:We.scriptId)||"";if(ue&&u[ue])return u[ue];const pe=(Q==null?void 0:Q.scriptId)||"";return pe&&u[pe]||null},[u,(Cx=(T_=Q==null?void 0:Q.scopeDetail)==null?void 0:T_.script)==null?void 0:Cx.scriptId,Q==null?void 0:Q.scriptId]),ir=$.useMemo(()=>Object.values(m).sort((ue,pe)=>{const Oe=(it==null?void 0:it.lastProposalId)===ue.proposalId?1:0,We=(it==null?void 0:it.lastProposalId)===pe.proposalId?1:0;return Oe!==We?We-Oe:pe.candidateRevision.localeCompare(ue.candidateRevision)}),[it==null?void 0:it.lastProposalId,m]),zt=$.useMemo(()=>{var ue;return Nr?g.find(pe=>pe.actorId===Nr)||(((ue=Q==null?void 0:Q.lastSnapshot)==null?void 0:ue.actorId)===Nr?Q.lastSnapshot:null):Q!=null&&Q.lastSnapshot?Q.lastSnapshot:Q!=null&&Q.runtimeActorId&&g.find(pe=>pe.actorId===Q.runtimeActorId)||null},[g,Q==null?void 0:Q.lastSnapshot,Q==null?void 0:Q.runtimeActorId,Nr]),li=$.useMemo(()=>{var ue;return Dr?m[Dr]||(((ue=Q==null?void 0:Q.lastPromotion)==null?void 0:ue.proposalId)===Dr?Q.lastPromotion:null):Q!=null&&Q.lastPromotion?Q.lastPromotion:it!=null&&it.lastProposalId&&m[it.lastProposalId]||null},[it==null?void 0:it.lastProposalId,m,Q==null?void 0:Q.lastPromotion,Dr]),Ro=Wut(zt),Qn=zut(tn,gn),Mo=$.useMemo(()=>Hut(tn,(Ki==null?void 0:Ki.path)||(tn==null?void 0:tn.primarySourcePath)||"Behavior.cs"),[Ki==null?void 0:Ki.path,tn]),Jn=(tn==null?void 0:tn.diagnostics)||[],Yg=gn||tn!=null,_c=y0e(Q);$.useEffect(()=>{Ra(null),_l(!1)},[Q==null?void 0:Q.key]),$.useEffect(()=>{var pe;const ue=(pe=t.current)==null?void 0:pe.getModel();if(ue)return zk.setModelMarkers(ue,"aevatar-script-validation",Mo),()=>{zk.setModelMarkers(ue,"aevatar-script-validation",[])}},[Mo,Q==null?void 0:Q.key]),$.useEffect(()=>{if(!Q)return;const ue=i.current+1;i.current=ue;const pe=new AbortController,Oe=window.setTimeout(async()=>{yn(!0);try{const We=await wl.validateDraftScript({scriptId:Q.scriptId,scriptRevision:Q.revision,package:Q.package},pe.signal);if(i.current!==ue)return;Ra(We)}catch(We){if(pe.signal.aborted||i.current!==ue)return;Ra({success:!1,scriptId:Q.scriptId,scriptRevision:Q.revision,primarySourcePath:Q.selectedFilePath||"Behavior.cs",errorCount:1,warningCount:0,diagnostics:[{severity:"error",code:"SCRIPT_VALIDATION_REQUEST",message:(We==null?void 0:We.message)||"Validation request failed.",filePath:"",startLine:null,startColumn:null,endLine:null,endColumn:null,origin:"host"}]})}finally{i.current===ue&&yn(!1)}},320);return()=>{pe.abort(),window.clearTimeout(Oe)}},[Q==null?void 0:Q.key,Q==null?void 0:Q.scriptId,Q==null?void 0:Q.revision,Q==null?void 0:Q.selectedFilePath,Q==null?void 0:Q.package]),$.useEffect(()=>{if(!Bn){h([]),f({}),b({});return}Un(!0)},[Bn,n.scopeId]),$.useEffect(()=>{if(!n.scriptsEnabled){p([]);return}Ao(!0)},[n.scriptsEnabled]),$.useEffect(()=>{const ue=pe=>{pe.altKey||pe.shiftKey||!(pe.metaKey||pe.ctrlKey)||pe.key.toLowerCase()!=="s"||(pe.preventDefault(),I_())};return window.addEventListener("keydown",ue),()=>window.removeEventListener("keydown",ue)},[Q==null?void 0:Q.key,Q==null?void 0:Q.scriptId,Q==null?void 0:Q.revision,Q==null?void 0:Q.package,Q==null?void 0:Q.baseRevision,Bn]),$.useEffect(()=>{var ue,pe;if(Q&&(nd(((ue=Q.lastSnapshot)==null?void 0:ue.actorId)||Q.runtimeActorId||""),fs(((pe=Q.lastPromotion)==null?void 0:pe.proposalId)||""),!(Dn==="runtime"&&(Q.lastRun||Q.lastSnapshot))&&!(Dn==="save"&&Q.scopeDetail)&&!(Dn==="promotion"&&Q.lastPromotion))){if(Q.lastRun||Q.lastSnapshot){ks("runtime");return}if(Q.scopeDetail){ks("save");return}Q.lastPromotion&&ks("promotion")}},[Q==null?void 0:Q.key,Q==null?void 0:Q.lastRun,Q==null?void 0:Q.lastSnapshot,Q==null?void 0:Q.scopeDetail,Q==null?void 0:Q.lastPromotion,Dn]);const sd=ue=>{ue.editor.defineTheme("aevatar-script-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"8D7B68"},{token:"keyword",foreground:"9B4D19",fontStyle:"bold"},{token:"string",foreground:"356A4C"},{token:"number",foreground:"A05A24"},{token:"type.identifier",foreground:"315A84"}],colors:{"editor.background":"#FCFBF8","editor.foreground":"#2A2723","editorLineNumber.foreground":"#B6AA99","editorLineNumber.activeForeground":"#6A5E4E","editorLineNumber.dimmedForeground":"#D5CCC0","editor.lineHighlightBackground":"#F5EFE5","editor.selectionBackground":"#DCE8FF","editor.inactiveSelectionBackground":"#ECF2FF","editorCursor.foreground":"#C06836","editorWhitespace.foreground":"#E7DED2","editorIndentGuide.background1":"#EDE5D9","editorIndentGuide.activeBackground1":"#D4C8B8","editorOverviewRuler.border":"#00000000","editorGutter.background":"#FCFBF8","editorWidget.background":"#FFFCF8","editorWidget.border":"#E7DED4","scrollbarSlider.background":"#D8CCBD88","scrollbarSlider.hoverBackground":"#C8B9A588","scrollbarSlider.activeBackground":"#B7A59188"}})},fh=ue=>{t.current=ue;const pe=ue.getModel();pe&&zk.setModelMarkers(pe,"aevatar-script-validation",Mo)};function Hu(ue){var Oe,We,Mt;const pe=ue.filePath||(Q==null?void 0:Q.selectedFilePath)||"";if(Q&&pe&&pe!==Q.selectedFilePath){Mi("source"),Qe(Q.key,at=>({...at,selectedFilePath:pe})),window.setTimeout(()=>Hu(ue),0);return}!ue.startLine||!ue.startColumn||(Mi("source"),(Oe=t.current)==null||Oe.revealPositionInCenter({lineNumber:ue.startLine,column:ue.startColumn}),(We=t.current)==null||We.setPosition({lineNumber:ue.startLine,column:ue.startColumn}),(Mt=t.current)==null||Mt.focus())}function Qe(ue,pe){o(Oe=>Oe.map(We=>We.key===ue?{...pe(We),updatedAtUtc:new Date().toISOString()}:We))}function re(){const ue=I0(s.length+1);o(pe=>[ue,...pe]),a(ue.key),K(!1),Os(!1)}function ke(ue){Q&&(Qe(Q.key,pe=>({...pe,selectedFilePath:ue})),Mi("source"),er(!0))}function dt(ue){if(!Q)return;const pe=ue==="csharp"?`NewFile${Q.package.csharpSources.length+1}.cs`:`schema${Q.package.protoFiles.length+1}.proto`,Oe=window.prompt(`Add ${ue==="csharp"?"C#":"proto"} file`,pe);if(!(Oe!=null&&Oe.trim()))return;const We=Eut(Q.package,ue,Oe.trim()),Mt=Il(We,Oe.trim());Qe(Q.key,at=>({...at,package:We,selectedFilePath:(Mt==null?void 0:Mt.path)||at.selectedFilePath})),Mi("source"),er(!0)}function Et(ue){if(!Q)return;const pe=window.prompt("Rename file",ue);if(!(pe!=null&&pe.trim())||pe.trim()===ue)return;const Oe=Nut(Q.package,ue,pe.trim()),We=Il(Oe,pe.trim());Qe(Q.key,Mt=>({...Mt,package:Oe,selectedFilePath:Mt.selectedFilePath===ue&&(We==null?void 0:We.path)||Mt.selectedFilePath})),er(!0)}function $n(ue){if(!Q)return;const pe=Dut(Q.package,ue),Oe=Il(pe,Q.selectedFilePath);Qe(Q.key,We=>({...We,package:pe,selectedFilePath:(Oe==null?void 0:Oe.path)||""}))}function ci(ue){Q&&(Qe(Q.key,pe=>({...pe,package:Tut(pe.package,ue),selectedFilePath:ue})),er(!0))}async function Un(ue=!1){if(Bn){w(!0);try{const pe=await wl.listScripts(!0),Oe=Array.isArray(pe)?[...pe].sort((We,Mt)=>{var St,kt;const at=Date.parse(((St=Mt.script)==null?void 0:St.updatedAt)||""),jt=Date.parse(((kt=We.script)==null?void 0:kt.updatedAt)||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(jt)?0:jt)}):[];h(Oe),await Gs(Oe),ue||e("Scope scripts refreshed","success")}catch(pe){ue||e((pe==null?void 0:pe.message)||"Failed to load saved scripts","error")}finally{w(!1)}}}async function Gs(ue){const pe=Array.from(new Set(ue.map(Oe=>{var We;return((We=Oe.script)==null?void 0:We.scriptId)||""}).filter(Boolean)));if(pe.length===0){f({}),b({});return}x(!0);try{const Oe=await Promise.all(pe.map(async St=>{try{const kt=await wl.getScriptCatalog(St);return[St,kt]}catch{return null}})),We={},Mt=new Set;for(const St of Oe)St!=null&&St[1]&&(We[St[0]]=St[1],St[1].lastProposalId&&Mt.add(St[1].lastProposalId));if(f(We),Mt.size===0){b({});return}const at=await Promise.all(Array.from(Mt).map(async St=>{try{const kt=await wl.getEvolutionDecision(St);return[St,kt]}catch{return null}})),jt={};for(const St of at)St!=null&&St[1]&&(jt[St[0]]=St[1]);b(jt)}finally{x(!1)}}async function Ao(ue=!1){S(!0);try{const pe=await wl.listScriptRuntimes(24),Oe=Array.isArray(pe)?[...pe].sort((We,Mt)=>{const at=Date.parse(Mt.updatedAt||""),jt=Date.parse(We.updatedAt||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(jt)?0:jt)}):[];p(Oe),ue||e("Runtime snapshots refreshed","success")}catch(pe){ue||e((pe==null?void 0:pe.message)||"Failed to load runtime snapshots","error")}finally{S(!1)}}function Vu(ue){p(pe=>{const Oe=pe.filter(We=>We.actorId!==ue.actorId);return Oe.unshift(ue),Oe.sort((We,Mt)=>{const at=Date.parse(Mt.updatedAt||""),jt=Date.parse(We.updatedAt||"");return(Number.isNaN(at)?0:at)-(Number.isNaN(jt)?0:jt)})})}function es(ue){var at,jt,St;const pe=((at=ue.script)==null?void 0:at.scriptId)||((jt=ue.source)==null?void 0:jt.revision)||`script-${s.length+1}`,Oe=of(pe,"script"),We=s.find(kt=>of(kt.scriptId,"script")===Oe),Mt=$ut(ue,s.length+1,We);We?(o(kt=>kt.map(Tn=>Tn.key===We.key?Mt:Tn)),a(We.key)):(o(kt=>[Mt,...kt]),a(Mt.key)),ks("save"),fs(((St=u[pe])==null?void 0:St.lastProposalId)||""),K(!1),Os(!1),e("Saved script loaded into the editor","success")}async function od(ue,pe=!1){const Oe=ue.trim();if(!Oe)return pe||e("Run the draft first","info"),null;M(!0);try{const We=await wl.getRuntimeReadModel(Oe);return o(Mt=>Mt.map(at=>at.runtimeActorId===We.actorId?{...at,lastSnapshot:We,runtimeActorId:We.actorId||at.runtimeActorId,definitionActorId:We.definitionActorId||at.definitionActorId,updatedAtUtc:new Date().toISOString()}:at)),Vu(We),nd(We.actorId||Oe),ks("runtime"),pe||Os(!0),pe||e("Runtime snapshot refreshed","success"),We}catch(We){return pe||e((We==null?void 0:We.message)||"Failed to load runtime snapshot","error"),null}finally{M(!1)}}async function gh(ue){const pe=ue.trim();if(!pe)return null;for(let Oe=0;Oe<6;Oe+=1){const We=await od(pe,!0);if(We)return We;await Uut(320)}return null}async function Yw(ue){nd(ue),ks("runtime"),Os(!0),g.find(Oe=>Oe.actorId===ue)||await od(ue,!0)}function _x(ue){fs(ue),ks("promotion"),Os(!0)}async function bx(){var pe,Oe;const ue=((Oe=(pe=Q==null?void 0:Q.scopeDetail)==null?void 0:pe.script)==null?void 0:Oe.scriptId)||(Q==null?void 0:Q.scriptId)||"";if(!(!Bn||!ue))try{const We=await wl.getScriptCatalog(ue);if(f(Mt=>({...Mt,[ue]:We})),We.lastProposalId)try{const Mt=await wl.getEvolutionDecision(We.lastProposalId);b(at=>({...at,[We.lastProposalId]:Mt}))}catch{}e("Catalog history refreshed","success")}catch(We){e((We==null?void 0:We.message)||"Failed to load catalog history","error")}}async function bl(){var pe;const ue=(li==null?void 0:li.proposalId)||(it==null?void 0:it.lastProposalId)||((pe=Q==null?void 0:Q.lastPromotion)==null?void 0:pe.proposalId)||"";if(ue){x(!0);try{const Oe=await wl.getEvolutionDecision(ue);b(We=>({...We,[ue]:Oe})),fs(ue),e("Proposal decision refreshed","success")}catch(Oe){e((Oe==null?void 0:Oe.message)||"Failed to load proposal decision","error")}finally{x(!1)}}}async function I_(){var Mt;if(!Q)return;const ue=KL(Q.package);if(!ue.trim()){e("Script source is required","error");return}if(!Bn){e("Draft is already stored locally on this device","success");return}const pe=of(Q.scriptId,"script"),Oe=of(Q.revision,"draft"),We=(Q.baseRevision||"").trim()||void 0;W(!0);try{const at=await wl.saveScript({scriptId:pe,revisionId:Oe,expectedBaseRevision:We,package:Q.package}),jt=jN(null,((Mt=at.source)==null?void 0:Mt.sourceText)||ue).package,St=Il(jt,Q.selectedFilePath);Qe(Q.key,kt=>{var Tn,A_,P_,ts,tp,ad,O_,F_,vc;return{...kt,scriptId:((Tn=at.script)==null?void 0:Tn.scriptId)||pe,revision:((A_=at.script)==null?void 0:A_.activeRevision)||((P_=at.source)==null?void 0:P_.revision)||Oe,baseRevision:((ts=at.script)==null?void 0:ts.activeRevision)||((tp=at.source)==null?void 0:tp.revision)||Oe,package:jt,selectedFilePath:(St==null?void 0:St.path)||kt.selectedFilePath,definitionActorId:((ad=at.script)==null?void 0:ad.definitionActorId)||((O_=at.source)==null?void 0:O_.definitionActorId)||kt.definitionActorId,lastSourceHash:((F_=at.source)==null?void 0:F_.sourceHash)||((vc=at.script)==null?void 0:vc.activeSourceHash)||kt.lastSourceHash,scopeDetail:at}}),ks("save"),Os(!0),fs(""),await Un(!0),e("Script saved to the current scope","success")}catch(at){e((at==null?void 0:at.message)||"Failed to save script","error")}finally{W(!1)}}async function Zg(ue){var pe;if(!ue.trim())return e("Nothing to copy","info"),!1;if(!((pe=navigator.clipboard)!=null&&pe.writeText))return e("Clipboard is unavailable in this browser context","error"),!1;try{return await navigator.clipboard.writeText(ue),!0}catch(Oe){return e((Oe==null?void 0:Oe.message)||"Failed to copy to clipboard","error"),!1}}function ph(){Q&&(po(Q.input),Er(!0))}async function E_(){Q&&await Xg(Ta)}async function Xg(ue){if(!Q)return;const pe=jN(Q.package);if(!KL(pe.package).trim()){e("Script source is required","error");return}const We=of(Q.scriptId,"script"),Mt=of(Q.revision,"draft");pe.migrated&&Qe(Q.key,at=>({...at,package:pe.package,selectedFilePath:pe.package.entrySourcePath||at.selectedFilePath,definitionActorId:"",runtimeActorId:"",lastSourceHash:"",lastRun:null,lastSnapshot:null,lastPromotion:null,scopeDetail:null})),Qe(Q.key,at=>({...at,input:ue})),E(!0);try{const at=await wl.runDraftScript({scriptId:We,scriptRevision:Mt,package:pe.package,input:ue,definitionActorId:pe.migrated?"":Q.definitionActorId,runtimeActorId:pe.migrated?"":Q.runtimeActorId});Qe(Q.key,St=>({...St,input:ue,scriptId:at.scriptId||We,revision:at.scriptRevision||Mt,definitionActorId:at.definitionActorId||St.definitionActorId,runtimeActorId:at.runtimeActorId||St.runtimeActorId,lastSourceHash:at.sourceHash||St.lastSourceHash,lastRun:at})),Er(!1),ks("runtime"),Os(!0),nd(at.runtimeActorId||"");const jt=await gh(at.runtimeActorId||"");await Ao(!0),e(jt?"Draft run completed":"Draft accepted. Runtime snapshot is catching up.",jt?"success":"info")}catch(at){e((at==null?void 0:at.message)||"Draft run failed","error")}finally{E(!1)}}async function Zw(){var at,jt;if(!Q)return;if(!KL(Q.package).trim()){e("Script source is required","error");return}const pe=of(Q.scriptId,"script"),Oe=of(Q.revision,"draft"),We=(Q.baseRevision||((jt=(at=Q.scopeDetail)==null?void 0:at.script)==null?void 0:jt.activeRevision)||"").trim(),Mt=We?of(We,"base"):"";B(!0);try{const St=await dRe.proposeEvolution({scriptId:pe,baseRevision:Mt,candidateRevision:Oe,candidatePackage:Q.package,candidateSourceHash:"",reason:Q.reason,proposalId:`${pe}-${Oe}-${Date.now()}`});Qe(Q.key,kt=>({...kt,scriptId:pe,revision:Oe,baseRevision:St!=null&&St.accepted?Oe:kt.baseRevision,lastPromotion:St})),b(kt=>({...kt,[St.proposalId]:St})),fs(St.proposalId||""),ce(!1),ks("promotion"),Os(!0),Bn&&await Un(!0),e(St!=null&&St.accepted?"Promotion accepted":(St==null?void 0:St.failureReason)||"Promotion rejected",St!=null&&St.accepted?"success":"error")}catch(St){e((St==null?void 0:St.message)||"Promotion failed","error")}finally{B(!1)}}async function Xw(){if(!Q)return;if(!Be.trim()){e("Describe the script you want","error");return}const ue=Q.key;Ks(ue),Ir(!0),ze(""),ct(""),tt(""),yi(null),Cn("");try{const pe=await Hfe.authorScript({prompt:Be.trim(),currentSource:(Ki==null?void 0:Ki.content)||"",currentPackage:Q.package,currentFilePath:Q.selectedFilePath,metadata:{script_id:Q.scriptId,revision:Q.revision}},{onReasoning:jt=>ze(jt),onText:jt=>ct(jt)}),Oe=Iut(pe.scriptPackage),We=pe.currentFilePath||Q.selectedFilePath,Mt=Oe?Il(Oe,We):null,at=(Mt==null?void 0:Mt.content)||pe.text||"";ct(pe.text||at),tt(at),yi(Oe),Cn((Mt==null?void 0:Mt.path)||We),e(Oe?"AI package is ready to apply":"AI source is ready to apply","success")}catch(pe){e((pe==null?void 0:pe.message)||"Failed to generate script source","error")}finally{Ir(!1)}}function Qw(){const ue=Xn||(Q==null?void 0:Q.key)||"";if(!ue){e("Open a draft before applying generated source","error");return}if(!Ue.trim()){e("Generate source before applying it","info");return}if(!s.find(Oe=>Oe.key===ue)){e("The original draft is no longer available","error");return}Qe(ue,Oe=>{var We;return{...Oe,package:_t||uce(Oe.package,Oe.selectedFilePath,Ue),selectedFilePath:_t&&((We=Il(_t,Pt||Oe.selectedFilePath))==null?void 0:We.path)||Oe.selectedFilePath}}),a(ue),Mi("source"),xe(!1),e(_t?"AI package applied to the editor":"AI source applied to the editor","success")}async function N_(){await Zg(Ue)&&e("Generated source copied","success")}if(!Q)return null;if(!n.scriptsEnabled)return y.jsx("section",{className:"flex-1 min-h-0 bg-[#F2F1EE] p-6",children:y.jsx("div",{className:"flex h-full items-center justify-center rounded-[32px] border border-[#E6E3DE] bg-white/96 p-8 shadow-[0_26px_64px_rgba(17,24,39,0.08)]",children:y.jsxs("div",{className:"max-w-[360px] text-center",children:[y.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-[18px] bg-[#F3F0EA] text-gray-400",children:y.jsx(YI,{size:20})}),y.jsx("div",{className:"mt-4 text-[18px] font-semibold text-gray-800",children:"Scripts unavailable"})]})})});const mh=Array.isArray((R_=li==null?void 0:li.validationReport)==null?void 0:R_.diagnostics)?((_h=li==null?void 0:li.validationReport)==null?void 0:_h.diagnostics)||[]:[],vx=zt?`${Ro.status||"updated"} · ${Ro.output||"output pending"}`:Q.lastRun?`Accepted · ${Q.lastRun.runId}`:"Run the draft to materialize output.",D_=Bn?it?`${it.scriptId} · ${it.activeRevision}`:(M_=Q.scopeDetail)!=null&&M_.script?`${Q.scopeDetail.script.scriptId} · ${Q.scopeDetail.script.activeRevision}`:"Save this draft into the current scope.":"Local draft only. Sign in to save it into a scope.",Jw=li?`${li.status||"unknown"}${li.failureReason?` · ${li.failureReason}`:""}`:it!=null&&it.lastProposalId?`Latest proposal · ${it.lastProposalId}`:"Submit a promotion proposal when this draft is ready.",UD=((ep=(Jg=Q.scopeDetail)==null?void 0:Jg.script)==null?void 0:ep.scriptId)||"",bc=Jr,wx=pc==="package",zu=(ue=!1)=>`rounded-full border px-3 py-1.5 text-[11px] uppercase tracking-[0.14em] transition-colors ${ue?"border-[color:var(--accent-border)] bg-[#FFF4F1] text-[color:var(--accent-text)]":"border-[#E5DED3] bg-white text-gray-500 hover:bg-[#F9F6F0]"}`;function qD(){var ue,pe,Oe,We,Mt,at,jt,St,kt,Tn,A_,P_,ts,tp,ad,O_,F_,vc;return Dn==="runtime"?Q.lastRun||zt?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Runtime output"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:(zt==null?void 0:zt.actorId)||((ue=Q.lastRun)==null?void 0:ue.runId)||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[zt!=null&&zt.actorId||Q.runtimeActorId?y.jsx("button",{type:"button",onClick:()=>{od((zt==null?void 0:zt.actorId)||Q.runtimeActorId)},className:"panel-icon-button execution-logs-copy-action",title:"Refresh runtime result","aria-label":"Refresh runtime result",disabled:R,children:y.jsx(rk,{size:14,className:R?"animate-spin":""})}):null,y.jsx("div",{className:"rounded-full border border-[#E5DED3] bg-white px-3 py-1 text-[11px] uppercase tracking-[0.14em] text-gray-500",children:Ro.status||((pe=Q.lastRun)!=null&&pe.accepted?"accepted":"pending")})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Input"}),y.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Ro.input||Q.input||"-"})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Output"}),y.jsx("pre",{className:"mt-2 whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Ro.output||"-"})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Runtime details"}),y.jsxs("div",{className:"mt-3 grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Notes"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:Ro.notes.length>0?Ro.notes.join(", "):"-"})]}),y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Metadata"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",(zt==null?void 0:zt.scriptId)||Q.scriptId||"-"]}),y.jsxs("div",{children:["runtimeActorId: ",(zt==null?void 0:zt.actorId)||Q.runtimeActorId||"-"]}),y.jsxs("div",{children:["definitionActorId: ",(zt==null?void 0:zt.definitionActorId)||Q.definitionActorId||"-"]}),y.jsxs("div",{children:["stateVersion: ",(zt==null?void 0:zt.stateVersion)??"-"]}),y.jsxs("div",{children:["updatedAt: ",Ml(zt==null?void 0:zt.updatedAt)]})]})]})]}),y.jsx("pre",{className:"mt-4 max-h-[320px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:jut(zt==null?void 0:zt.readModelPayloadJson)})]})]}):y.jsx(eu,{title:"No runtime output yet",copy:"Run the current draft. The materialized read model will appear here."}):Dn==="save"?Bn?it||(Oe=Q.scopeDetail)!=null&&Oe.script?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Catalog state"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:(it==null?void 0:it.scopeId)||((We=Q.scopeDetail)==null?void 0:We.scopeId)||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>{bx()},className:"panel-icon-button execution-logs-copy-action",title:"Refresh catalog history","aria-label":"Refresh catalog history",children:y.jsx(rk,{size:14})}),y.jsx("div",{className:`rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.14em] ${_c?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]"}`,children:_c?"Unsaved changes":"Saved"})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Script"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["scriptId: ",(it==null?void 0:it.scriptId)||((at=(Mt=Q.scopeDetail)==null?void 0:Mt.script)==null?void 0:at.scriptId)||"-"]}),y.jsxs("div",{children:["revision: ",(it==null?void 0:it.activeRevision)||((St=(jt=Q.scopeDetail)==null?void 0:jt.script)==null?void 0:St.activeRevision)||"-"]}),y.jsxs("div",{children:["updatedAt: ",Ml((it==null?void 0:it.updatedAt)||((Tn=(kt=Q.scopeDetail)==null?void 0:kt.script)==null?void 0:Tn.updatedAt))]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Actors"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["catalogActorId: ",(it==null?void 0:it.catalogActorId)||((P_=(A_=Q.scopeDetail)==null?void 0:A_.script)==null?void 0:P_.catalogActorId)||"-"]}),y.jsxs("div",{children:["definitionActorId: ",(it==null?void 0:it.activeDefinitionActorId)||((tp=(ts=Q.scopeDetail)==null?void 0:ts.script)==null?void 0:tp.definitionActorId)||"-"]}),y.jsxs("div",{children:["sourceHash: ",(it==null?void 0:it.activeSourceHash)||((O_=(ad=Q.scopeDetail)==null?void 0:ad.script)==null?void 0:O_.activeSourceHash)||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"History and stored package"}),y.jsxs("div",{className:"mt-3 grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Revision History"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:(F_=it==null?void 0:it.revisionHistory)!=null&&F_.length?it.revisionHistory.join(" → "):(it==null?void 0:it.activeRevision)||"-"}),y.jsxs("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:["latestProposal: ",(it==null?void 0:it.lastProposalId)||"-"]})]}),y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Stored Package"}),y.jsxs("div",{className:"mt-2 text-[12px] leading-6 text-gray-600",children:["files: ",tr?oK(tr).length:0," · entry: ",(tr==null?void 0:tr.entrySourcePath)||"-"]}),y.jsx("pre",{className:"mt-3 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:tr&&((vc=Il(tr,tr.entrySourcePath))==null?void 0:vc.content)||"-"})]})]})]})]}):y.jsx(eu,{title:"Not saved into the scope",copy:"Use Save to persist this draft and make it show up in the saved scripts list."}):y.jsx(eu,{title:"Scope save unavailable",copy:"This app session does not have a resolved scope. The draft is still kept locally in your browser storage."}):li?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Promotion proposal"}),y.jsx("div",{className:"mt-1 text-[12px] text-gray-400",children:li.proposalId||"-"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:()=>{bl()},className:"panel-icon-button execution-logs-copy-action",title:"Refresh proposal decision","aria-label":"Refresh proposal decision",disabled:L,children:y.jsx(rk,{size:14,className:L?"animate-spin":""})}),y.jsx("div",{className:`rounded-full border px-3 py-1 text-[11px] uppercase tracking-[0.14em] ${li.accepted?"border-[#DCE8C8] bg-[#F5FBEE] text-[#5C7A2D]":"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]"}`,children:li.status||(li.accepted?"accepted":"rejected")})]})]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Revision"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["base: ",li.baseRevision||"-"]}),y.jsxs("div",{children:["candidate: ",li.candidateRevision||"-"]}),y.jsxs("div",{children:["scriptId: ",li.scriptId||"-"]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Decision"}),y.jsxs("div",{className:"mt-2 space-y-1 break-all text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["catalogActorId: ",li.catalogActorId||(it==null?void 0:it.catalogActorId)||"-"]}),y.jsxs("div",{children:["definitionActorId: ",li.definitionActorId||"-"]}),y.jsxs("div",{children:["failureReason: ",li.failureReason||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-4 py-3",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Validation diagnostics"}),mh.length>0?y.jsx("div",{className:"mt-3 space-y-2",children:mh.map((mi,ip)=>y.jsx("div",{className:"rounded-[16px] border border-[#EEEAE4] bg-[#FAF8F4] px-3 py-3 text-[12px] leading-6 text-gray-600",children:mi},`${mi}-${ip}`))}):y.jsx("div",{className:"mt-3 text-[12px] leading-6 text-gray-600",children:"No validation diagnostics were returned."})]})]}):y.jsx(eu,{title:"No promotion submitted",copy:it!=null&&it.lastProposalId?"The scope catalog points at a proposal id, but no terminal decision is visible yet.":"When the draft is stable, use Promote to send an evolution proposal and inspect the decision here."})}return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"studio-editor-header",children:y.jsx("div",{className:"studio-editor-toolbar",children:y.jsxs("div",{className:"studio-title-bar",children:[y.jsxs("div",{className:"studio-title-group",children:[y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"panel-eyebrow",children:"Scripts Studio"}),y.jsx("input",{className:"studio-title-input mt-1",value:Q.scriptId,onChange:ue=>Qe(Q.key,pe=>({...pe,scriptId:ue.target.value})),placeholder:"script-id","aria-label":"Script ID"}),y.jsxs("div",{className:"mt-0.5 flex items-center gap-2 overflow-hidden text-[11px] text-gray-400",children:[y.jsx("span",{className:"truncate",children:Q.revision||"draft revision"}),y.jsx("span",{"aria-hidden":"true",children:"·"}),y.jsx("span",{className:"truncate",children:n.hostMode==="embedded"?"Embedded host":"Proxy host"}),y.jsx("span",{"aria-hidden":"true",children:"·"}),y.jsx("span",{className:"truncate",children:Bn?`Scope ${n.scopeId||"-"}`:"Local draft"})]})]}),Yg?y.jsx("div",{className:`rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-[0.14em] ${gn?"border-[#E5DED3] bg-[#F7F2E8] text-[#8E6A3D]":tn!=null&&tn.errorCount?"border-[#F2CCC4] bg-[#FFF4F1] text-[#B15647]":tn!=null&&tn.warningCount?"border-[#E9D6AE] bg-[#FFF7E6] text-[#9B6A1C]":"border-[#D9E5CB] bg-[#F5FBEE] text-[#5C7A2D]"}`,children:Qn}):null]}),y.jsxs("div",{className:"studio-header-actions",children:[y.jsx("button",{type:"button",onClick:()=>ce(!0),"data-tooltip":"Promote","aria-label":"Promote",className:"panel-icon-button header-toolbar-action header-export-action",children:y.jsx(Pp,{size:15})}),y.jsx("button",{type:"button",onClick:()=>{I_()},"data-tooltip":Bn?"Save":"Save local","aria-label":Bn?"Save script":"Save local draft",disabled:A,className:"panel-icon-button header-toolbar-action header-save-action",children:y.jsx(iRe,{size:15})}),y.jsx("button",{type:"button",onClick:ph,"data-tooltip":"Run","aria-label":"Run script",disabled:I,className:"panel-icon-button header-toolbar-action header-run-action",children:y.jsx(t0,{size:15})})]})]})})}),y.jsx("section",{className:"relative flex-1 min-h-0 overflow-hidden bg-[#F2F1EE]",children:y.jsx("div",{className:"absolute inset-0 p-4 sm:p-5",children:y.jsxs("section",{className:"flex h-full min-h-0 flex-col overflow-hidden rounded-[28px] border border-[#E6E3DE] bg-white shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-[#EEEAE4] bg-[#FAF8F4] px-5 py-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Editor"}),y.jsx("div",{className:"mt-1 text-[15px] font-semibold text-gray-800",children:(Ki==null?void 0:Ki.path)||Q.selectedFilePath||"Behavior.cs"})]}),y.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[y.jsx("button",{type:"button",onClick:()=>er(ue=>!ue),className:zu(bc),children:bc?"Hide files":"Files"}),y.jsx("button",{type:"button",onClick:()=>Y(!0),className:zu(X||V||id||z),children:"Panels"}),y.jsx("button",{type:"button",onClick:()=>Mi("package"),className:zu(wx),children:"Package"}),y.jsx("button",{type:"button",onClick:()=>xe(!0),className:zu(Ce),children:"Ask AI"}),y.jsxs("div",{className:"flex items-center gap-2 text-[11px] uppercase tracking-[0.14em] text-gray-400",children:[_c?y.jsx("span",{className:"rounded-full border border-[#E9D6AE] bg-[#FFF7E6] px-3 py-1 text-[#9B6A1C]",children:"Unsaved scope changes"}):null,y.jsx("span",{children:Ml(Q.updatedAtUtc)})]})]})]}),y.jsx("div",{className:"min-h-0 flex-1 bg-[#FCFBF8]",children:y.jsxs("div",{className:"flex h-full min-h-0",children:[bc?y.jsx("div",{className:"w-[268px] min-w-[240px] max-w-[320px]",children:y.jsx(Aut,{entries:uh,selectedFilePath:(Ki==null?void 0:Ki.path)||Q.selectedFilePath,entrySourcePath:Q.package.entrySourcePath,onSelectFile:ke,onAddFile:dt,onRenameFile:Et,onRemoveFile:$n,onSetEntry:ci})}):null,y.jsx("div",{className:"min-h-0 flex-1",children:y.jsx(vMe,{path:`file:///scripts/${Q.key}/${(Ki==null?void 0:Ki.path)||(tn==null?void 0:tn.primarySourcePath)||"Behavior.cs"}`,language:(Ki==null?void 0:Ki.kind)==="proto"?"plaintext":"csharp",theme:"aevatar-script-light",value:(Ki==null?void 0:Ki.content)||"",beforeMount:sd,onMount:fh,onChange:ue=>Qe(Q.key,pe=>({...pe,package:uce(pe.package,pe.selectedFilePath,ue??"")})),loading:y.jsx("div",{className:"flex h-full items-center justify-center text-[12px] uppercase tracking-[0.14em] text-gray-400",children:"Loading"}),options:{automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,smoothScrolling:!0,fontSize:13,lineHeight:23,fontLigatures:!0,tabSize:4,insertSpaces:!0,renderWhitespace:"selection",renderValidationDecorations:"on",lineNumbersMinChars:3,quickSuggestions:!1,suggestOnTriggerCharacters:!1,wordWrap:"off",stickyScroll:{enabled:!1},bracketPairColorization:{enabled:!0},guides:{indentation:!0,bracketPairs:!0},folding:!0,padding:{top:18,bottom:18},scrollbar:{verticalScrollbarSize:10,horizontalScrollbarSize:10}}})})]})}),y.jsx("div",{className:"border-t border-[#EEEAE4] bg-[#FFFCF8] px-4 py-3",children:y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Compiler"}),y.jsx("div",{className:"mt-1 truncate text-[13px] text-gray-700",children:gn?"Checking":Jn[0]?Jn[0].message:"Clean"})]}),Jn.length>0?y.jsxs("button",{type:"button",onClick:()=>_l(!0),className:zu(gc),children:["Problems ",Jn.length]}):y.jsx("div",{className:"rounded-full border border-[#DCE8C8] bg-[#F5FBEE] px-3 py-1.5 text-[11px] uppercase tracking-[0.14em] text-[#5C7A2D]",children:"Clean"})]})})]})})}),y.jsx(sf,{open:X,eyebrow:"Workspace",title:"Panels",onClose:()=>Y(!1),width:"min(680px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>Y(!1),className:"ghost-action",children:"Close"}),children:y.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[y.jsxs("button",{type:"button",onClick:()=>{Y(!1),K(!0)},className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4 text-left transition-colors hover:bg-white",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400",children:"Library"}),y.jsx("div",{className:"mt-2 text-[14px] font-semibold text-gray-800",children:"Drafts and saved scripts"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-500",children:"Browse local drafts, scope scripts, runtimes, and proposal decisions."})]}),y.jsxs("button",{type:"button",onClick:()=>{Y(!1),Os(!0)},className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4 text-left transition-colors hover:bg-white",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400",children:"Activity"}),y.jsx("div",{className:"mt-2 text-[14px] font-semibold text-gray-800",children:"Run, save, promote"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-500",children:"Inspect runtime output, catalog state, and promotion results."})]}),y.jsxs("button",{type:"button",onClick:()=>{Y(!1),j(!0)},className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] px-4 py-4 text-left transition-colors hover:bg-white",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.14em] text-gray-400",children:"Details"}),y.jsx("div",{className:"mt-2 text-[14px] font-semibold text-gray-800",children:"Metadata and contract"}),y.jsx("div",{className:"mt-2 text-[12px] leading-6 text-gray-500",children:"Check actor ids, app contract, package facts, and saved scope state."})]})]})}),y.jsx(sf,{open:wx,eyebrow:"Package",title:"Package manifest",onClose:()=>Mi("source"),width:"min(980px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>Mi("source"),className:"ghost-action",children:"Close"}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Entry contract"}),y.jsxs("div",{className:"mt-3 space-y-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Entry Behavior Type"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"DraftBehavior",value:Q.package.entryBehaviorTypeName,onChange:ue=>Qe(Q.key,pe=>({...pe,package:Rut(pe.package,ue.target.value)}))})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Entry Source Path"}),y.jsx("div",{className:"mt-1 break-all text-[13px] leading-6 text-gray-700",children:Q.package.entrySourcePath||"-"})]})]})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-white p-4",children:[y.jsx("div",{className:"section-heading",children:"Package summary"}),y.jsxs("div",{className:"mt-3 space-y-2 text-[12px] leading-6 text-gray-600",children:[y.jsxs("div",{children:["format: ",Q.package.format]}),y.jsxs("div",{children:["csharp files: ",Q.package.csharpSources.length]}),y.jsxs("div",{children:["proto files: ",Q.package.protoFiles.length]}),y.jsxs("div",{children:["selected file: ",Q.selectedFilePath||"-"]})]})]})]}),y.jsxs("details",{className:"rounded-[20px] border border-[#EEEAE4] bg-white px-4 py-4",children:[y.jsx("summary",{className:"cursor-pointer text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Persisted source preview"}),y.jsx("pre",{className:"mt-3 max-h-[420px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:KL(Q.package)||"-"})]})]})}),y.jsx(sf,{open:id,eyebrow:"Activity",title:"Draft activity",onClose:()=>Os(!1),width:"min(1180px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>Os(!1),className:"ghost-action",children:"Close"}),children:y.jsxs("div",{className:"min-h-[620px] grid gap-4 xl:grid-cols-[240px_minmax(0,1fr)]",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsx(M6,{active:Dn==="runtime",title:"Draft Run",meta:zt?Ml(zt.updatedAt):Q.lastRun?Ml(Q.updatedAtUtc):"Not run yet",summary:vx,status:Ro.status||((yx=Q.lastRun)!=null&&yx.accepted?"accepted":""),onClick:()=>ks("runtime")}),y.jsx(M6,{active:Dn==="save",title:"Catalog",meta:it?Ml(it.updatedAt):(ju=Q.scopeDetail)!=null&&ju.script?Ml(Q.scopeDetail.script.updatedAt):Bn?"Not saved yet":"Local only",summary:D_,status:Bn?_c?"dirty":it||($u=Q.scopeDetail)!=null&&$u.script?"saved":"pending":"local",onClick:()=>ks("save")}),y.jsx(M6,{active:Dn==="promotion",title:"Promotion",meta:(li==null?void 0:li.candidateRevision)||(it==null?void 0:it.lastProposalId)||"No candidate",summary:Jw,status:(li==null?void 0:li.status)||"",onClick:()=>ks("promotion")})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:qD()})]})}),y.jsx(sf,{open:gc,eyebrow:"Compiler",title:"Validation diagnostics",onClose:()=>_l(!1),width:"min(920px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>_l(!1),className:"ghost-action",children:"Close"}),children:y.jsx("div",{className:"min-h-[420px]",children:Jn.length>0?y.jsx("div",{className:"max-h-[560px] space-y-2 overflow-auto pr-1",children:Jn.map((ue,pe)=>y.jsxs("button",{type:"button",onClick:()=>{Hu(ue),_l(!1)},className:`w-full rounded-[18px] border px-3 py-3 text-left transition-colors ${ue.severity==="error"?"border-[#F3D3CD] bg-[#FFF5F2] hover:bg-[#FFF0EB]":ue.severity==="warning"?"border-[#EADBB8] bg-[#FFF8EB] hover:bg-[#FFF4DE]":"border-[#E6E0D7] bg-white hover:bg-[#FBFAF7]"}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"truncate text-[12px] font-semibold uppercase tracking-[0.12em] text-gray-500",children:ue.code||ue.severity}),y.jsx("div",{className:"truncate text-[11px] text-gray-400",children:Vut(ue)})]}),y.jsx("div",{className:"mt-2 text-[13px] leading-6 text-gray-700",children:ue.message})]},`${ue.code}-${ue.filePath}-${ue.startLine}-${ue.startColumn}-${pe}`))}):y.jsx(eu,{title:"No diagnostics",copy:"The current draft validated cleanly."})})}),y.jsx(sf,{open:Ce,eyebrow:"Source",title:"Ask AI",onClose:()=>xe(!1),width:"min(1040px, 100%)",actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>xe(!1),className:"ghost-action",children:"Close"}),y.jsxs("button",{type:"button",onClick:()=>{Xw()},className:"solid-action",disabled:kr,children:[y.jsx(JC,{size:14})," ",kr?"Thinking":"Generate"]})]}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsx("p",{className:"text-[12px] leading-6 text-gray-500",children:"Describe the script change you want. Ask AI returns a full script package and keeps the generated file preview here until you apply it."}),y.jsx("textarea",{rows:5,className:"panel-textarea",placeholder:"Build a script that validates an email address, normalizes it, and returns a JSON summary.",value:Be,onChange:ue=>Ee(ue.target.value)}),y.jsx("div",{className:"text-[11px] text-gray-400",children:kr?"Generating and compiling file content...":Ue?`Ready to apply ${_t?`${_t.csharpSources.length+_t.protoFiles.length} files`:"the active file"}`:"Return format: script package JSON"}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-2",children:[y.jsxs("div",{className:"rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Thinking"}),y.jsx("pre",{className:"mt-2 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-600",children:Le||"LLM reasoning will stream here."})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Generated Preview"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{type:"button",onClick:Qw,disabled:!Ue.trim(),title:"Apply generated source to the editor.","aria-label":"Apply generated source to the editor",className:"panel-icon-button",children:y.jsx(Pp,{size:14})}),y.jsx("button",{type:"button",onClick:()=>{N_()},disabled:!Ue.trim(),title:"Copy generated source.","aria-label":"Copy generated source",className:"panel-icon-button",children:y.jsx(yR,{size:14})})]})]}),_t?y.jsxs("div",{className:"mt-2 text-[11px] leading-5 text-gray-400",children:[(hh==null?void 0:hh.path)||Pt||"-"," · ",_t.csharpSources.length," C# · ",_t.protoFiles.length," proto"]}):null,y.jsx("pre",{className:"mt-2 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:Ue||Ct||"Generated file content will appear here."})]})]})]})}),y.jsx(sf,{open:V,eyebrow:"Scripts Studio",title:"Draft library",onClose:()=>K(!1),width:"min(980px, 100%)",actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>K(!1),className:"ghost-action",children:"Close"}),y.jsxs("button",{type:"button",onClick:re,className:"solid-action",children:[y.jsx(xf,{size:14})," New draft"]})]}),children:y.jsx("div",{className:"min-h-[560px]",children:y.jsx(Put,{drafts:s,filteredDrafts:Sn,filteredScopeScripts:mc,runtimeSnapshots:g,proposalDecisions:ir,scopeCatalogsByScriptId:u,selectedDraft:Q,scopeSelectionId:UD,selectedRuntimeActorId:Nr,selectedProposalId:Dr,search:l,scopeBacked:Bn,scopeId:n.scopeId,scopeScriptsPending:v,runtimeSnapshotsPending:C,proposalDecisionsPending:L,onSearchChange:c,onCreateDraft:re,onSelectDraft:ue=>{a(ue),K(!1)},onOpenScopeScript:ue=>{es(ue),K(!1)},onRefreshScopeScripts:()=>{Un()},onSelectRuntime:ue=>{Yw(ue),K(!1)},onRefreshRuntimeSnapshots:()=>{Ao()},onSelectProposal:ue=>{_x(ue),K(!1)}})})}),y.jsx(sf,{open:z,eyebrow:"Script",title:"Draft details",onClose:()=>j(!1),width:"min(880px, 100%)",actions:y.jsx("button",{type:"button",onClick:()=>j(!1),className:"ghost-action",children:"Close"}),children:y.jsx("div",{className:"min-h-[520px]",children:y.jsx(Mut,{selectedDraft:Q,scopeBacked:Bn,appContext:n})})}),y.jsx(sf,{open:te,eyebrow:"Governance",title:"Promote draft",onClose:()=>ce(!1),width:"min(760px, 100%)",actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>ce(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{type:"button",onClick:()=>{Zw()},disabled:P,className:"solid-action",children:[y.jsx(Pp,{size:14})," ",P?"Promoting":"Promote"]})]}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Base Revision"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"base revision",value:Q.baseRevision,onChange:ue=>Qe(Q.key,pe=>({...pe,baseRevision:ue.target.value}))})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Candidate Revision"}),y.jsx("input",{className:"panel-input mt-1",placeholder:"candidate revision",value:Q.revision,onChange:ue=>Qe(Q.key,pe=>({...pe,revision:ue.target.value}))})]})]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Reason"}),y.jsx("textarea",{rows:5,className:"panel-textarea mt-1",placeholder:"Describe why this revision should be promoted",value:Q.reason,onChange:ue=>Qe(Q.key,pe=>({...pe,reason:ue.target.value}))})]}),y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("div",{className:"section-heading",children:"Latest Decision"}),y.jsx("div",{className:"mt-2 text-[13px] leading-6 text-gray-700",children:Q.lastPromotion?`${Q.lastPromotion.status||"-"}${Q.lastPromotion.failureReason?` · ${Q.lastPromotion.failureReason}`:""}`:"No promotion has been submitted for this draft."}),mh.length>0?y.jsx("div",{className:"mt-4 space-y-2",children:mh.map((ue,pe)=>y.jsx("div",{className:"rounded-[16px] border border-[#EEEAE4] bg-white px-3 py-3 text-[12px] leading-6 text-gray-600",children:ue},`${ue}-${pe}`))}):null]})]})}),y.jsx(sf,{open:fc,eyebrow:"Runtime",title:"Run Draft",onClose:()=>Er(!1),actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{type:"button",onClick:()=>Er(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{type:"button",onClick:()=>{E_()},disabled:I,className:"solid-action",children:[y.jsx(t0,{size:14})," ",I?"Running":"Run draft"]})]}),children:y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] px-4 py-4 text-[12px] leading-6 text-gray-600",children:["This input is passed into the script through ",y.jsx("code",{className:"rounded bg-white px-1.5 py-0.5 text-[11px]",children:"AppScriptCommand"}),". The execution result will appear in the Activity dialog."]}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:Q.scriptId}),y.jsx("textarea",{rows:7,className:"panel-textarea mt-1 run-prompt-textarea",placeholder:"Enter the draft input to execute",value:Ta,onChange:ue=>po(ue.target.value)})]})]})})]})}const u4=[{key:"data",label:"Data",color:"#3B82F6",items:["transform","assign","retrieve_facts","cache"]},{key:"control",label:"Control",color:"#8B5CF6",items:["guard","conditional","switch","while","delay","wait_signal","checkpoint"]},{key:"ai",label:"AI",color:"#EC4899",items:["llm_call","tool_call","evaluate","reflect"]},{key:"composition",label:"Composition",color:"#F59E0B",items:["foreach","parallel","race","map_reduce","workflow_call","dynamic_workflow","vote"]},{key:"integration",label:"Integration",color:"#10B981",items:["connector_call","emit"]},{key:"human",label:"Human",color:"#06B6D4",items:["human_input","human_approval"]},{key:"validation",label:"Validation",color:"#64748B",items:["workflow_yaml_validate"]}];u4.flatMap(n=>n.items);const Kut="llm_call",x0e=new Set(["llm_call","tool_call","evaluate","reflect","while","parallel","race","connector_call"]),L0e={transform:{op:"trim"},assign:{target:"result",value:"$input"},retrieve_facts:{query:"",top_k:"3"},cache:{cache_key:"$input",ttl_seconds:"600",child_step_type:"llm_call"},guard:{check:"not_empty",on_fail:"fail"},conditional:{condition:'${eq($input, "ok")}'},switch:{on:"$input"},while:{step:"llm_call",max_iterations:"5",condition:"${lt(iteration, 5)}"},delay:{duration_ms:"1000"},wait_signal:{signal_name:"continue",timeout_ms:"60000"},checkpoint:{name:"checkpoint_1"},llm_call:{prompt_prefix:"Review the input and produce the next step."},tool_call:{tool:"web_search"},evaluate:{criteria:"correctness",scale:"1-5",threshold:"4"},reflect:{max_rounds:"3",criteria:"accuracy and conciseness"},foreach:{delimiter:"\\n---\\n",sub_step_type:"llm_call"},parallel:{workers:"assistant",parallel_count:"3",vote_step_type:"vote"},race:{workers:"assistant",count:"2"},map_reduce:{delimiter:"\\n---\\n",map_step_type:"llm_call",reduce_step_type:"llm_call"},workflow_call:{workflow:"child_workflow",lifecycle:"scope"},dynamic_workflow:{original_input:"$input"},vote:{},connector_call:{connector:"",operation:"",path:"",method:"POST",timeout_ms:"10000",retry:"0",on_error:"fail"},emit:{event_type:"workflow.completed",payload:"$input"},human_input:{prompt:"Please provide the missing input.",variable:"human_response"},human_approval:{prompt:"Approve this step?",on_reject:"fail"},workflow_yaml_validate:{}};function A6(){return{workflowId:null,directoryId:null,fileName:"",filePath:"",name:"draft",description:"",closedWorldMode:!1,yaml:"",findings:[],dirty:!1,lastSavedAt:null}}function Nm(n=1,e={}){return{key:e.key||`role_${crypto.randomUUID()}`,id:e.id??(n===1?"assistant":`role_${n}`),name:e.name??(n===1?"Assistant":`Role ${n}`),systemPrompt:e.systemPrompt??"",provider:e.provider??"",model:e.model??"",connectorsText:e.connectorsText??""}}function Cb(){return[Nm(1)]}function pce(n,e=1){return Nm(e,{id:(n==null?void 0:n.id)||"",name:(n==null?void 0:n.name)||(n==null?void 0:n.id)||"",systemPrompt:(n==null?void 0:n.systemPrompt)||(n==null?void 0:n.system_prompt)||"",provider:(n==null?void 0:n.provider)||"",model:(n==null?void 0:n.model)||"",connectorsText:Array.isArray(n==null?void 0:n.connectors)?n.connectors.join(` +`):(n==null?void 0:n.connectorsText)||""})}function mce(n){return{id:n.id.trim(),name:(n.name||n.id).trim(),systemPrompt:n.systemPrompt||"",provider:n.provider.trim(),model:n.model.trim(),connectors:Cl(n.connectorsText)}}function Gut(n="http",e=""){return{key:`connector_${crypto.randomUUID()}`,name:e,type:n,enabled:!0,timeoutMs:"30000",retry:"0",http:{baseUrl:"",allowedMethods:["POST"],allowedPaths:["/"],allowedInputKeys:[],defaultHeaders:{}},cli:{command:"",fixedArguments:[],allowedOperations:[],allowedInputKeys:[],workingDirectory:"",environment:{}},mcp:{serverName:"",command:"",arguments:[],environment:{},defaultTool:"",allowedTools:[],allowedInputKeys:[]}}}function _ce(n){var e,t,i,s,o,r,a,l,c,d,h,u,f,g,p,m,b,v;return{key:`connector_${crypto.randomUUID()}`,name:(n==null?void 0:n.name)||"",type:(n==null?void 0:n.type)||"http",enabled:(n==null?void 0:n.enabled)!==!1,timeoutMs:String((n==null?void 0:n.timeoutMs)??3e4),retry:String((n==null?void 0:n.retry)??0),http:{baseUrl:((e=n==null?void 0:n.http)==null?void 0:e.baseUrl)||"",allowedMethods:Array.isArray((t=n==null?void 0:n.http)==null?void 0:t.allowedMethods)?[...n.http.allowedMethods]:["POST"],allowedPaths:Array.isArray((i=n==null?void 0:n.http)==null?void 0:i.allowedPaths)?[...n.http.allowedPaths]:["/"],allowedInputKeys:Array.isArray((s=n==null?void 0:n.http)==null?void 0:s.allowedInputKeys)?[...n.http.allowedInputKeys]:[],defaultHeaders:{...((o=n==null?void 0:n.http)==null?void 0:o.defaultHeaders)||{}}},cli:{command:((r=n==null?void 0:n.cli)==null?void 0:r.command)||"",fixedArguments:Array.isArray((a=n==null?void 0:n.cli)==null?void 0:a.fixedArguments)?[...n.cli.fixedArguments]:[],allowedOperations:Array.isArray((l=n==null?void 0:n.cli)==null?void 0:l.allowedOperations)?[...n.cli.allowedOperations]:[],allowedInputKeys:Array.isArray((c=n==null?void 0:n.cli)==null?void 0:c.allowedInputKeys)?[...n.cli.allowedInputKeys]:[],workingDirectory:((d=n==null?void 0:n.cli)==null?void 0:d.workingDirectory)||"",environment:{...((h=n==null?void 0:n.cli)==null?void 0:h.environment)||{}}},mcp:{serverName:((u=n==null?void 0:n.mcp)==null?void 0:u.serverName)||"",command:((f=n==null?void 0:n.mcp)==null?void 0:f.command)||"",arguments:Array.isArray((g=n==null?void 0:n.mcp)==null?void 0:g.arguments)?[...n.mcp.arguments]:[],environment:{...((p=n==null?void 0:n.mcp)==null?void 0:p.environment)||{}},defaultTool:((m=n==null?void 0:n.mcp)==null?void 0:m.defaultTool)||"",allowedTools:Array.isArray((b=n==null?void 0:n.mcp)==null?void 0:b.allowedTools)?[...n.mcp.allowedTools]:[],allowedInputKeys:Array.isArray((v=n==null?void 0:n.mcp)==null?void 0:v.allowedInputKeys)?[...n.mcp.allowedInputKeys]:[]}}}function bce(n){return{name:n.name.trim(),type:n.type,enabled:n.enabled,timeoutMs:Cce(n.timeoutMs,3e4),retry:Cce(n.retry,0),http:{baseUrl:n.http.baseUrl.trim(),allowedMethods:n.http.allowedMethods.map(e=>e.trim().toUpperCase()).filter(Boolean),allowedPaths:n.http.allowedPaths.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.http.allowedInputKeys.map(e=>e.trim()).filter(Boolean),defaultHeaders:n.http.defaultHeaders},cli:{command:n.cli.command.trim(),fixedArguments:n.cli.fixedArguments.map(e=>e.trim()).filter(Boolean),allowedOperations:n.cli.allowedOperations.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.cli.allowedInputKeys.map(e=>e.trim()).filter(Boolean),workingDirectory:n.cli.workingDirectory.trim(),environment:n.cli.environment},mcp:{serverName:n.mcp.serverName.trim(),command:n.mcp.command.trim(),arguments:n.mcp.arguments.map(e=>e.trim()).filter(Boolean),environment:n.mcp.environment,defaultTool:n.mcp.defaultTool.trim(),allowedTools:n.mcp.allowedTools.map(e=>e.trim()).filter(Boolean),allowedInputKeys:n.mcp.allowedInputKeys.map(e=>e.trim()).filter(Boolean)}}}function Yut(n,e){const t=new Set(n.map(r=>r.name)),i=`${e}_connector`;let s=1,o=i;for(;t.has(o);)s+=1,o=`${i}_${s}`;return o}function Cl(n){return String(n||"").split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function k0e(n){return u4.find(e=>e.items.includes(n))||{key:"custom",label:"Custom",color:"#6B7280",items:[]}}function Zut(n,e,t,i,s,o={}){var d,h;const r=structuredClone(L0e[n]||{}),a=n==="connector_call"&&((d=Jut(s))==null?void 0:d.name)||"";a&&dM(r,a,s);const l=Qut(n,t),c=x0e.has(n)?o.targetRole??((h=i[0])==null?void 0:h.id)??"":o.targetRole??"";return{id:`node_${crypto.randomUUID()}`,type:"aevatarNode",position:e,data:{label:o.label||l,stepId:l,stepType:n,targetRole:c,parameters:{...r,...structuredClone(o.parameters||{})}}}}function Xut(n){return structuredClone(L0e[n]||{})}function vce(n){return x0e.has(n)}function Qut(n,e){const t=n.replace(/[^a-z0-9]+/gi,"_").toLowerCase(),i=new Set(e.map(r=>r.data.stepId));let s=e.length+1,o=`${t}_${s}`;for(;i.has(o);)s+=1,o=`${t}_${s}`;return o}function dM(n,e,t){if(!e)return n;const i=t.find(s=>s.name===e);return n.connector=e,i?i.type==="http"?((!n.method||!i.http.allowedMethods.includes(String(n.method).toUpperCase()))&&(n.method=i.http.allowedMethods[0]||"POST"),!n.path&&i.http.allowedPaths.length>0&&(n.path=i.http.allowedPaths[0]),n):i.type==="cli"?(!n.operation&&i.cli.allowedOperations.length>0&&(n.operation=i.cli.allowedOperations[0]),n):(n.operation||(n.operation=i.mcp.defaultTool||i.mcp.allowedTools[0]||""),n):n}function Jut(n){return n.find(e=>e.enabled)||n[0]||null}function tR(n,e,t=Cb()){const i=(n==null?void 0:n.document)||(n==null?void 0:n.rootWorkflow)||n,s=Array.isArray(i==null?void 0:i.roles)&&i.roles.length>0?i.roles.map((h,u)=>Nm(u+1,{id:h.id||"",name:h.name||h.id||"",systemPrompt:h.systemPrompt||"",provider:h.provider||"",model:h.model||"",connectorsText:Array.isArray(h.connectors)?h.connectors.join(` +`):""})):t,o=Array.isArray(i==null?void 0:i.steps)?i.steps:[],r=hft(e)?(e==null?void 0:e.nodePositions)||{}:{},a=uft(o),l=o.map((h,u)=>{const f=r[h.id]||a[h.id];return{id:`node_${crypto.randomUUID()}`,type:"aevatarNode",position:{x:Number.isFinite(f==null?void 0:f.x)?f.x:220+u*300,y:Number.isFinite(f==null?void 0:f.y)?f.y:180},data:{label:h.id,stepId:h.id,stepType:h.type||h.originalType||Kut,targetRole:h.targetRole||h.target_role||"",parameters:rft(h.parameters)}}}),c=new Map(l.map(h=>[h.data.stepId,h])),d=[];return o.forEach((h,u)=>{var g;const f=c.get(h.id);if(h.next&&f&&c.has(h.next)){const p=c.get(h.next);d.push(hM(f.id,p.id))}else if(!h.next&&(!h.branches||Object.keys(h.branches).length===0)&&f&&u{if(typeof m=="string"&&f&&c.has(m)){const b=c.get(m);d.push(hM(f.id,b.id,p))}})}),{roles:s,nodes:l,edges:d}}function P6(n,e,t,i){const s=new Map;return i.forEach(o=>{const r=s.get(o.source)||[];r.push(o),s.set(o.source,r)}),{name:n.name.trim()||"draft",description:n.description.trim(),configuration:{closedWorldMode:n.closedWorldMode},roles:e.filter(o=>o.id.trim()).map(o=>({id:o.id.trim(),name:o.name.trim()||o.id.trim(),systemPrompt:o.systemPrompt||"",provider:o.provider.trim()||null,model:o.model.trim()||null,connectors:Cl(o.connectorsText)})),steps:t.map(o=>{var c;const r=s.get(o.id)||[],a=r.find(d=>{var h;return((h=d.data)==null?void 0:h.kind)==="next"}),l=r.filter(d=>{var h;return((h=d.data)==null?void 0:h.kind)==="branch"});return{id:o.data.stepId,type:o.data.stepType,originalType:o.data.stepType,targetRole:o.data.targetRole||null,usedRoleAlias:!1,parameters:aft(o.data.parameters),next:a&&((c=t.find(d=>d.id===a.target))==null?void 0:c.data.stepId)||null,branches:Object.fromEntries(l.map(d=>{var h,u;return[((h=d.data)==null?void 0:h.branchLabel)||"_default",((u=t.find(f=>f.id===d.target))==null?void 0:u.data.stepId)||null]}).filter(([,d])=>!!d)),children:[],importedFromChildren:!1,retry:null,onError:null,timeoutMs:null}})}}function wce(n,e){return{nodePositions:Object.fromEntries(e.map(t=>[t.data.stepId,{x:t.position.x,y:t.position.y}])),viewport:{x:0,y:0,zoom:1},mode:"manual",layoutVersion:2,groups:{},collapsed:[],entryWorkflow:n.name.trim()||"draft"}}function hM(n,e,t){const i=!!t,s=i?"#8B5CF6":"#2F6FEC";return{id:`edge_${n}_${e}_${t||"next"}`,source:n,target:e,type:"smoothstep",label:t,animated:!1,data:{kind:i?"branch":"next",branchLabel:t},style:{stroke:s,strokeWidth:2.5},markerEnd:{type:z1.ArrowClosed,width:11,height:11,color:s},zIndex:4,labelStyle:{fill:"#6B7280",fontSize:12}}}function eft(n,e){const t=new Set(e.filter(i=>{var s;return i.source===n&&((s=i.data)==null?void 0:s.kind)==="branch"}).map(i=>{var s;return(s=i.data)==null?void 0:s.branchLabel}));return t.has("true")?t.has("false")?"true":"false":"true"}function tft(n){const e=n.trim();if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch{return n}return e==="true"?!0:e==="false"?!1:e==="null"?null:n}function pQ(n){return n==null?"":typeof n=="string"?n:typeof n=="boolean"||typeof n=="number"?String(n):JSON.stringify(n,null,2)}function ift(n){var r,a,l,c,d,h;if(!n)return null;const e=new Map,t=new Set,i=[];let s=null;for(const u of n.frames||[]){const f=cft(u.payload),g=u.receivedAtUtc;if(!f)continue;const p=((r=f.custom)==null?void 0:r.name)||"",m=((a=f.custom)==null?void 0:a.payload)||null;if(p==="aevatar.step.request"){const b=(m==null?void 0:m.stepId)||((l=f.stepStarted)==null?void 0:l.stepName);if(!b)continue;const v=nR(e,b);v.status="active",v.stepType=(m==null?void 0:m.stepType)||v.stepType||"",v.targetRole=(m==null?void 0:m.targetRole)||v.targetRole||"",v.startedAt=g,s=b,i.push({tone:"started",title:`${b} started`,meta:[m==null?void 0:m.stepType,m==null?void 0:m.targetRole].filter(Boolean).join(" · "),previewText:fp(m==null?void 0:m.input),clipboardText:df(m==null?void 0:m.input),timestamp:g,stepId:b,interaction:null});continue}if(p==="aevatar.human_input.request"){const b=m==null?void 0:m.stepId,v=m==null?void 0:m.runId,w=yce(m==null?void 0:m.suspensionType);if(!b||!v||!w)continue;const C=nR(e,b);C.status="waiting",C.stepType=C.stepType||w,s=b;const S=dft(m==null?void 0:m.timeoutSeconds),L={kind:w,runId:v,stepId:b,prompt:String((m==null?void 0:m.prompt)||"").trim(),timeoutSeconds:S,variableName:String((m==null?void 0:m.variableName)||"").trim()};i.push({tone:"pending",title:w==="human_approval"?`${b} waiting for approval`:`${b} waiting for input`,meta:[w==="human_approval"?"human approval":"human input",L.variableName?`variable ${L.variableName}`:null,S?`timeout ${S}s`:null].filter(Boolean).join(" · "),previewText:fp(L.prompt),clipboardText:df(L.prompt),timestamp:g,stepId:b,interaction:L});continue}if(p==="aevatar.step.completed"){const b=(m==null?void 0:m.stepId)||((c=f.stepFinished)==null?void 0:c.stepName);if(!b)continue;const v=nR(e,b);v.status=(m==null?void 0:m.success)===!1?"failed":"completed",v.completedAt=g,v.success=(m==null?void 0:m.success)!==!1,v.error=(m==null?void 0:m.error)||"",v.nextStepId=(m==null?void 0:m.nextStepId)||"",v.branchKey=(m==null?void 0:m.branchKey)||"",m!=null&&m.nextStepId&&t.add(`${b}->${m.nextStepId}`),s=b,i.push({tone:(m==null?void 0:m.success)===!1?"failed":"completed",title:`${b} ${(m==null?void 0:m.success)===!1?"failed":"completed"}`,meta:[v.stepType,m!=null&&m.branchKey?`branch ${m.branchKey}`:null,m!=null&&m.nextStepId?`next ${m.nextStepId}`:null].filter(Boolean).join(" · "),previewText:fp((m==null?void 0:m.error)||(m==null?void 0:m.output)),clipboardText:df((m==null?void 0:m.error)||(m==null?void 0:m.output)),timestamp:g,stepId:b,interaction:null});continue}if(p==="studio.human.resume"){const b=m==null?void 0:m.stepId;if(!b)continue;const v=nR(e,b);v.status="active",s=b;const w=yce(m==null?void 0:m.suspensionType),C=(m==null?void 0:m.approved)!==!1;i.push({tone:"run",title:w==="human_approval"?`${b} ${C?"approved":"rejected"}`:`${b} input submitted`,meta:w==="human_approval"?`human approval · ${C?"approved":"rejected"}`:"human input submitted",previewText:fp(m==null?void 0:m.userInput),clipboardText:df(m==null?void 0:m.userInput),timestamp:g,stepId:b,interaction:null});continue}if(p==="studio.run.stop.requested"){i.push({tone:"pending",title:"Stop requested",meta:"",previewText:fp(m==null?void 0:m.reason),clipboardText:df(m==null?void 0:m.reason),timestamp:g,stepId:s,interaction:null});continue}if(p==="aevatar.run.stopped"){i.push({tone:"run",title:"Run stopped",meta:"",previewText:fp(m==null?void 0:m.reason),clipboardText:df(m==null?void 0:m.reason),timestamp:g,stepId:s,interaction:null});continue}if((d=f.runError)!=null&&d.message){i.push({tone:"failed",title:"Run failed",meta:f.runError.code||"",previewText:fp(f.runError.message),clipboardText:df(f.runError.message),timestamp:g,stepId:s,interaction:null});continue}if(f.runStopped){i.push({tone:"run",title:"Run stopped",meta:"",previewText:fp(f.runStopped.reason),clipboardText:df(f.runStopped.reason),timestamp:g,stepId:s,interaction:null});continue}if(f.runFinished){i.push({tone:"run",title:"Run finished",meta:"",previewText:"",clipboardText:"",timestamp:g,stepId:s,interaction:null});continue}p==="aevatar.run.context"&&i.push({tone:"run",title:"Run started",meta:(m==null?void 0:m.workflowName)||n.workflowName||"",previewText:"",clipboardText:"",timestamp:g,stepId:null,interaction:null})}let o=null;for(let u=i.length-1;u>=0;u-=1){const f=i[u].stepId;if(i[u].interaction&&f&&((h=e.get(f))==null?void 0:h.status)==="waiting"){o=u;break}}for(let u=i.length-1;u>=0&&o===null;u-=1)if(i[u].stepId){o=u;break}return{stepStates:e,traversedEdges:t,logs:i,latestStepId:s,defaultLogIndex:o}}function I0e(n,e){if(!n)return null;const t=Number.isInteger(e)?n.logs[e]:null;return(t==null?void 0:t.stepId)||n.latestStepId||null}function nft(n,e,t){const i=I0e(e,t);return n.map(s=>{const o=e==null?void 0:e.stepStates.get(s.data.stepId);return{...s,draggable:!1,selectable:!0,data:{...s.data,executionStatus:(o==null?void 0:o.status)||"idle",executionFocused:i===s.data.stepId}}})}function sft(n,e,t,i){const s=I0e(t,i),o=new Map(e.map(r=>[r.id,r.data.stepId]));return n.map(r=>{var u;const a=o.get(r.source),l=o.get(r.target),c=a&&l?t==null?void 0:t.traversedEdges.has(`${a}->${l}`):!1,d=s&&(a===s||l===s),h=d?"#2F6FEC":c?"#22C55E":((u=r.data)==null?void 0:u.kind)==="branch"?"#8B5CF6":"#94A3B8";return{...r,type:r.type||"smoothstep",animated:!!d,style:{stroke:h,strokeWidth:d?2.8:2.5},markerEnd:{type:z1.ArrowClosed,width:11,height:11,color:h},zIndex:4}})}function oft(n,e){var t;if(!((t=n==null?void 0:n.logs)!=null&&t.length)||!e)return null;for(let i=n.logs.length-1;i>=0;i-=1)if(n.logs[i].stepId===e)return i;return null}function iR(n){return typeof n=="string"?n.toLowerCase():Number(n)===2?"error":"warning"}function rft(n){return Object.fromEntries(Object.entries(n||{}).map(([e,t])=>[e,lft(t)]))}function aft(n){return Object.fromEntries(Object.entries(n||{}).filter(([e])=>e.trim()))}function lft(n){return n==null?n:structuredClone(n)}function Cce(n,e){const t=parseInt(String(n||"").trim(),10);return Number.isFinite(t)?t:e}function nR(n,e){return n.has(e)||n.set(e,{stepId:e,status:"idle",stepType:"",targetRole:"",startedAt:null,completedAt:null,success:null,error:"",nextStepId:"",branchKey:""}),n.get(e)}function cft(n){try{return JSON.parse(n)}catch{return null}}function df(n){const e=pQ(n).trim();return e||""}function fp(n){const e=df(n);return e.length>180?`${e.slice(0,177)}...`:e}function yce(n){const e=String(n||"").trim().toLowerCase();return e==="human_input"||e==="human_approval"?e:null}function dft(n){const e=Number(n);return Number.isFinite(e)&&e>0?e:null}function hft(n){return(n==null?void 0:n.mode)==="manual"&&(n==null?void 0:n.nodePositions)&&typeof n.nodePositions=="object"}function uft(n){var p;const e=new Set(n.map(m=>String((m==null?void 0:m.id)||"").trim()).filter(Boolean));if(e.size===0)return{};const t=new Map,i=new Map;for(const m of e)t.set(m,[]),i.set(m,0);n.forEach((m,b)=>{var L;const v=String((m==null?void 0:m.id)||"").trim();if(!v||!e.has(v))return;const w=[],C=String((m==null?void 0:m.next)||"").trim();if(C&&e.has(C))w.push(C);else if(!(m!=null&&m.next)&&(!(m!=null&&m.branches)||Object.keys(m.branches).length===0)&&bfft(x,I)).map(([,x])=>String(x||"").trim()).filter(x=>x&&e.has(x));for(const x of[...w,...S]){const I=t.get(v)||[];I.includes(x)||(I.push(x),t.set(v,I),i.set(x,(i.get(x)||0)+1))}});const s=new Map,o=new Map,r=new Set,a=new Set,l=String(((p=n[0])==null?void 0:p.id)||"").trim();l&&a.add(l);for(const m of n){const b=String((m==null?void 0:m.id)||"").trim();b&&(i.get(b)||0)===0&&a.add(b)}for(const m of n){const b=String((m==null?void 0:m.id)||"").trim();b&&a.add(b)}function c(m,b){if(r.has(m))return;r.add(m),o.set(m,b);const v=t.get(m)||[],w=[];for(const C of v)r.has(C)||(w.push(C),c(C,b+1));s.set(m,w)}for(const m of a)r.has(m)||c(m,0);const d=new Map;function h(m){const b=s.get(m)||[];if(b.length===0)return d.set(m,1),1;const v=b.reduce((C,S)=>C+h(S),0),w=Math.max(1,v);return d.set(m,w),w}for(const m of a)o.has(m)&&!d.has(m)&&h(m);const u={};let f=0;function g(m,b){const v=s.get(m)||[],w=d.get(m)||1,C=o.get(m)||0,S=b+(w-1)/2;u[m]={x:240+C*330,y:180+S*200};let L=b;for(const x of v){const I=d.get(x)||1;g(x,L),L+=I}}for(const m of a)!o.has(m)||u[m]||(g(m,f),f+=(d.get(m)||1)+.8);return u}function fft(n,e){const t=s=>{const o=String(s||"").trim().toLowerCase();return o==="true"?0:o==="false"?1:o==="_default"||o==="default"?2:3},i=t(n)-t(e);return i!==0?i:String(n||"").localeCompare(String(e||""))}const E0e={data:K2e,control:Z2e,ai:JC,composition:Bfe,integration:CR,human:kL,validation:ZI,custom:YI},gft={aevatarNode:Nft},pft=["studio","workflows","scripts","roles","connectors","settings"],mft=["studio","workflows","scripts","roles","connectors"],_ft=[{id:"blue",label:"Blue",description:"Cool and calm for daily editing.",swatches:["#2F6FEC","#7FA9FF","#EAF2FF"]},{id:"coral",label:"Coral",description:"The warmer look you had before.",swatches:["#F0483E","#FF8A6B","#FFF1EC"]},{id:"forest",label:"Forest",description:"A softer green studio palette.",swatches:["#2F8F6A","#6BBC94","#EAF7F0"]}],GL=typeof window>"u"?"http://127.0.0.1:5100":window.location.origin,N0e="aevatar.app.workspace-page",D0e="aevatar.app.previous-workspace-page";function bft(){return{hostMode:"embedded",scopeId:null,scopeResolved:!1,scopeSource:"",workflowStorageMode:"workspace",scriptStorageMode:"draft",scriptsEnabled:!1,scriptContract:{inputType:"",readModelFields:[]}}}function vft(n){var t,i,s;const e=n!=null&&n.scopeResolved&&(n!=null&&n.scopeId)?n.scopeId:null;return{hostMode:(n==null?void 0:n.mode)==="proxy"?"proxy":"embedded",scopeId:e,scopeResolved:!!e,scopeSource:(n==null?void 0:n.scopeSource)||"",workflowStorageMode:(n==null?void 0:n.workflowStorageMode)==="scope"?"scope":"workspace",scriptStorageMode:(n==null?void 0:n.scriptStorageMode)==="scope"?"scope":"draft",scriptsEnabled:!!((t=n==null?void 0:n.features)!=null&&t.scripts),scriptContract:{inputType:((i=n==null?void 0:n.scriptContract)==null?void 0:i.inputType)||"",readModelFields:Array.isArray((s=n==null?void 0:n.scriptContract)==null?void 0:s.readModelFields)?n.scriptContract.readModelFields:[]}}}function Sce(n){return!!((n==null?void 0:n.status)===401||n!=null&&n.loginUrl||typeof(n==null?void 0:n.message)=="string"&&n.message.includes("Sign-in may be required.")||typeof(n==null?void 0:n.rawBody)=="string"&&(n.rawBody.startsWith("e.length?`, +${n.length-e.length} more`:"";return`Loaded studio with defaults for ${e.join(", ")}${t}.`}function Cft(){if(typeof window>"u")return{isPopout:!1,executionId:null};const n=new URL(window.location.href),e=n.searchParams.get("executionId");return{isPopout:n.searchParams.get("executionLogs")==="popout",executionId:e&&e.trim()?e.trim():null}}function xce(n){const e=new URL(window.location.href);return e.searchParams.set("executionLogs","popout"),e.searchParams.set("executionId",n),e.toString()}function yft(n){return!!(n&&pft.includes(n))}function Sft(n){return!!(n&&mft.includes(n))}function xft(){if(typeof window>"u")return"studio";try{const n=window.localStorage.getItem(N0e);return yft(n)?n:"studio"}catch{return"studio"}}function Lft(){if(typeof window>"u")return"studio";try{const n=window.localStorage.getItem(D0e);return Sft(n)?n:"studio"}catch{return"studio"}}function T0e(n){const e=n.size??44;return y.jsxs("svg",{viewBox:"0 0 400 400",width:e,height:e,className:n.className,"aria-hidden":"true",shapeRendering:"crispEdges",children:[y.jsx("rect",{width:"400",height:"400",rx:"28",fill:"#18181B"}),y.jsx("rect",{x:"12",y:"20",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"102",y:"20",width:"44",height:"142",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"66",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"20",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"20",width:"44",height:"142",fill:"#FAFAFA"}),y.jsx("rect",{x:"330",y:"66",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"181",width:"170",height:"32",fill:"#FAFAFA"}),y.jsx("rect",{x:"230",y:"181",width:"170",height:"32",fill:"#FAFAFA"}),y.jsx("rect",{x:"180",y:"181",width:"40",height:"40",fill:"#FAFAFA"}),y.jsx("rect",{x:"12",y:"304",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"102",y:"242",width:"44",height:"109",fill:"#FAFAFA"}),y.jsx("rect",{x:"0",y:"274",width:"70",height:"30",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"304",width:"134",height:"46",fill:"#FAFAFA"}),y.jsx("rect",{x:"254",y:"242",width:"44",height:"109",fill:"#FAFAFA"}),y.jsx("rect",{x:"330",y:"274",width:"70",height:"30",fill:"#FAFAFA"})]})}function kft(n){const e=String((n==null?void 0:n.prompt)||"").trim();return{executionId:(n==null?void 0:n.executionId)||"",workflowName:(n==null?void 0:n.workflowName)||"",status:(n==null?void 0:n.status)||"running",promptPreview:e.length<=120?e:`${e.slice(0,117)}...`,startedAtUtc:(n==null?void 0:n.startedAtUtc)||new Date().toISOString(),completedAtUtc:(n==null?void 0:n.completedAtUtc)||null,actorId:(n==null?void 0:n.actorId)||null,error:(n==null?void 0:n.error)||null}}function Ift(){return{loading:!0,enabled:!0,authenticated:!1,providerDisplayName:"NyxID",loginUrl:"/auth/login",logoutUrl:"/auth/logout",name:"",email:"",picture:"",errorMessage:""}}function Eft(n){return{...n?{scope_id:n}:{},"workflow.authoring.enabled":"true","workflow.intent":"workflow_authoring"}}function Nft({data:n,selected:e}){const t=k0e(n.stepType),i=E0e[t.key]||YI,s=Ti(d=>d.transform[2]),o=s<.68,r=s<.42,a=n.executionStatus&&n.executionStatus!=="idle"?`node-status-${n.executionStatus}`:"",l=r?104:o?154:244,c=Dft(n.parameters);return y.jsxs("div",{className:["workflow-node",o?"compact":"",r?"micro":"",e?"selected":"",n.executionFocused?"execution-focus":"",a].join(" "),style:{width:l},children:[y.jsx(tS,{type:"target",position:Nt.Left,style:{background:t.color}}),r?y.jsxs("div",{className:"workflow-node-micro",children:[y.jsx("div",{className:"workflow-node-icon workflow-node-icon-micro",style:{background:`${t.color}18`},children:y.jsx(i,{size:14,color:t.color})}),y.jsx("div",{className:"workflow-node-micro-meta",children:y.jsx("div",{className:"workflow-node-title",children:n.stepId})}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`workflow-node-status-dot ${n.executionStatus}`}):null]}):o?y.jsxs("div",{className:"workflow-node-compact",children:[y.jsx("div",{className:"workflow-node-icon",style:{background:`${t.color}18`},children:y.jsx(i,{size:14,color:t.color})}),y.jsxs("div",{className:"workflow-node-compact-meta",children:[y.jsx("div",{className:"workflow-node-title",children:n.stepId}),y.jsx("div",{className:"workflow-node-subtitle",children:n.targetRole||n.stepType})]}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`workflow-node-status-dot ${n.executionStatus}`}):null]}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-gray-100",children:[y.jsx("div",{className:"workflow-node-icon",style:{background:`${t.color}18`},children:y.jsx(i,{size:15,color:t.color})}),y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:n.stepId}),y.jsx("div",{className:"text-[11px] text-gray-400 leading-tight",children:n.stepType})]}),n.executionStatus&&n.executionStatus!=="idle"?y.jsx("span",{className:`node-run-pill ${n.executionStatus}`,children:n.executionStatus}):null]}),y.jsxs("div",{className:"px-3 py-2 text-[11px] text-gray-500 space-y-1",children:[n.targetRole?y.jsxs("div",{children:[y.jsx("span",{className:"text-gray-400",children:"role:"})," ",n.targetRole]}):null,y.jsx("div",{className:"truncate",children:c})]})]}),y.jsx(tS,{type:"source",position:Nt.Right,style:{background:t.color}})]})}function Dft(n){const e=Object.entries(n||{}).find(([,o])=>o!==""&&o!==null&&o!==void 0);if(!e)return"No parameters";const[t,i]=e,s=pQ(i);return`${t}: ${s.length>44?`${s.slice(0,41)}...`:s}`}function Lce(n){return String(n||"").trim().toLowerCase()}function yb(n){return n?new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(n)):"-"}function Tft(n,e){if(!n)return"";const t=new Date(n).getTime(),i=e?new Date(e).getTime():Date.now();if(!Number.isFinite(t)||!Number.isFinite(i)||i<=t)return"";const s=i-t;if(s<1e3)return`${Math.round(s)}ms`;const o=s/1e3;if(o<60)return`${o<10?o.toFixed(1):Math.round(o)}s`;const r=Math.floor(o/60),a=Math.round(o%60);if(r<60)return`${r}m ${a}s`;const l=Math.floor(r/60),c=r%60;return`${l}h ${c}m`}function R0e(n){const e=[`[${yb(n.timestamp)}] ${n.title}`];return n.meta&&e.push(n.meta),n.clipboardText&&e.push(n.clipboardText),e.join(` +`)}function Rft(n){var e;return(e=n==null?void 0:n.logs)!=null&&e.length?n.logs.map(t=>R0e(t)).join(` --- -`):""}function Pft(){return{runtimeBaseUrl:GL,appearanceTheme:"blue",colorMode:"light",secretsFilePath:"",defaultProviderName:"",providerTypes:[],providers:[]}}function Oft(n,e,t){const i=e.find(s=>s.id===n)||e[0]||{id:n,displayName:n,category:"configured",description:"",defaultEndpoint:"",defaultModel:""};return{key:`provider_${crypto.randomUUID()}`,providerName:Bft(i.id,t),providerType:i.id,displayName:i.displayName,category:i.category,description:i.description,endpoint:i.defaultEndpoint,model:i.defaultModel,apiKey:"",apiKeyConfigured:!1}}function Fft(n,e){const t=e.find(i=>i.id===(n==null?void 0:n.providerType))||null;return{key:`provider_${crypto.randomUUID()}`,providerName:(n==null?void 0:n.providerName)||"",providerType:(n==null?void 0:n.providerType)||(t==null?void 0:t.id)||"openai",displayName:(n==null?void 0:n.displayName)||(t==null?void 0:t.displayName)||(n==null?void 0:n.providerType)||"Provider",category:(n==null?void 0:n.category)||(t==null?void 0:t.category)||"configured",description:(n==null?void 0:n.description)||(t==null?void 0:t.description)||"",endpoint:(n==null?void 0:n.endpoint)||(t==null?void 0:t.defaultEndpoint)||"",model:(n==null?void 0:n.model)||(t==null?void 0:t.defaultModel)||"",apiKey:(n==null?void 0:n.apiKey)||"",apiKeyConfigured:!!(n!=null&&n.apiKeyConfigured)}}function Bft(n,e){const t=(n||"provider").replace(/[^a-z0-9]+/gi,"-").toLowerCase(),i=new Set(e.map(r=>r.providerName.trim().toLowerCase()));let s=1,o=`${t}-main`;for(;i.has(o);)s+=1,o=`${t}-${s}`;return o}function Nce(n,e="role"){const t=(e||"role").replace(/[^a-z0-9_]+/gi,"_").toLowerCase()||"role",i=new Set(n.map(r=>r.id.trim().toLowerCase()).filter(Boolean));let s=1,o=t;for(;i.has(o);)s+=1,o=`${t}_${s}`;return o}function F6(n,e){const t=e.trim().toLowerCase();return t?[n.id,n.name,n.systemPrompt,n.provider,n.model,n.connectorsText].join(" ").toLowerCase().includes(t):!0}function Wft(){return Dm(1,{id:"",name:"",systemPrompt:"",provider:"",model:"",connectorsText:""})}function Dce(n){if(!n)return!1;const e=Object.entries(n.http.defaultHeaders||{}).some(([s,o])=>s.trim()||String(o||"").trim()),t=Object.entries(n.cli.environment||{}).some(([s,o])=>s.trim()||String(o||"").trim()),i=Object.entries(n.mcp.environment||{}).some(([s,o])=>s.trim()||String(o||"").trim());return!!(n.name.trim()||n.http.baseUrl.trim()||n.http.allowedMethods.some(s=>s.trim()&&s.trim().toUpperCase()!=="POST")||n.http.allowedPaths.some(s=>s.trim()&&s.trim()!=="/")||n.http.allowedInputKeys.some(s=>s.trim())||e||n.cli.command.trim()||n.cli.fixedArguments.some(s=>s.trim())||n.cli.allowedOperations.some(s=>s.trim())||n.cli.allowedInputKeys.some(s=>s.trim())||n.cli.workingDirectory.trim()||t||n.mcp.serverName.trim()||n.mcp.command.trim()||n.mcp.arguments.some(s=>s.trim())||n.mcp.defaultTool.trim()||n.mcp.allowedTools.some(s=>s.trim())||n.mcp.allowedInputKeys.some(s=>s.trim())||i)}function Hft(n){var i,s,o;const e=n.defaultProviderName||((i=n.providers[0])==null?void 0:i.providerName)||"",t=((s=n.providers.find(r=>r.providerName===e))==null?void 0:s.model)||((o=n.providers[0])==null?void 0:o.model)||"";return Dm(1,{id:"",name:"",systemPrompt:"",provider:e,model:t,connectorsText:""})}function Tce(n){return n?!!(n.id.trim()||n.name.trim()||n.systemPrompt.trim()||n.provider.trim()||n.model.trim()||n.connectorsText.trim()):!1}function Vft(){var nJ;const n=$.useMemo(()=>Sft(),[]),e=n.isPopout,t=n.executionId,[i,s]=$.useState(wft()),[o,r]=$.useState(Nft()),[a,l]=$.useState(()=>kft()),[c,d]=$.useState(()=>Eft()),[h,u]=$.useState("editor"),[f,g]=$.useState("runtime"),[p,m]=$.useState("node"),[b,v]=$.useState(!1),[w,C]=$.useState(!1),[S,L]=$.useState(!1),[x,E]=$.useState({runtimeBaseUrl:GL,directories:[]}),[I,R]=$.useState([]),[M,A]=$.useState(""),[W,P]=$.useState("grid"),[B,V]=$.useState(""),[K,z]=$.useState(""),[j,Q]=$.useState(!1),[Y,te]=$.useState(Pft()),[ce,Ce]=$.useState(""),[xe,je]=$.useState(null),[ke,Le]=$.useState(P6()),[Ve,ct]=$.useState(yb()),[dt,Be]=$.useState([]),[tt,Tt]=$.useState([]),[Si,Vt]=$.useState(null),[In,Nn]=$.useState(!1),[Os,Da]=$.useState(""),[Mo,_l]=$.useState("AI"),[Ta,xr]=$.useState({x:420,y:220}),[go,ei]=$.useState({open:!1,x:0,y:0}),[gn,bl]=$.useState([]),[Lr,td]=$.useState({homeDirectory:"",filePath:"",fileExists:!1}),[vl,ch]=$.useState({filePath:"",fileExists:!1,updatedAtUtc:""}),[Ks,hs]=$.useState(""),[qn,kr]=$.useState(null),[tn,us]=$.useState(null),[Xr,Dn]=$.useState(!1),[Yg,_c]=$.useState(!1),[X,wl]=$.useState([]),[Cn,Ii]=$.useState({homeDirectory:"",filePath:"",fileExists:!1}),[Qr,Qe]=$.useState({filePath:"",fileExists:!1,updatedAtUtc:""}),[dh,fi]=$.useState(""),[gi,Ra]=$.useState(""),[Jo,po]=$.useState(null),[er,id]=$.useState(null),[Tn,Er]=$.useState(null),[mo,Wu]=$.useState("catalog"),[Hn,nd]=$.useState(!1),[hh,Zg]=$.useState(!1),[Ct,ae]=$.useState([]),[Ee,rt]=$.useState(null),[Et,Rn]=$.useState(null),[li,Ls]=$.useState(null),[ks,Ir]=$.useState(null),[Hu,Qn]=$.useState(null),[Vu,uh]=$.useState(!1),[I_,vx]=$.useState(""),[wx,Cl]=$.useState(!1),[Qw,Xg]=$.useState(""),[fh,N_]=$.useState(""),[Qg,zu]=$.useState(!1),[Jw,eC]=$.useState(!1),[D_,T_]=$.useState(""),[tC,gh]=$.useState(""),[sd,iC]=$.useState(""),[yl,ju]=$.useState(""),[nC,UD]=$.useState(!1),[ph,R_]=$.useState({status:"idle",message:""}),[sC,Cx]=$.useState(null),M_=$.useRef(null),mh=$.useRef(!0),A_=$.useRef(0),Jg=$.useRef(null),ep=$.useRef(0),yx=$.useRef(0),$u=$.useRef(null),Uu=$.useRef(null),he=$.useRef(null),ge=$.useRef(null),Pe=$.useRef(null),We=$.useRef(null),Mt=$.useRef(null),at=$.useRef(()=>{}),zt=dt.find(k=>k.id===Si)||null,yt=$.useMemo(()=>Dft(i.scopeId),[i.scopeId]),Lt=gn.find(k=>k.key===qn)||null,Mn=X.find(k=>k.key===Jo)||null,P_=Lr.filePath.startsWith("chrono-storage://"),O_=Cn.filePath.startsWith("chrono-storage://"),Jn=Y.providers.find(k=>k.key===xe)||null,tp=$.useMemo(()=>new Map(Y.providerTypes.map(k=>[k.id,k])),[Y.providerTypes]),od=Ct.filter(k=>{const T=Ice(ke.name);return!T||Ice(k.workflowName)===T}),F_=h==="execution"?oft(dt,li,ks):dt,B_=h==="execution"?rft(tt,dt,li,ks):tt,bc=li&&Number.isInteger(ks)&&li.logs[ks]||null,_i=bc!=null&&bc.interaction&&(Et==null?void 0:Et.status)==="waiting"&&bc.stepId&&((nJ=li==null?void 0:li.stepStates.get(bc.stepId))==null?void 0:nJ.status)==="waiting"?bc.interaction:null,ip=Ee&&_i?`${Ee}:${_i.stepId}`:"",DQ=!!Ee&&((Et==null?void 0:Et.status)==="running"||(Et==null?void 0:Et.status)==="waiting");$.useEffect(()=>{F0e()},[]),$.useEffect(()=>dRe(k=>{Cl(!1),r(T=>({...T,loading:!1,enabled:!0,authenticated:!1,loginUrl:(k==null?void 0:k.loginUrl)||T.loginUrl||"/auth/login",errorMessage:(k==null?void 0:k.message)||"Sign in to continue."}))}),[]),$.useEffect(()=>()=>{Uu.current&&window.clearTimeout(Uu.current)},[]),$.useEffect(()=>()=>{ge.current&&window.clearInterval(ge.current)},[]),$.useEffect(()=>{at.current=()=>{FQ()}}),$.useEffect(()=>{if(Xg(""),!_i)return;const k=window.requestAnimationFrame(()=>{var T,Z;(T=he.current)==null||T.focus(),(Z=he.current)==null||Z.select()});return()=>window.cancelAnimationFrame(k)},[_i==null?void 0:_i.kind,_i==null?void 0:_i.runId,_i==null?void 0:_i.stepId]),$.useEffect(()=>{if(a!=="studio")return;const k=T=>{T.altKey||T.shiftKey||!(T.metaKey||T.ctrlKey)||T.key.toLowerCase()!=="s"||(T.preventDefault(),at.current())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[a]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(M0e,a)}catch{}},[a]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(A0e,c)}catch{}},[c]),$.useEffect(()=>{!o.loading&&(!o.enabled||o.authenticated)&&a==="scripts"&&!i.scriptsEnabled&&l("studio")},[o.authenticated,o.enabled,o.loading,i.scriptsEnabled,a]),$.useEffect(()=>{const k=(ee,be=!1)=>{const Ke=ee.replace(/\s+/g," ").replace(/[.!?]+$/g,"").trim();if(!Ke)return"";if(be)return Ke;const it=Ke.toLowerCase();if(it.startsWith("sign out"))return"Sign out";if(it.startsWith("sign in"))return"Sign in";if(it.startsWith("zoom in"))return"Zoom in";if(it.startsWith("zoom out"))return"Zoom out";if(it.startsWith("fit view"))return"Fit view";const Gt=Ke.split(" ").filter(Boolean);return Gt.length<=2?Gt.join(" "):["close","save","run","export","import","copy","validate","open","edit"].includes(Gt[0].toLowerCase())?Gt[0]:Gt.slice(0,2).join(" ")},T=()=>{document.querySelectorAll("button, a.ghost-action, a.solid-action, a.panel-icon-button").forEach(ee=>{var Gs,rd,rC,H_;const be=((Gs=ee.textContent)==null?void 0:Gs.replace(/\s+/g," ").trim())||"",Ke=((rd=ee.getAttribute("aria-label"))==null?void 0:rd.trim())||"",it=((rC=ee.getAttribute("title"))==null?void 0:rC.trim())||"",Gt=((H_=ee.getAttribute("data-tooltip"))==null?void 0:H_.trim())||"",nn=k(Gt||Ke||it||be,!!(Gt||Ke||it));!nn||ee.getAttribute("title")===nn||ee.setAttribute("title",nn)})};T();const Z=new MutationObserver(()=>{window.requestAnimationFrame(T)});return Z.observe(document.body,{subtree:!0,childList:!0,characterData:!0}),()=>Z.disconnect()},[]),$.useEffect(()=>()=>{$u.current&&window.clearTimeout($u.current),Jg.current&&window.clearTimeout(Jg.current)},[]),$.useEffect(()=>{if(!(ke.name||dt.length>0||Ve.length>0))return;if(mh.current){mh.current=!1;return}const T=window.setTimeout(()=>{X0e()},280);return()=>{window.clearTimeout(T)}},[ke.name,ke.description,Ve,dt,tt,I]),$.useEffect(()=>{er&&!Ve.some(k=>k.key===er)&&id(null)},[Ve,er]),$.useEffect(()=>{Xg(""),N_("")},[Ee,ks]),$.useEffect(()=>{if(e){document.title=Ee?`Execution Logs · ${(Et==null?void 0:Et.workflowName)||"Aevatar App"}`:"Execution Logs · Aevatar App";return}document.title="Aevatar App"},[Et==null?void 0:Et.workflowName,e,Ee]),$.useEffect(()=>{!e||o.loading||o.enabled&&!o.authenticated||!t||Ee===t||KD(t)},[o.authenticated,o.enabled,o.loading,t,e,Ee]),$.useEffect(()=>{if(!(e||!S))return ge.current=window.setInterval(()=>{const k=Pe.current;k&&!k.closed||(Pe.current=null,L(!1),C(!1),ge.current&&(window.clearInterval(ge.current),ge.current=null))},500),()=>{ge.current&&(window.clearInterval(ge.current),ge.current=null)}},[e,S]),$.useEffect(()=>{if(e||!Ee)return;const k=Pe.current;if(!(!k||k.closed))try{k.location.replace(Ece(Ee))}catch{}},[e,Ee]),$.useEffect(()=>{const k=(Et==null?void 0:Et.status)==="running"||(Et==null?void 0:Et.status)==="waiting";if(!Ee||!k)return;let T=!1,Z=0;const ee=async()=>{try{const be=await z_.get(Ee);if(T)return;Lx(be),((be==null?void 0:be.status)==="running"||(be==null?void 0:be.status)==="waiting")&&(Z=window.setTimeout(()=>{ee()},700))}catch{if(T)return;Z=window.setTimeout(()=>{ee()},1200)}};return Z=window.setTimeout(()=>{ee()},350),()=>{T=!0,window.clearTimeout(Z)}},[Et==null?void 0:Et.status,Ee]);async function F0e(){var k;try{const T=await hRe.getSession(),Z={loading:!1,enabled:(T==null?void 0:T.enabled)!==!1,authenticated:!!(T!=null&&T.authenticated),providerDisplayName:(T==null?void 0:T.providerDisplayName)||"NyxID",loginUrl:(T==null?void 0:T.loginUrl)||"/auth/login",logoutUrl:(T==null?void 0:T.logoutUrl)||"/auth/logout",name:(T==null?void 0:T.name)||"",email:(T==null?void 0:T.email)||"",picture:(T==null?void 0:T.picture)||"",errorMessage:(T==null?void 0:T.errorMessage)||""};if(r(Z),Z.enabled&&!Z.authenticated)return;const[ee,be,Ke,it,Gt,nn,Gs,rd,rC]=await Promise.allSettled([xl.getContext(),lp.getSettings(),lp.listWorkflows(),cC.getCatalog(),cC.getDraft(),dC.getCatalog(),dC.getDraft(),z_.list(),ET.get()]),H_=[{label:"app context",result:ee},{label:"workspace settings",result:be},{label:"workflow list",result:Ke},{label:"connectors catalog",result:it},{label:"connector draft",result:Gt},{label:"roles catalog",result:nn},{label:"role draft",result:Gs},{label:"execution list",result:rd},{label:"studio settings",result:rC}].flatMap(ea=>ea.result.status==="rejected"?[{label:ea.label,error:ea.result.reason}]:[]),y8=H_.find(ea=>kce(ea.error));if(y8){r(ea=>{var aJ,lJ;return{...ea,loading:!1,enabled:!0,authenticated:!1,loginUrl:((aJ=y8.error)==null?void 0:aJ.loginUrl)||ea.loginUrl||"/auth/login",errorMessage:((lJ=y8.error)==null?void 0:lJ.message)||"Sign in to continue."}});return}H_.forEach(ea=>{console.warn(`[Aevatar App] Failed to load bootstrap resource: ${ea.label}`,ea.error)});const ad=ee.status==="fulfilled"?ee.value:null,V_=be.status==="fulfilled"?be.value:null,sJ=Ke.status==="fulfilled"?Ke.value:[],qye=it.status==="fulfilled"?it.value:null,Kye=Gt.status==="fulfilled"?Gt.value:null,Gye=nn.status==="fulfilled"?nn.value:null,Yye=Gs.status==="fulfilled"?Gs.value:null,oJ=rd.status==="fulfilled"?rd.value:[],QD=rC.status==="fulfilled"?rC.value:null,Zye=(ad==null?void 0:ad.workflowStorageMode)==="scope"?"scope":"workspace",JD=ad!=null&&ad.scopeResolved&&(ad!=null&&ad.scopeId)?ad.scopeId:null,rJ=Zye==="scope"&&JD?[{directoryId:`scope:${JD}`,label:JD,path:`scope://${JD}`,isBuiltIn:!0}]:Array.isArray(V_==null?void 0:V_.directories)?V_.directories:[],Xye=(QD==null?void 0:QD.runtimeBaseUrl)||(V_==null?void 0:V_.runtimeBaseUrl)||GL;s(Cft(ad)),E({runtimeBaseUrl:Xye,directories:rJ}),R(Array.isArray(sJ)?sJ:[]),TQ(QD),u8(qye),g8(Kye),f8(Gye),p8(Yye),ae(Array.isArray(oJ)?oJ:[]);const Qye=((k=rJ[0])==null?void 0:k.directoryId)||null;Le(ea=>({...ea,directoryId:Qye})),H_.length>0&>(yft(H_.map(ea=>ea.label)),"info")}catch(T){if(kce(T)){r(Z=>({...Z,loading:!1,enabled:!0,authenticated:!1,loginUrl:(T==null?void 0:T.loginUrl)||Z.loginUrl||"/auth/login",errorMessage:(T==null?void 0:T.message)||"Sign in to continue."}));return}r(Z=>({...Z,loading:!1,errorMessage:Z.errorMessage||(T==null?void 0:T.message)||"Failed to load app session."})),gt((T==null?void 0:T.message)||"Failed to load studio","error")}}function TQ(k){var ee;const T=Array.isArray(k==null?void 0:k.providerTypes)?k.providerTypes.map(be=>({id:be.id,displayName:be.displayName,category:be.category,description:be.description,recommended:!!be.recommended,defaultEndpoint:be.defaultEndpoint||"",defaultModel:be.defaultModel||""})):[],Z=Array.isArray(k==null?void 0:k.providers)?k.providers.map(be=>Fft(be,T)):[];te({runtimeBaseUrl:(k==null?void 0:k.runtimeBaseUrl)||GL,appearanceTheme:(k==null?void 0:k.appearanceTheme)||"blue",colorMode:(k==null?void 0:k.colorMode)==="dark"?"dark":"light",secretsFilePath:(k==null?void 0:k.secretsFilePath)||"",defaultProviderName:(k==null?void 0:k.defaultProviderName)||"",providerTypes:T,providers:Z}),je(((ee=Z[0])==null?void 0:ee.key)||null),R_({status:"idle",message:""})}function u8(k){var Z;const T=Array.isArray(k==null?void 0:k.connectors)?k.connectors.map(ee=>wce(ee)):[];td({homeDirectory:(k==null?void 0:k.homeDirectory)||"",filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists)}),bl(T),kr(((Z=T[0])==null?void 0:Z.key)||null)}function f8(k){var Z;const T=Array.isArray(k==null?void 0:k.roles)?k.roles.map((ee,be)=>bce(ee,be+1)):[];Ii({homeDirectory:(k==null?void 0:k.homeDirectory)||"",filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists)}),wl(T),po(((Z=T[0])==null?void 0:Z.key)||null)}function g8(k){ch({filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists),updatedAtUtc:(k==null?void 0:k.updatedAtUtc)||""}),us(k!=null&&k.draft?wce(k.draft):null)}function p8(k){Qe({filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists),updatedAtUtc:(k==null?void 0:k.updatedAtUtc)||""}),Er(k!=null&&k.draft?bce(k.draft,1):null)}function gt(k,T){Cx({text:k,type:T}),$u.current&&window.clearTimeout($u.current),$u.current=window.setTimeout(()=>{Cx(null),$u.current=null},2600)}function RQ(k,T){Uu.current&&window.clearTimeout(Uu.current),Qn(k==="single"?T??null:null),uh(k==="all"),Uu.current=window.setTimeout(()=>{Qn(null),uh(!1),Uu.current=null},1600)}async function m8(k){var T;if(!k.trim())return gt("Nothing to copy","info"),!1;if(!((T=navigator.clipboard)!=null&&T.writeText))return gt("Clipboard is unavailable in this browser context","error"),!1;try{return await navigator.clipboard.writeText(k),!0}catch(Z){return gt((Z==null?void 0:Z.message)||"Failed to copy to clipboard","error"),!1}}async function B0e(k,T){Ir(T),await m8(O0e(k))&&RQ("single",T)}async function W0e(){await m8(Aft(li))&&(RQ("all"),gt("Execution logs copied","success"))}function H0e(){const k=Pe.current;return!k||k.closed?(Pe.current=null,L(!1),C(!1),!1):(k.focus(),!0)}function V0e(){var it,Gt;if(!Ee){gt("Pick a run first","info");return}const k=Ece(Ee),T=Pe.current;if(T&&!T.closed){T.location.replace(k),T.focus(),L(!0),C(!0);return}const Z=Math.max(((it=window.screen)==null?void 0:it.availWidth)||window.innerWidth||1440,1280),ee=Math.max(((Gt=window.screen)==null?void 0:Gt.availHeight)||window.innerHeight||960,720),be=["popup=yes",`width=${Z}`,`height=${ee}`,"left=0","top=0","resizable=yes","scrollbars=yes"].join(","),Ke=window.open(k,"aevatar-execution-logs",be);if(!Ke){gt("Allow pop-ups to open execution logs in a new window","error");return}Pe.current=Ke;try{Ke.moveTo(0,0),Ke.resizeTo(Z,ee)}catch{}Ke.focus(),L(!0),C(!0)}function z0e(){if(S){H0e();return}C(k=>!k)}function j0e(k){if(!(k!=null&&k.executionId))return;const T=Ift(k);ae(Z=>{const ee=Z.findIndex(be=>be.executionId===T.executionId);return ee<0?[T,...Z]:Z.map((be,Ke)=>Ke===ee?{...be,...T}:be)})}function Sx(){A_.current+=1}function $0e(k,T){var Z;if(T){const ee=k.find(be=>be.data.stepId===T);if(ee)return ee.id}return((Z=k[0])==null?void 0:Z.id)||null}function Jr(){Le(k=>k.dirty?k:{...k,dirty:!0})}function MQ(){l("workflows"),v(!1),Nn(!1),ei({open:!1,x:0,y:0})}function U0e(){l("studio"),Nn(!1),ei({open:!1,x:0,y:0})}function q0e(){l("scripts"),v(!1),Nn(!1),ei({open:!1,x:0,y:0})}function W_(k){l(k),v(!1),Nn(!1),ei({open:!1,x:0,y:0})}function AQ(k="runtime"){a!=="settings"&&d(a),l("settings"),g(k),v(!1),Nn(!1),ei({open:!1,x:0,y:0})}function K0e(){l(c)}function xx(k){if(b&&p===k){v(!1);return}m(k),v(!0)}function G0e(k){var T;mh.current=!0,Sx(),ct(yb()),Be([]),Tt([]),Vt(null),rt(null),Rn(null),Ls(null),Ir(null),Le({...P6(),directoryId:k??((T=x.directories[0])==null?void 0:T.directoryId)??null,dirty:!0}),l("studio"),u("editor"),m("node"),v(!1),qD()}function qD(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{var k;(k=M_.current)==null||k.fitView({padding:.22,minZoom:.14,maxZoom:.92,duration:220})})})}async function _8(){const k=await lp.listWorkflows();R(Array.isArray(k)?k:[])}async function Y0e(k){const T=await z_.list(),Z=Array.isArray(T)?T:[];ae(Z);const ee=k?Z.find(be=>be.executionId===k):null;ee!=null&&ee.executionId&&await KD(ee.executionId)}async function PQ(){var ee,be,Ke;const[k,T]=await Promise.all([xl.getContext(),lp.getSettings()]);s({hostMode:(k==null?void 0:k.mode)==="proxy"?"proxy":"embedded",scopeId:k!=null&&k.scopeResolved&&(k!=null&&k.scopeId)?k.scopeId:null,scopeResolved:!!(k!=null&&k.scopeResolved&&(k!=null&&k.scopeId)),scopeSource:(k==null?void 0:k.scopeSource)||"",workflowStorageMode:(k==null?void 0:k.workflowStorageMode)==="scope"?"scope":"workspace",scriptStorageMode:(k==null?void 0:k.scriptStorageMode)==="scope"?"scope":"draft",scriptsEnabled:!!((ee=k==null?void 0:k.features)!=null&&ee.scripts),scriptContract:{inputType:((be=k==null?void 0:k.scriptContract)==null?void 0:be.inputType)||"",readModelFields:Array.isArray((Ke=k==null?void 0:k.scriptContract)==null?void 0:Ke.readModelFields)?k.scriptContract.readModelFields:[]}});const Z={runtimeBaseUrl:x.runtimeBaseUrl,directories:Array.isArray(T==null?void 0:T.directories)?T.directories:[]};E(Z),Le(it=>{var Gt;return{...it,directoryId:it.directoryId||((Gt=Z.directories[0])==null?void 0:Gt.directoryId)||null}})}function OQ(k){var Z,ee,be,Ke,it,Gt,nn,Gs;const T=eR((k==null?void 0:k.document)||k,k==null?void 0:k.layout,yb());mh.current=!0,Sx(),ct(T.roles),Be(T.nodes),Tt(T.edges),Vt(((Z=T.nodes[0])==null?void 0:Z.id)||null),rt(null),Cl(!1),Le({workflowId:(k==null?void 0:k.workflowId)||null,directoryId:(k==null?void 0:k.directoryId)||((ee=x.directories[0])==null?void 0:ee.directoryId)||null,fileName:(k==null?void 0:k.fileName)||"",filePath:(k==null?void 0:k.filePath)||"",name:(k==null?void 0:k.name)||((be=k==null?void 0:k.document)==null?void 0:be.name)||((Ke=k==null?void 0:k.rootWorkflow)==null?void 0:Ke.name)||"draft",description:((it=k==null?void 0:k.document)==null?void 0:it.description)||((Gt=k==null?void 0:k.rootWorkflow)==null?void 0:Gt.description)||"",closedWorldMode:!!((Gs=(nn=k==null?void 0:k.document)==null?void 0:nn.configuration)!=null&&Gs.closedWorldMode),yaml:(k==null?void 0:k.yaml)||"",findings:Array.isArray(k==null?void 0:k.findings)?k.findings:[],dirty:!1,lastSavedAt:(k==null?void 0:k.updatedAtUtc)||null}),u("editor"),qD()}async function Z0e(k){try{const T=await lp.getWorkflow(k);OQ(T),l("studio"),v(!1)}catch(T){gt((T==null?void 0:T.message)||"Failed to open workflow","error")}}async function X0e(){const k=++A_.current;try{const T=O6(ke,Ve,dt,tt),Z=await ap.serializeYaml(T,I.map(ee=>ee.name));if(k!==A_.current)return;Le(ee=>({...ee,yaml:(Z==null?void 0:Z.yaml)||"",findings:Array.isArray(Z==null?void 0:Z.findings)?Z.findings:[]}))}catch(T){if(k!==A_.current)return;Le(Z=>({...Z,findings:[{level:2,message:(T==null?void 0:T.message)||"Failed to sync YAML.",path:"/"}]}))}}async function Q0e(k,T){try{const Z=await ap.parseYaml(k,I.map(be=>be.name)),ee=Array.isArray(Z==null?void 0:Z.findings)?Z.findings:[];if(!(Z!=null&&Z.document)){T===ep.current&&Le(be=>({...be,findings:ee.length>0?ee:[{level:2,message:"YAML parse returned an empty document.",path:"/"}]}));return}if(T>yx.current){const be=(zt==null?void 0:zt.data.stepId)||null,Ke=eR(Z.document,Sce(ke,dt),yb());yx.current=T,mh.current=!0,Sx(),ct(Ke.roles),Be(Ke.nodes),Tt(Ke.edges),Vt($0e(Ke.nodes,be)),Le(it=>{var Gt,nn,Gs,rd;return{...it,name:((Gt=Z.document)==null?void 0:Gt.name)||it.name||"draft",description:((nn=Z.document)==null?void 0:nn.description)||"",closedWorldMode:!!((rd=(Gs=Z.document)==null?void 0:Gs.configuration)!=null&&rd.closedWorldMode),findings:T===ep.current?ee:it.findings,dirty:!0,lastSavedAt:null}});return}T===ep.current&&Le(be=>({...be,findings:ee}))}catch(Z){if(T!==ep.current)return;Le(ee=>({...ee,findings:Array.isArray(Z==null?void 0:Z.findings)&&Z.findings.length>0?Z.findings:[{level:2,message:(Z==null?void 0:Z.message)||"Failed to parse YAML.",path:"/"}]}))}}function J0e(k){const T=++ep.current;Jg.current&&window.clearTimeout(Jg.current),Le(Z=>({...Z,yaml:k,dirty:!0,lastSavedAt:null})),Jg.current=window.setTimeout(()=>{Q0e(k,T)},180)}async function b8(){const k=O6(ke,Ve,dt,tt),T=await ap.serializeYaml(k,I.map(Z=>Z.name));return Le(Z=>({...Z,yaml:(T==null?void 0:T.yaml)||"",findings:Array.isArray(T==null?void 0:T.findings)?T.findings:[]})),T}async function FQ(){var T;const k=ke.directoryId||((T=x.directories[0])==null?void 0:T.directoryId);if(!k){gt("Add a workflow directory first","error"),MQ();return}try{const Z=await b8(),ee=await lp.saveWorkflow({workflowId:ke.workflowId,directoryId:k,workflowName:ke.name.trim()||"draft",fileName:ke.fileName||null,yaml:(Z==null?void 0:Z.yaml)||ke.yaml,layout:Sce(ke,dt)});OQ(ee),await _8(),gt("Workflow saved","success")}catch(Z){gt((Z==null?void 0:Z.message)||"Save failed","error")}}async function eye(){try{const k=await ap.parseYaml(ke.yaml||"",I.map(be=>be.name)),T=Array.isArray(k==null?void 0:k.findings)?k.findings:[];if(!(k!=null&&k.document)){Le(be=>({...be,findings:T.length>0?T:[{level:2,message:"YAML parse returned an empty document.",path:"/"}]})),xx("yaml"),gt("Fix YAML errors before validating","error");return}const Z=await ap.validate(k.document,I.map(be=>be.name));Le(be=>({...be,findings:Array.isArray(Z==null?void 0:Z.findings)?Z.findings:T}));const ee=((Z==null?void 0:Z.findings)||[]).filter(be=>tR(be.level)==="error").length;ee>0&&xx("yaml"),gt(ee>0?`${ee} validation errors`:"Validation passed",ee>0?"error":"success")}catch(k){gt((k==null?void 0:k.message)||"Validation failed","error")}}async function tye(){try{const k=ke.yaml?{yaml:ke.yaml}:await b8(),T=new Blob([(k==null?void 0:k.yaml)||""],{type:"text/yaml"}),Z=URL.createObjectURL(T),ee=document.createElement("a");ee.href=Z,ee.download=`${ke.name||"workflow"}.yaml`,ee.click(),URL.revokeObjectURL(Z),gt("YAML exported","success")}catch(k){gt((k==null?void 0:k.message)||"Export failed","error")}}function iye(){const k=document.createElement("input");k.type="file",k.accept=".yaml,.yml",k.onchange=async T=>{var be,Ke,it,Gt;const Z=(be=T.target.files)==null?void 0:be[0];if(!Z)return;const ee=await Z.text();try{const nn=await ap.parseYaml(ee,I.map(rd=>rd.name));if(!(nn!=null&&nn.document))throw new Error("YAML parse returned an empty document.");const Gs=eR(nn.document,null,yb());mh.current=!0,Sx(),ct(Gs.roles),Be(Gs.nodes),Tt(Gs.edges),Vt(((Ke=Gs.nodes[0])==null?void 0:Ke.id)||null),Le({...P6(),directoryId:ke.directoryId||((it=x.directories[0])==null?void 0:it.directoryId)||null,name:nn.document.name||Z.name.replace(/\.ya?ml$/i,""),description:nn.document.description||"",closedWorldMode:!!((Gt=nn.document.configuration)!=null&&Gt.closedWorldMode),yaml:ee,findings:Array.isArray(nn.findings)?nn.findings:[],dirty:!0,lastSavedAt:null}),l("studio"),u("editor"),gt("YAML imported","success")}catch(nn){gt((nn==null?void 0:nn.message)||"Import failed","error")}},k.click()}async function nye(k){var ee;const T=await ap.parseYaml(k,I.map(be=>be.name));if(!(T!=null&&T.document))throw new Error("AI did not return a valid workflow YAML.");const Z=eR(T.document,null,yb());mh.current=!0,Sx(),ct(Z.roles),Be(Z.nodes),Tt(Z.edges),Vt(((ee=Z.nodes[0])==null?void 0:ee.id)||null),rt(null),Rn(null),Ls(null),Ir(null),Cl(!1),Le(be=>{var Ke,it,Gt,nn,Gs;return{...be,directoryId:be.directoryId||((Ke=x.directories[0])==null?void 0:Ke.directoryId)||null,name:((it=T.document)==null?void 0:it.name)||be.name||"draft",description:((Gt=T.document)==null?void 0:Gt.description)||"",closedWorldMode:!!((Gs=(nn=T.document)==null?void 0:nn.configuration)!=null&&Gs.closedWorldMode),yaml:k,findings:Array.isArray(T.findings)?T.findings:[],dirty:!0,lastSavedAt:null}}),l("studio"),u("editor"),qD()}async function sye(){if(!D_.trim()){gt("Describe the workflow you want to generate","error");return}UD(!0),gh(""),iC(""),ju("");try{const T=dt.length>0||tt.length>0||!!ke.yaml.trim()?await ap.serializeYaml(O6(ke,Ve,dt,tt),I.map(Ke=>Ke.name)):null,Z=(T==null?void 0:T.yaml)||ke.yaml||"",ee=await $fe.authorWorkflow({prompt:D_.trim(),currentYaml:Z,availableWorkflowNames:I.map(Ke=>Ke.name),metadata:yt},{onText:Ke=>gh(Ke),onReasoning:Ke=>iC(Ke)}),be=String(ee||"").trim();if(!be)throw new Error("AI did not return workflow YAML.");gh(be),ju(be),gt("AI workflow YAML is ready to apply","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to generate workflow YAML","error")}finally{UD(!1)}}function oye(){Cl(!0)}async function rye(){try{if(o.enabled&&!o.authenticated){Cl(!1),gt("Sign in before running workflows","error");return}const k=await b8();if(((k==null?void 0:k.findings)||[]).filter(be=>tR(be.level)==="error").length>0){Cl(!1),xx("yaml"),u("editor"),gt("Fix YAML errors before running","error");return}const Z=i.workflowStorageMode==="scope"&&!!i.scopeId&&!!ke.workflowId&&!ke.dirty,ee=await z_.start({workflowName:ke.name.trim()||"draft",prompt:I_.trim(),workflowYamls:[(k==null?void 0:k.yaml)||ke.yaml],runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null,scopeId:Z?i.scopeId:null,workflowId:Z?ke.workflowId:null,eventFormat:Z?"workflow":null});Cl(!1),u("execution"),C(!1),L(!1),Lx(ee),Y0e((ee==null?void 0:ee.executionId)||null),gt(Z?"Published workflow run started":"Execution started","success")}catch(k){gt((k==null?void 0:k.message)||"Execution failed","error")}}function Lx(k){const T=sft(k);rt((k==null?void 0:k.executionId)||null),Rn(k),Ls(T),Ir((T==null?void 0:T.defaultLogIndex)??null),j0e(k),qD()}async function KD(k){try{const T=await z_.get(k);Lx(T),u("execution"),S||C(!1)}catch(T){gt((T==null?void 0:T.message)||"Failed to load execution","error")}}async function v8(k,T){if(!Ee)return;const Z=Qw.trim();if(k.kind==="human_input"&&!Z){gt("Input is required for this step","error");return}const ee=`${Ee}:${k.stepId}:${T}`;N_(ee);try{const be=await z_.resume(Ee,{runId:k.runId,stepId:k.stepId,approved:k.kind==="human_input"?!0:T==="approve",userInput:Z||null,suspensionType:k.kind});Lx(be),Xg(""),u("execution"),C(!1),gt(k.kind==="human_approval"?T==="approve"?"Approval sent":"Rejection sent":"Input submitted","success")}catch(be){gt((be==null?void 0:be.message)||"Failed to resume execution","error")}finally{N_("")}}async function aye(){if(!(!Ee||!DQ)){zu(!0);try{const k=await z_.stop(Ee,{reason:"user requested stop"});Lx(k),gt("Stop requested","info")}catch(k){gt((k==null?void 0:k.message)||"Failed to stop execution","error")}finally{zu(!1)}}}async function lye(){if(i.workflowStorageMode==="scope"){gt("Workflow storage is bound to the current scope.","info");return}if(!B.trim()){gt("Directory path required","error");return}try{await lp.addDirectory({path:B.trim(),label:K.trim()||null}),V(""),z(""),Q(!1),await PQ(),await _8(),gt("Directory added","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to add directory","error")}}async function cye(k){if(i.workflowStorageMode==="scope"){gt("Workflow storage is bound to the current scope.","info");return}try{await lp.removeDirectory(k),await PQ(),await _8(),gt("Directory removed","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to remove directory","error")}}async function dye(){try{const k=await cC.saveCatalog({connectors:gn.map(Cce)});u8(k),gt("Connectors saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save connectors","error")}}function hye(){var k;(k=We.current)==null||k.click()}async function uye(k){var Z;const T=(Z=k.target.files)==null?void 0:Z[0];if(k.target.value="",!!T)try{_c(!0);const ee=await cC.importCatalog(T);u8(ee),gt(`Imported ${(ee==null?void 0:ee.importedCount)??0} connectors from ${(ee==null?void 0:ee.sourceFilePath)||T.name}`,"success")}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to import connector catalog","error")}finally{_c(!1)}}async function BQ(){await cC.deleteDraft(),g8(null)}async function fye(k){if(!Dce(k)){await BQ();return}const T=await cC.saveDraft({draft:Cce(k)});g8(T)}function gye(k="http"){us(T=>T||Zut(k,"")),Dn(!0)}async function WQ(){const k=tn;Dn(!1);try{await fye(k),Dce(k)&>("Connector draft saved","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to save connector draft","error")}}async function pye(){if(!tn)return;const k=tn.type||"http",T=tn.name.trim()||Xut(gn,k),Z={...tn,key:`connector_${crypto.randomUUID()}`,name:T,type:k};bl(ee=>[Z,...ee]),kr(Z.key),W_("connectors"),us(null),Dn(!1);try{await BQ()}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to clear connector draft","error")}gt(`Connector ${T} added`,"success")}function mye(k){bl(T=>{var ee;const Z=T.filter(be=>be.key!==k);return kr(((ee=Z[0])==null?void 0:ee.key)||null),Z})}function vc(k,T){bl(Z=>Z.map(ee=>ee.key===k?T(ee):ee))}async function _ye(){try{const k=await dC.saveCatalog({roles:X.map(vce)});f8(k),gt("Roles saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save roles","error")}}function bye(){var k;(k=Mt.current)==null||k.click()}async function vye(k){var Z;const T=(Z=k.target.files)==null?void 0:Z[0];if(k.target.value="",!!T)try{Zg(!0);const ee=await dC.importCatalog(T);f8(ee),gt(`Imported ${(ee==null?void 0:ee.importedCount)??0} roles from ${(ee==null?void 0:ee.sourceFilePath)||T.name}`,"success")}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to import role catalog","error")}finally{Zg(!1)}}async function HQ(){await dC.deleteDraft(),p8(null)}async function wye(k){if(!Tce(k)){await HQ();return}const T=await dC.saveDraft({draft:vce(k)});p8(T)}function VQ(k="catalog"){Wu(k),Er(T=>T||(k==="workflow"?Hft(Y):Wft())),nd(!0)}async function zQ(){const k=Tn;nd(!1);try{await wye(k),Tce(k)&>("Role draft saved","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to save role draft","error")}}async function Cye(){if(!Tn)return;const k=mo==="workflow"?Ve:X,T=Tn.id.trim()||Nce(k,Tn.name||"role"),Z=Tn.name.trim()||T,ee=Dm(k.length+1,{id:T,name:Z,systemPrompt:Tn.systemPrompt,provider:Tn.provider,model:Tn.model,connectorsText:Tn.connectorsText});if(mo==="workflow"){const be=T.trim().toLowerCase(),Ke=Ve.find(Gt=>Gt.id.trim().toLowerCase()===be&&be),it=Ke?Ve.map(Gt=>Gt.key===Ke.key?{...Gt,id:ee.id,name:ee.name,systemPrompt:ee.systemPrompt,provider:ee.provider,model:ee.model,connectorsText:ee.connectorsText}:Gt):[ee,...Ve];ct(it),id((Ke==null?void 0:Ke.key)||ee.key),m("roles"),v(!0),Jr()}else wl(be=>[ee,...be]),po(ee.key),W_("roles");Er(null),nd(!1);try{await HQ()}catch(be){gt((be==null?void 0:be.message)||"Failed to clear role draft","error")}gt(mo==="workflow"?`Role ${T} added to workflow`:`Role ${T} added`,"success")}function yye(k){var Z;const T=X.filter(ee=>ee.key!==k);wl(T),po(((Z=T[0])==null?void 0:Z.key)||null)}function oC(k,T){wl(Z=>Z.map(ee=>ee.key===k?T(ee):ee))}function GD(k,T){ct(Z=>Z.map(ee=>ee.key===k?T(ee):ee)),Jr()}function jQ(k){var Ke;const T=X.find(it=>it.key===k);if(!T)return;const Z=T.id.trim().toLowerCase(),ee=Ve.find(it=>it.id.trim().toLowerCase()===Z&&Z),be=ee?Ve.map(it=>it.key===ee.key?{...it,id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}:it):[...Ve,Dm(Ve.length+1,{id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText})];ct(be),id((ee==null?void 0:ee.key)||((Ke=be[0])==null?void 0:Ke.key)||null),m("roles"),v(!0),Jr(),gt(ee?`Role ${T.id} refreshed`:`Role ${T.id} added`,"success")}function Sye(k){const T=Ve.find(it=>it.key===k);if(!T)return;const Z=T.id.trim().toLowerCase(),ee=X.find(it=>it.id.trim().toLowerCase()===Z&&Z),be=ee?null:Dm(X.length+1,{id:T.id||Nce(X),name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}),Ke=ee?X.map(it=>it.key===ee.key?{...it,id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}:it):[be,...X];wl(Ke),po((ee==null?void 0:ee.key)||(be==null?void 0:be.key)||null),W_("roles"),gt("Role copied to catalog. Save to persist.","info")}async function w8(){try{const k=await ET.save({runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null,appearanceTheme:Y.appearanceTheme,colorMode:Y.colorMode,defaultProviderName:Y.defaultProviderName||null,providers:Y.providers.map(T=>({providerName:T.providerName.trim(),providerType:T.providerType.trim(),model:T.model.trim(),endpoint:T.endpoint.trim(),apiKey:T.apiKey}))});TQ(k),E(T=>({...T,runtimeBaseUrl:(k==null?void 0:k.runtimeBaseUrl)||T.runtimeBaseUrl})),gt("Settings saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save settings","error")}}async function xye(){const k=Y.colorMode,T=Y.colorMode==="dark"?"light":"dark";te(Z=>({...Z,colorMode:T}));try{await ET.save({colorMode:T})}catch(Z){te(ee=>({...ee,colorMode:k})),gt((Z==null?void 0:Z.message)||"Failed to switch theme mode","error")}}async function Lye(){try{R_({status:"testing",message:"Testing runtime connectivity..."});const k=await ET.testRuntime({runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null});R_({status:k!=null&&k.reachable?"success":"error",message:(k==null?void 0:k.message)||(k!=null&&k.reachable?"Connected successfully.":"Failed to reach runtime.")})}catch(k){R_({status:"error",message:(k==null?void 0:k.message)||"Failed to reach runtime."})}}function $Q(k){var ee,be;const T=k||((ee=Y.providerTypes.find(Ke=>Ke.recommended))==null?void 0:ee.id)||((be=Y.providerTypes[0])==null?void 0:be.id)||"openai",Z=Oft(T,Y.providerTypes,Y.providers);te(Ke=>({...Ke,providers:[Z,...Ke.providers],defaultProviderName:Ke.defaultProviderName||Z.providerName})),je(Z.key),AQ("llm")}function kx(k,T){te(Z=>{const ee=Z.providers.map(be=>be.key!==k?be:T(be));return{...Z,providers:ee}})}function kye(k){te(T=>{var Ke,it;const Z=T.providers.find(Gt=>Gt.key===k),ee=T.providers.filter(Gt=>Gt.key!==k),be=Z&&T.defaultProviderName===Z.providerName?((Ke=ee[0])==null?void 0:Ke.providerName)||"":T.defaultProviderName;return je(((it=ee[0])==null?void 0:it.key)||null),{...T,providers:ee,defaultProviderName:be}})}function np(k){Si&&(Be(T=>T.map(Z=>Z.id===Si?k(Z):Z)),Jr())}function Eye(k){Be(Z=>hfe(k,Z)),k.some(Z=>Z.type==="position")&&Jr()}function Iye(k){Tt(T=>ufe(k,T)),k.length>0&&Jr()}function Nye(k){if(!k.source||!k.target)return;const T=dt.find(ee=>ee.id===k.source);let Z;(T==null?void 0:T.data.stepType)==="conditional"?Z=ift(k.source,tt):(T==null?void 0:T.data.stepType)==="switch"&&(Z=window.prompt("Branch label","_default")||"_default"),Tt(ee=>[...ee,dM(k.source,k.target,Z)]),Jr()}function UQ(k,T){const Z=Qut(k,Ta,dt,Ve,gn,T?{parameters:{connector:T}}:{});T&&cM(Z.data.parameters,T,gn),Be(ee=>[...ee,Z]),Vt(Z.id),Nn(!1),ei({open:!1,x:0,y:0}),m("node"),v(!0),Jr()}function Dye(k){if(h!=="editor"||(k.preventDefault(),!M_.current))return;const T=M_.current.screenToFlowPosition({x:k.clientX,y:k.clientY});xr(T),ei({open:!0,x:k.clientX,y:k.clientY})}function Tye(k){Be(T=>T.filter(Z=>Z.id!==k)),Tt(T=>T.filter(Z=>Z.source!==k&&Z.target!==k)),Vt(T=>T===k?null:T),Jr()}function Rye(){var k;(k=navigator.clipboard)==null||k.writeText(ke.yaml||""),gt("YAML copied","info")}function Mye(){VQ("workflow")}function Aye(k){const T=Ve.find(Z=>Z.key===k);ct(Z=>Z.filter(ee=>ee.key!==k)),Be(Z=>Z.map(ee=>ee.data.targetRole&&(T==null?void 0:T.id)===ee.data.targetRole?{...ee,data:{...ee.data,targetRole:""}}:ee)),Jr()}function Pye(k,T){ct(Z=>Z.map(ee=>{if(ee.key!==k)return ee;const be=new Set(Ll(ee.connectorsText));return be.has(T)?be.delete(T):be.add(T),{...ee,connectorsText:Array.from(be).join(` -`)}})),Jr()}const qQ=I.filter(k=>{const T=M.trim().toLowerCase();return T?[k.name,k.description,k.fileName,k.filePath,k.directoryLabel].join(" ").toLowerCase().includes(T):!0}),Oye=u4.map(k=>({...k,items:k.items.filter(T=>{const Z=Os.trim().toLowerCase();return!Z||T.toLowerCase().includes(Z)||k.label.toLowerCase().includes(Z)})})).filter(k=>k.items.length>0),KQ=gn.filter(k=>{const T=Os.trim().toLowerCase();return T?[k.name,k.type,"connector","configured connectors"].join(" ").toLowerCase().includes(T):!0}),GQ=gn.filter(k=>{const T=Ks.trim().toLowerCase();return T?[k.name,k.type,k.http.baseUrl,k.cli.command,k.mcp.serverName,k.mcp.command].join(" ").toLowerCase().includes(T):!0}),YQ=X.filter(k=>F6(k,dh)),ZQ=X.filter(k=>F6(k,gi)),XQ=Ve.filter(k=>F6(k,gi)),QQ=Y.providers.filter(k=>{const T=ce.trim().toLowerCase();return T?[k.providerName,k.providerType,k.displayName,k.model,k.endpoint].join(" ").toLowerCase().includes(T):!0}),JQ=zt?tt.filter(k=>k.source===zt.id):[],C8=x.directories.find(k=>k.directoryId===ke.directoryId)||null,eJ=ke.findings.filter(k=>tR(k.level)==="error"),tJ=Et?`${Sb(Et.startedAtUtc)} · ${Et.status}`:od.length>0?`${od.length} runs`:"No runs yet",Fye=!e&&(w||S),Bye=S?"Viewing in new window":tJ,Ex={borderColor:"var(--accent-border)",background:"var(--accent-soft-end)"},YD={background:"var(--accent-icon-surface)",color:"var(--accent)"},Wye={borderColor:"var(--accent-border)",background:"var(--accent-soft-end)",color:"var(--accent-text)"},ZD=o.providerDisplayName||"NyxID",XD=o.name||o.email||ZD,Hye=o.email&&o.email!==XD?o.email:`Connected with ${ZD}`,Vye=XD.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(k=>{var T;return((T=k[0])==null?void 0:T.toUpperCase())||""}).join("")||"N",zye=o.errorMessage||(o.enabled?"Sign in to load your workspace.":`${ZD} sign-in is currently unavailable.`),jye=o.authenticated?y.jsxs("div",{className:"header-auth-chip",children:[o.picture?y.jsx("img",{src:o.picture,alt:XD,className:"header-auth-avatar-image"}):y.jsx("div",{className:"header-auth-avatar",children:Vye}),y.jsxs("div",{className:"header-auth-copy",children:[y.jsx("div",{className:"header-auth-label",children:XD}),y.jsx("div",{className:"header-auth-meta",children:Hye})]}),y.jsx("button",{onClick:()=>window.location.assign(o.logoutUrl||"/auth/logout"),className:"panel-icon-button header-auth-logout",title:"Sign out from NyxID.",children:y.jsx(iRe,{size:14})})]}):y.jsxs("div",{className:"header-auth-guest",children:[y.jsxs("div",{className:"header-auth-guest-copy",children:[y.jsx("div",{className:"header-auth-label",children:ZD}),y.jsx("div",{className:"header-auth-meta",children:zye})]}),y.jsxs("a",{href:o.loginUrl||"/auth/login",className:"solid-action header-auth-link !no-underline",children:[y.jsx(ZE,{size:14})," Sign in"]})]});function iJ(k=!1){var be,Ke;const T=!k&&Fye,Z=["execution-logs",T?"collapsed":"",k?"execution-logs-fullscreen":""].filter(Boolean).join(" "),ee=!k&&!!Ee;return y.jsxs("section",{className:Z,children:[y.jsxs("div",{className:"execution-logs-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[11px] text-gray-400 uppercase tracking-[0.16em]",children:"Execution"}),y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:k?"Execution logs":"Logs"})]}),y.jsxs("div",{className:"execution-logs-header-actions",children:[(be=li==null?void 0:li.logs)!=null&&be.length?y.jsx("button",{type:"button",className:`panel-icon-button execution-logs-copy-action ${Vu?"active":""}`,title:"Copy all execution logs.","aria-label":"Copy all execution logs.","data-tooltip":"Copy logs",onClick:()=>void W0e(),children:Vu?y.jsx(Op,{size:14}):y.jsx(CR,{size:14})}):null,ee?y.jsx("button",{type:"button",className:`panel-icon-button execution-logs-window-action ${S?"active":""}`,title:"Pop out","aria-label":"Pop out execution logs.","data-tooltip":"Pop out",onClick:V0e,children:y.jsx(yte,{size:14})}):null,k?y.jsx("button",{type:"button",className:"panel-icon-button execution-logs-window-action",title:"Close window.","aria-label":"Close logs window.","data-tooltip":"Close window",onClick:()=>window.close(),children:y.jsx(nv,{size:14})}):y.jsxs("button",{type:"button",onClick:z0e,className:"execution-logs-collapse-action","aria-expanded":!T,"data-tooltip":S?"Focus logs window.":T?"Expand logs.":"Collapse logs.",children:[y.jsx("span",{className:"text-[12px] text-gray-500",children:Bye}),S?y.jsx(yte,{size:15}):y.jsx(LL,{size:16,className:`execution-logs-collapse-icon ${T?"collapsed":""}`})]})]})]}),T?null:y.jsxs("div",{className:"execution-logs-body",children:[y.jsx("div",{className:"execution-runs-list",children:od.length===0?y.jsx(ob,{icon:y.jsx(s0,{size:18,className:"text-gray-300"}),title:"No runs",copy:"Run the current workflow to inspect execution."}):od.map(it=>y.jsxs("button",{onClick:()=>void KD(it.executionId),className:`execution-run-card ${Ee===it.executionId?"active":""}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:Sb(it.startedAtUtc)}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:it.status})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:Mft(it.startedAtUtc,it.completedAtUtc)})]},it.executionId))}),y.jsxs("div",{className:"execution-log-stream",children:[y.jsx("div",{className:"execution-log-list",children:(Ke=li==null?void 0:li.logs)!=null&&Ke.length?li.logs.map((it,Gt)=>y.jsxs("button",{onClick:()=>void B0e(it,Gt),className:`execution-log-card tone-${it.tone} ${ks===Gt?"active":""}`,title:"Click to copy this log.",children:[y.jsxs("div",{className:"execution-log-card-head",children:[y.jsx("div",{className:"text-[12px] font-semibold text-gray-800",children:it.title}),y.jsxs("div",{className:"execution-log-card-meta",children:[Hu===Gt?y.jsxs("span",{className:"execution-log-card-copied",children:[y.jsx(Op,{size:12})," Copied"]}):null,y.jsx("div",{className:"text-[11px] text-gray-400",children:Sb(it.timestamp)})]})]}),it.meta?y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:it.meta}):null,it.previewText?y.jsx("div",{className:"execution-log-card-preview",children:it.previewText}):null]},`${it.timestamp}-${Gt}`)):y.jsx(ob,{icon:y.jsx(Wf,{size:18,className:"text-gray-300"}),title:"No logs yet",copy:"Pick a run to inspect frames and step transitions."})}),_i?y.jsxs("div",{className:"execution-action-panel",children:[y.jsxs("div",{className:"execution-action-intro",children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[11px] text-gray-400 uppercase tracking-[0.14em]",children:"Action required"}),y.jsx("div",{className:"text-[15px] font-semibold text-gray-800 mt-1",children:_i.kind==="human_approval"?"Human approval":"Human input"}),y.jsx("div",{className:"execution-action-subtitle",children:_i.kind==="human_approval"?"Review the pending gate and approve or reject the run.":"Provide the missing value to resume this workflow step."})]}),y.jsx("span",{className:"execution-action-badge",children:_i.stepId})]}),y.jsxs("div",{className:"execution-action-meta",children:[y.jsxs("span",{className:"execution-action-chip",children:[y.jsx(kL,{size:12})," Human required"]}),_i.variableName?y.jsxs("span",{className:"execution-action-chip",children:["stores as ",_i.variableName]}):null,_i.timeoutSeconds?y.jsxs("span",{className:"execution-action-chip",children:["timeout ",_i.timeoutSeconds,"s"]}):null]})]}),_i.prompt?y.jsxs("div",{className:"execution-action-block",children:[y.jsx("div",{className:"execution-action-block-label",children:"Prompt"}),y.jsx("div",{className:"execution-action-prompt",children:_i.prompt})]}):null,y.jsxs("div",{className:"execution-action-block",children:[y.jsxs("div",{className:"execution-action-field-head",children:[y.jsx("label",{className:"field-label",children:_i.kind==="human_approval"?"Feedback":_i.variableName||"Input"}),y.jsx("span",{className:`execution-action-requirement ${_i.kind==="human_approval"?"optional":"required"}`,children:_i.kind==="human_approval"?"Optional note":"Required"})]}),y.jsx("div",{className:"execution-action-helper",children:_i.kind==="human_approval"?"Add context for the operator if needed, then approve or reject this gate.":_i.variableName?`The submitted value will resume the run and be available as ${_i.variableName}.`:"This response resumes the workflow immediately."}),y.jsx("textarea",{ref:he,className:"panel-textarea execution-action-textarea mt-1",value:Qw,placeholder:_i.kind==="human_approval"?"Optional feedback":"Enter the value to continue this step",onChange:it=>Xg(it.target.value)})]}),y.jsx("div",{className:"execution-action-footer",children:_i.kind==="human_approval"?y.jsxs(y.Fragment,{children:[y.jsxs("button",{type:"button",className:"ghost-action execution-danger-action",disabled:fh===`${ip}:reject`,onClick:()=>void v8(_i,"reject"),children:[y.jsx(nv,{size:14})," ",fh===`${ip}:reject`?"Rejecting...":"Reject"]}),y.jsxs("button",{type:"button",className:"solid-action",disabled:fh===`${ip}:approve`,onClick:()=>void v8(_i,"approve"),children:[y.jsx(Op,{size:14})," ",fh===`${ip}:approve`?"Approving...":"Approve"]})]}):y.jsxs("button",{type:"button",className:"solid-action",disabled:fh===`${ip}:submit`,onClick:()=>void v8(_i,"submit"),children:[y.jsx(s0,{size:14})," ",fh===`${ip}:submit`?"Submitting...":"Submit input"]})})]}):null]})]})]})}function $ye(){return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:"Roles"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[360px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"catalog-sidebar-actions",children:[y.jsx("input",{ref:Mt,type:"file",accept:".json,application/json",className:"hidden",onChange:k=>void vye(k)}),y.jsxs("button",{onClick:()=>VQ("catalog"),className:"solid-action flex-1 justify-center",children:[y.jsx(Sp,{size:14})," Add role"]}),y.jsx("button",{onClick:_ye,className:"ghost-action catalog-save-action",children:"Save"}),y.jsxs("button",{onClick:bye,className:"ghost-action catalog-save-action",disabled:hh,children:[y.jsx(kT,{size:14})," ",hh?"Importing...":"Import"]})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search roles",value:dh,onChange:k=>fi(k.target.value)})]}),y.jsx("div",{className:"text-[11px] text-gray-400 break-all",children:O_?`${Cn.fileExists?"Remote object":"Remote object pending"} · ${Cn.filePath}`:`${Cn.fileExists?"File":"Will create"} · ${Cn.filePath}`}),Qr.filePath?y.jsxs("div",{className:"text-[11px] text-gray-400 break-all",children:["Draft · ",Qr.filePath]}):null]}),y.jsx("div",{className:"space-y-2",children:YQ.length===0?y.jsx("div",{className:"empty-card",children:"No roles matched"}):YQ.map(k=>y.jsxs("button",{onClick:()=>po(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:Jo===k.key?Ex:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||k.id||"Role"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.id||"role"})]}),y.jsxs("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:[k.provider||"default",k.model?` · ${k.model}`:""]})]},k.key))})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto p-6",children:Mn?y.jsxs("div",{className:"max-w-[980px] space-y-3 rounded-[28px] border border-[#EEEAE4] bg-white p-5 shadow-[0_22px_54px_rgba(17,24,39,0.06)]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[18px] font-semibold text-gray-800",children:Mn.name||Mn.id||"Role"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:Mn.id||"role_id"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:()=>jQ(Mn.key),className:"ghost-action !px-3",children:"Use in workflow"}),y.jsx("button",{onClick:()=>yye(Mn.key),title:"Delete role.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(Kn,{label:"Role ID",value:Mn.id,onChange:k=>oC(Mn.key,T=>({...T,id:k}))}),y.jsx(Kn,{label:"Role name",value:Mn.name,onChange:k=>oC(Mn.key,T=>({...T,name:k}))})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:Mn.provider,onChange:k=>{const T=k.target.value,Z=Y.providers.find(ee=>ee.providerName===T);oC(Mn.key,ee=>({...ee,provider:T,model:(Z==null?void 0:Z.model)||ee.model}))},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(k=>y.jsx("option",{value:k.providerName,children:k.providerName},k.key))]})]}),y.jsx(Kn,{label:"Model",value:Mn.model,onChange:k=>oC(Mn.key,T=>({...T,model:k}))})]}),y.jsx(Cc,{label:"System prompt",value:Mn.systemPrompt,rows:8,onChange:k=>oC(Mn.key,T=>({...T,systemPrompt:k}))}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Allowed connectors"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:gn.length===0?y.jsx("div",{className:"text-[12px] text-gray-400",children:"No connectors configured"}):gn.map(k=>{const T=Ll(Mn.connectorsText).includes(k.name);return y.jsx("button",{onClick:()=>oC(Mn.key,Z=>{const ee=new Set(Ll(Z.connectorsText));return ee.has(k.name)?ee.delete(k.name):ee.add(k.name),{...Z,connectorsText:Array.from(ee).join(` -`)}}),className:`chip-button ${T?"chip-button-active":""}`,children:k.name},k.key)})})]})]}):y.jsx("div",{className:"max-w-[420px]",children:y.jsx(ob,{icon:y.jsx(kL,{size:18,className:"text-gray-300"}),title:"No role selected",copy:"Create a role or pick one from the catalog."})})})]})]})}function Uye(){return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:"Connectors"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[360px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"catalog-sidebar-actions",children:[y.jsx("input",{ref:We,type:"file",accept:".json,application/json",className:"hidden",onChange:k=>void uye(k)}),y.jsxs("button",{onClick:()=>gye("http"),className:"solid-action flex-1 justify-center",children:[y.jsx(Sp,{size:14})," Add connector"]}),y.jsx("button",{onClick:dye,className:"ghost-action catalog-save-action",children:"Save"}),y.jsxs("button",{onClick:hye,className:"ghost-action catalog-save-action",disabled:Yg,children:[y.jsx(kT,{size:14})," ",Yg?"Importing...":"Import"]})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search connectors",value:Ks,onChange:k=>hs(k.target.value)})]}),y.jsx("div",{className:"text-[11px] text-gray-400 break-all",children:P_?`${Lr.fileExists?"Remote object":"Remote object pending"} · ${Lr.filePath}`:`${Lr.fileExists?"File":"Will create"} · ${Lr.filePath}`}),vl.filePath?y.jsxs("div",{className:"text-[11px] text-gray-400 break-all",children:["Draft · ",vl.filePath]}):null]}),y.jsx("div",{className:"space-y-2",children:GQ.length===0?y.jsx("div",{className:"empty-card",children:"No connectors matched"}):GQ.map(k=>y.jsxs("button",{onClick:()=>kr(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:qn===k.key?Ex:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||"New connector"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.type})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:k.type==="http"?k.http.baseUrl||"HTTP connector":k.type==="cli"?k.cli.command||"CLI connector":k.mcp.serverName||k.mcp.command||"MCP connector"})]},k.key))})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto p-6",children:Lt?y.jsxs("div",{className:"max-w-[980px] space-y-3 rounded-[28px] border border-[#EEEAE4] bg-white p-5 shadow-[0_22px_54px_rgba(17,24,39,0.06)]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[18px] font-semibold text-gray-800",children:Lt.name||"Connector"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:Lt.type.toUpperCase()})]}),y.jsx("button",{onClick:()=>mye(Lt.key),title:"Delete connector.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]}),y.jsx(Kn,{label:"Name",value:Lt.name,onChange:k=>vc(Lt.key,T=>({...T,name:k}))}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Type"}),y.jsxs("select",{className:"panel-input mt-1",value:Lt.type,onChange:k=>vc(Lt.key,T=>({...T,type:k.target.value})),children:[y.jsx("option",{value:"http",children:"HTTP"}),y.jsx("option",{value:"cli",children:"CLI"}),y.jsx("option",{value:"mcp",children:"MCP"})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(Kn,{label:"Timeout",value:Lt.timeoutMs,onChange:k=>vc(Lt.key,T=>({...T,timeoutMs:k}))}),y.jsx(Kn,{label:"Retry",value:Lt.retry,onChange:k=>vc(Lt.key,T=>({...T,retry:k}))})]}),y.jsxs("label",{className:`inline-flex items-center gap-2 rounded-[14px] border px-3 py-2 text-[12px] ${Lt.enabled?"border-green-200 bg-green-50 text-green-700":"border-[#E5E1DA] bg-white text-gray-600"}`,children:[y.jsx("input",{type:"checkbox",checked:Lt.enabled,onChange:k=>vc(Lt.key,T=>({...T,enabled:k.target.checked}))}),"Enabled"]}),Lt.type==="http"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(Cte,{size:15})," HTTP"]}),y.jsx(Kn,{label:"Base URL",value:Lt.http.baseUrl,onChange:k=>vc(Lt.key,T=>({...T,http:{...T.http,baseUrl:k}}))}),y.jsx(Cc,{label:"Allowed methods",value:Lt.http.allowedMethods.join(` -`),onChange:k=>vc(Lt.key,T=>({...T,http:{...T.http,allowedMethods:Ll(k).map(Z=>Z.toUpperCase())}}))}),y.jsx(Cc,{label:"Allowed paths",value:Lt.http.allowedPaths.join(` -`),onChange:k=>vc(Lt.key,T=>({...T,http:{...T.http,allowedPaths:Ll(k)}}))})]}):null,Lt.type==="cli"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(lRe,{size:15})," CLI"]}),y.jsx(Kn,{label:"Command",value:Lt.cli.command,onChange:k=>vc(Lt.key,T=>({...T,cli:{...T.cli,command:k}}))}),y.jsx(Cc,{label:"Fixed arguments",value:Lt.cli.fixedArguments.join(` -`),onChange:k=>vc(Lt.key,T=>({...T,cli:{...T.cli,fixedArguments:Ll(k)}}))})]}):null,Lt.type==="mcp"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(cRe,{size:15})," MCP"]}),y.jsx(Kn,{label:"Server name",value:Lt.mcp.serverName,onChange:k=>vc(Lt.key,T=>({...T,mcp:{...T.mcp,serverName:k}}))}),y.jsx(Kn,{label:"Command",value:Lt.mcp.command,onChange:k=>vc(Lt.key,T=>({...T,mcp:{...T.mcp,command:k}}))})]}):null]}):y.jsx("div",{className:"max-w-[420px]",children:y.jsx(ob,{icon:y.jsx(wR,{size:18,className:"text-gray-300"}),title:"No connector selected",copy:"Create a connector or pick one from the catalog."})})})]})]})}return o.loading?y.jsx(zft,{}):o.enabled&&!o.authenticated?y.jsx(jft,{providerDisplayName:o.providerDisplayName,loginUrl:o.loginUrl,errorMessage:o.errorMessage}):e?y.jsx("div",{className:"studio-shell execution-logs-popout-shell relative flex min-h-screen w-full overflow-hidden bg-[#F2F1EE] text-gray-800","data-appearance":Y.appearanceTheme||"blue","data-color-mode":Y.colorMode||"light",children:iJ(!0)}):y.jsxs("div",{className:"studio-shell relative flex h-screen w-full overflow-hidden bg-[#F2F1EE] text-gray-800","data-appearance":Y.appearanceTheme||"blue","data-color-mode":Y.colorMode||"light",onClick:()=>{go.open&&ei({open:!1,x:0,y:0})},children:[y.jsx("div",{className:"app-auth-anchor",children:jye}),y.jsxs("aside",{className:"studio-rail",children:[y.jsxs("div",{className:"flex flex-col items-center gap-3",children:[y.jsx("div",{className:"flex h-11 w-11 items-center justify-center overflow-hidden rounded-[14px] border border-black/10 bg-[#18181B]",children:y.jsx(P0e,{size:44})}),y.jsx(sb,{active:a==="studio",label:"Studio",icon:y.jsx(kte,{size:18}),onClick:U0e}),y.jsx(sb,{active:a==="workflows",label:"Workflows",icon:y.jsx(Wf,{size:18}),onClick:MQ}),i.scriptsEnabled?y.jsx(sb,{active:a==="scripts",label:"Scripts Studio",icon:y.jsx(YE,{size:18}),onClick:q0e}):null,y.jsx(sb,{active:a==="roles",label:"Roles",icon:y.jsx(kL,{size:18}),onClick:()=>W_("roles")}),y.jsx(sb,{active:a==="connectors",label:"Connectors",icon:y.jsx(wR,{size:18}),onClick:()=>W_("connectors")})]}),y.jsxs("div",{className:"mt-auto flex flex-col items-center gap-3",children:[y.jsx(sb,{active:Y.colorMode==="dark",label:Y.colorMode==="dark"?"Switch to light mode":"Switch to dark mode",icon:Y.colorMode==="dark"?y.jsx(Lte,{size:18}):y.jsx(Ste,{size:18}),onClick:()=>{xye()}}),y.jsx(sb,{active:a==="settings",label:"Settings",icon:y.jsx(rRe,{size:18}),onClick:()=>AQ("runtime")})]})]}),y.jsx("main",{className:"flex-1 min-w-0 flex flex-col",children:a==="workflows"?y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Workspace"}),y.jsx("div",{className:"panel-title !mt-0",children:"Workflows"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[320px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:i.workflowStorageMode==="scope"?"Scope":"Directories"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:i.workflowStorageMode==="scope"?"Workflows are loaded from and saved to the current login scope.":"New workflows will be created in the selected directory."})]}),i.workflowStorageMode!=="scope"?y.jsx("button",{onClick:()=>Q(k=>!k),title:j?"Hide directory form.":"Add workflow directory.",className:"panel-icon-button",children:y.jsx(J2e,{size:14})}):null]}),j&&i.workflowStorageMode!=="scope"?y.jsxs("div",{className:"space-y-2 rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("input",{className:"panel-input",placeholder:"/absolute/path/to/workflows",value:B,onChange:k=>V(k.target.value)}),y.jsx("input",{className:"panel-input",placeholder:"Directory label",value:K,onChange:k=>z(k.target.value)}),y.jsx("button",{onClick:lye,className:"solid-action w-full justify-center",children:"Add directory"})]}):null,y.jsx("div",{className:"space-y-2",children:x.directories.map(k=>y.jsx("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] px-3 py-3",style:ke.directoryId===k.directoryId?Ex:void 0,children:y.jsxs("div",{className:"flex items-start gap-3",children:[y.jsxs("button",{onClick:()=>Le(T=>({...T,directoryId:k.directoryId})),className:"text-left flex-1 min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.label}),y.jsx("div",{className:"text-[11px] text-gray-400 truncate mt-1",children:k.path})]}),!k.isBuiltIn&&i.workflowStorageMode!=="scope"?y.jsx("button",{onClick:()=>void cye(k.directoryId),title:"Remove directory.",className:"p-2 rounded-full text-gray-400 hover:text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})}):null]})},k.directoryId))})]}),y.jsxs("div",{className:"min-h-0 flex flex-col",children:[y.jsx("div",{className:"p-5 border-b border-[#E6E3DE] bg-white/70",children:y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y.jsxs("div",{className:"search-field max-w-[420px] flex-1 min-w-[260px]",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search workflows",value:M,onChange:k=>A(k.target.value)})]}),y.jsxs("div",{className:"workflow-toolbar-actions",children:[y.jsxs("div",{className:"inline-flex items-center gap-2 rounded-[18px] border border-[#E5E1DA] bg-white px-2 py-2 shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsx("button",{type:"button",onClick:()=>P("grid"),"data-tooltip":"Show workflows in a grid.",className:"panel-icon-button",style:W==="grid"?YD:void 0,children:y.jsx(tRe,{size:15})}),y.jsx("button",{type:"button",onClick:()=>P("list"),"data-tooltip":"Show workflows in a list.",className:"panel-icon-button",style:W==="list"?YD:void 0,children:y.jsx(zfe,{size:15})})]}),y.jsxs("button",{onClick:iye,className:"ghost-action",children:[y.jsx(kT,{size:14})," Import"]}),y.jsxs("button",{onClick:()=>{var k;return G0e(((k=x.directories[0])==null?void 0:k.directoryId)||ke.directoryId)},className:"solid-action",title:"Create workflow",children:[y.jsx(Sp,{size:16})," New workflow"]})]})]})}),y.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:qQ.length===0?y.jsx("div",{className:"max-w-[420px]",children:y.jsx(ob,{icon:y.jsx(Wf,{size:18,className:"text-gray-300"}),title:"No workflows",copy:"Create a workflow with the New workflow button above."})}):y.jsx("div",{className:W==="grid"?"grid gap-4 md:grid-cols-2 xl:grid-cols-3":"space-y-3 max-w-[1080px]",children:qQ.map(k=>y.jsx("button",{onClick:()=>void Z0e(k.workflowId),className:`w-full text-left rounded-[24px] border border-[#EEEAE4] bg-white transition-colors hover:bg-[#FAF8F4] ${W==="grid"?"px-5 py-5":"px-5 py-4"}`,style:k.workflowId===ke.workflowId?Ex:void 0,children:y.jsxs("div",{className:`flex gap-4 ${W==="grid"?"items-start":"items-center"}`,children:[y.jsx("div",{className:"w-12 h-12 rounded-[16px] flex items-center justify-center bg-[#F3F0EA] text-gray-400",style:k.workflowId===ke.workflowId?YD:void 0,children:y.jsx(Wf,{size:18})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"text-[15px] font-semibold text-gray-800 truncate",children:k.name}),W==="grid"?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"text-[12px] text-gray-400 mt-1 truncate",children:k.directoryLabel}),y.jsxs("div",{className:"text-[12px] text-gray-400 truncate",children:[k.stepCount," steps · ",Sb(k.updatedAtUtc)]}),k.description?y.jsx("div",{className:"text-[12px] text-gray-500 mt-3 line-clamp-2",children:k.description}):null]}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-gray-400",children:[y.jsx("span",{className:"truncate",children:k.directoryLabel}),y.jsxs("span",{children:[k.stepCount," steps"]}),y.jsx("span",{children:Sb(k.updatedAtUtc)})]}),k.description?y.jsx("div",{className:"text-[12px] text-gray-500 mt-2 truncate",children:k.description}):null]})]}),W==="list"?y.jsx("div",{className:"hidden shrink-0 text-[11px] font-semibold uppercase tracking-[0.16em] text-gray-300 sm:block",children:"Open"}):null]})},k.workflowId))})})]})]})]}):a==="roles"?$ye():a==="connectors"?Uye():a==="scripts"?y.jsx(Gut,{appContext:{hostMode:i.hostMode,scopeId:i.scopeId,scopeResolved:i.scopeResolved,scriptStorageMode:i.scriptStorageMode,scriptsEnabled:i.scriptsEnabled,scriptContract:i.scriptContract},onFlash:gt}):a==="settings"?y.jsx("section",{className:"flex-1 min-h-0 bg-[#ECEAE6] p-6",children:y.jsxs("div",{className:"h-full min-h-0 overflow-hidden rounded-[38px] border border-[#E6E3DE] bg-white/96 shadow-[0_26px_64px_rgba(17,24,39,0.08)] grid grid-cols-[260px_minmax(0,1fr)]",children:[y.jsxs("aside",{className:"settings-sidebar",children:[y.jsxs("button",{onClick:K0e,className:"inline-flex items-center gap-2 text-[13px] text-gray-400 hover:text-gray-600",children:[y.jsx(UM,{size:16}),"Back to workspace"]}),y.jsxs("div",{className:"mt-8 space-y-2",children:[y.jsx(B6,{active:f==="runtime",icon:y.jsx(Cte,{size:16}),title:"Runtime",description:"Base URL and connectivity",onClick:()=>g("runtime")}),y.jsx(B6,{active:f==="llm",icon:y.jsx(iv,{size:16}),title:"LLM",description:"Providers from secrets.json",onClick:()=>g("llm")}),y.jsx(B6,{active:f==="appearance",icon:y.jsx(nRe,{size:16}),title:"Appearance",description:"Studio theme and accents",onClick:()=>g("appearance")})]})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto px-10 py-10",children:f==="runtime"?y.jsxs("div",{className:"max-w-[920px] space-y-8",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"Runtime"})]}),y.jsxs("div",{className:"settings-section-card space-y-5",children:[i.hostMode==="embedded"?y.jsx("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] px-4 py-3 text-[13px] text-gray-600",children:"Embedded mode runs against the in-memory local mainnet hosted by `aevatar app`."}):null,y.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_auto_auto] lg:items-end",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:i.hostMode==="embedded"?"Local mainnet URL":"Runtime base URL"}),y.jsx("input",{className:"panel-input mt-1",value:Y.runtimeBaseUrl,onChange:k=>{const T=k.target.value;te(Z=>({...Z,runtimeBaseUrl:T})),R_({status:"idle",message:""})},placeholder:GL,readOnly:i.hostMode==="embedded"})]}),y.jsx("button",{onClick:()=>{Lye()},className:"ghost-action justify-center",disabled:ph.status==="testing",children:ph.status==="testing"?"Testing...":i.hostMode==="embedded"?"Test local mainnet":"Test connection"}),y.jsx("button",{onClick:w8,className:"solid-action justify-center",disabled:i.hostMode==="embedded",children:i.hostMode==="embedded"?"Managed locally":"Save runtime"})]}),ph.status!=="idle"?y.jsxs("div",{className:`settings-status-card ${ph.status}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:ph.status==="success"?"Connection succeeded":ph.status==="testing"?"Testing runtime":"Connection failed"}),y.jsx($ft,{status:ph.status})]}),y.jsx("div",{className:"text-[12px] text-gray-500 mt-2 break-all",children:Y.runtimeBaseUrl}),y.jsx("div",{className:"text-[13px] text-gray-600 mt-3",children:ph.message})]}):null]})]}):f==="llm"?y.jsxs("div",{className:"space-y-8",children:[y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"LLM"})]}),y.jsx("button",{onClick:w8,className:"solid-action",children:"Save providers"})]}),y.jsxs("div",{className:"settings-section-card space-y-4",children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y.jsxs("div",{className:"text-[12px] text-gray-500 break-all",children:["Secrets · ",Y.secretsFilePath||"~/.aevatar/secrets.json"]}),y.jsxs("button",{onClick:()=>$Q(),className:"solid-action !px-3",children:[y.jsx(Sp,{size:14})," Add provider"]})]}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.jsxs("div",{className:"search-field flex-1 min-w-[260px]",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search providers",value:ce,onChange:k=>Ce(k.target.value)})]}),Y.providerTypes.filter(k=>k.recommended).slice(0,4).map(k=>y.jsx("button",{onClick:()=>$Q(k.id),className:"chip-button",children:k.displayName},k.id))]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]",children:[y.jsx("div",{className:"space-y-2 rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:QQ.length===0?y.jsx("div",{className:"empty-card",children:"No providers matched"}):QQ.map(k=>y.jsxs("button",{onClick:()=>je(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:xe===k.key?Ex:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.providerName}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",style:Y.defaultProviderName===k.providerName?{color:"var(--accent-text)"}:void 0,children:Y.defaultProviderName===k.providerName?"default":k.providerType})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:k.model||k.displayName})]},k.key))}),Jn?y.jsxs("div",{className:"space-y-3 rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-5",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[15px] font-semibold text-gray-800",children:Jn.providerName||"Provider"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:Jn.displayName})]}),y.jsx("button",{onClick:()=>kye(Jn.key),className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]}),y.jsx(Kn,{label:"Instance name",value:Jn.providerName,onChange:k=>{const T=Jn.providerName;kx(Jn.key,Z=>({...Z,providerName:k})),te(Z=>({...Z,defaultProviderName:Z.defaultProviderName===T?k:Z.defaultProviderName}))}}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider type"}),y.jsx("select",{className:"panel-input mt-1",value:Jn.providerType,onChange:k=>{const T=k.target.value;kx(Jn.key,Z=>{const ee=tp.get(Z.providerType),be=tp.get(T),Ke=!Z.endpoint||Z.endpoint===((ee==null?void 0:ee.defaultEndpoint)||""),it=!Z.model||Z.model===((ee==null?void 0:ee.defaultModel)||"");return{...Z,providerType:T,displayName:(be==null?void 0:be.displayName)||T,category:(be==null?void 0:be.category)||"configured",description:(be==null?void 0:be.description)||"",endpoint:Ke?(be==null?void 0:be.defaultEndpoint)||"":Z.endpoint,model:it?(be==null?void 0:be.defaultModel)||"":Z.model}})},children:Y.providerTypes.map(k=>y.jsx("option",{value:k.id,children:k.displayName},k.id))})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsx(Kn,{label:"Model",value:Jn.model,onChange:k=>kx(Jn.key,T=>({...T,model:k}))}),y.jsx(Kn,{label:"Endpoint",value:Jn.endpoint,onChange:k=>kx(Jn.key,T=>({...T,endpoint:k}))})]}),y.jsx(Cc,{label:"API key",value:Jn.apiKey,rows:4,onChange:k=>kx(Jn.key,T=>({...T,apiKey:k,apiKeyConfigured:!!k.trim()}))}),y.jsxs("label",{className:"inline-flex items-center gap-2 rounded-[14px] border border-[#E5E1DA] bg-white px-3 py-2 text-[12px] text-gray-600",style:Y.defaultProviderName===Jn.providerName?Wye:void 0,children:[y.jsx("input",{type:"checkbox",checked:Y.defaultProviderName===Jn.providerName,onChange:k=>te(T=>({...T,defaultProviderName:k.target.checked?Jn.providerName:""}))}),"Use as default"]})]}):y.jsx(ob,{icon:y.jsx(iv,{size:18,className:"text-gray-300"}),title:"No provider selected",copy:"Add a provider or choose one from the list."})]})]})]}):y.jsxs("div",{className:"max-w-[920px] space-y-8",children:[y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"Appearance"})]}),y.jsx("button",{onClick:w8,className:"solid-action",children:"Save appearance"})]}),y.jsxs("div",{className:"settings-section-card space-y-5",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"section-heading",children:"Mode"}),y.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[y.jsx("button",{type:"button",onClick:()=>te(k=>({...k,colorMode:"light"})),className:`appearance-card ${Y.colorMode==="light"?"active":""}`,"data-tooltip":"Use the brighter studio surface.",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"settings-mode-icon",children:y.jsx(Lte,{size:16})}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Light"})})]})}),y.jsx("button",{type:"button",onClick:()=>te(k=>({...k,colorMode:"dark"})),className:`appearance-card ${Y.colorMode==="dark"?"active":""}`,"data-tooltip":"Use the darker studio surface.",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"settings-mode-icon",children:y.jsx(Ste,{size:16})}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Dark"})})]})})]})]}),y.jsx("div",{className:"appearance-grid",children:vft.map(k=>y.jsxs("button",{onClick:()=>te(T=>({...T,appearanceTheme:k.id})),"data-tooltip":k.description,className:`appearance-card ${Y.appearanceTheme===k.id?"active":""}`,children:[y.jsx("div",{className:"appearance-swatches",children:k.swatches.map(T=>y.jsx("span",{className:"appearance-swatch",style:{background:T}},T))}),y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:k.label})]},k.id))})]})]})})]})}):y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"studio-editor-header",children:y.jsxs("div",{className:"studio-editor-toolbar",children:[y.jsx("div",{className:"studio-view-switch",children:["editor","execution"].map(k=>y.jsx("button",{onClick:()=>u(k),"data-tooltip":k==="editor"?"Edit the current workflow.":"Inspect past runs and logs.",className:`studio-view-switch-button ${h===k?"active":""}`,children:k==="editor"?"Edit":"Runs"},k))}),y.jsxs("div",{className:"studio-title-bar",children:[y.jsxs("div",{className:"studio-title-group",children:[y.jsx("input",{className:"studio-title-input",value:ke.name,onChange:k=>{Le(T=>({...T,name:k.target.value})),Jr()},placeholder:"draft","aria-label":"Workflow title"}),y.jsx(Uft,{title:"Description",align:"left",buttonTooltip:"Edit the workflow description.",buttonClassName:"header-help-button",cardClassName:"header-help-card header-description-card",hideTitle:!0,content:y.jsx("textarea",{rows:5,className:"panel-textarea description-editor",value:ke.description,placeholder:"Workflow description",onChange:k=>{Le(T=>({...T,description:k.target.value})),Jr()}})})]}),y.jsxs("div",{className:"studio-header-actions",children:[y.jsx("button",{onClick:FQ,"data-tooltip":"Save","aria-label":"Save",className:"panel-icon-button header-toolbar-action header-save-action",children:y.jsx(Op,{size:15})}),y.jsx("button",{onClick:tye,"data-tooltip":"Export","aria-label":"Export",className:"panel-icon-button header-toolbar-action header-export-action",children:y.jsx(kT,{size:15})}),y.jsx("button",{onClick:oye,"data-tooltip":"Run","aria-label":"Run",className:"panel-icon-button header-toolbar-action header-run-action",children:y.jsx(s0,{size:15})}),h==="execution"&&DQ?y.jsx("button",{onClick:()=>void aye(),"data-tooltip":"Stop","aria-label":"Stop",disabled:Qg,className:"panel-icon-button header-toolbar-action",children:y.jsx(aRe,{size:15})}):null]})]})]})}),y.jsxs("section",{className:"flex-1 min-h-0 relative overflow-hidden bg-[#F2F1EE]",children:[y.jsxs("div",{className:"canvas-overlay-stack",children:[y.jsxs("div",{className:"canvas-meta-card",children:[y.jsx("div",{className:"canvas-meta-label",children:(C8==null?void 0:C8.label)||"No directory"}),y.jsxs("div",{className:"canvas-meta-value",children:[dt.length," nodes · ",tt.length," edges"]})]}),h==="execution"?y.jsxs("div",{className:"canvas-meta-card canvas-meta-card-wide",children:[y.jsx("div",{className:"canvas-meta-label",children:"Run"}),y.jsxs("select",{className:"canvas-meta-select",value:Ee||"",onChange:k=>{k.target.value&&KD(k.target.value)},children:[y.jsx("option",{value:"",children:tJ}),od.map(k=>y.jsxs("option",{value:k.executionId,children:[Sb(k.startedAtUtc)," · ",k.status]},k.executionId))]})]}):null]}),y.jsx("div",{className:"canvas-overlay-tools",children:h==="editor"?y.jsxs(y.Fragment,{children:[y.jsx(Rce,{active:b&&p==="roles",label:"Roles",icon:y.jsx(kL,{size:16}),onClick:()=>xx("roles")}),y.jsx(Rce,{active:b&&p==="yaml",label:"YAML",icon:y.jsx(kte,{size:16}),onClick:()=>xx("yaml")})]}):null}),In?y.jsxs("div",{className:"palette-drawer absolute right-5 top-20 z-30 w-[360px] max-h-[calc(100%-180px)] overflow-hidden rounded-[28px] border border-[#E8E2D9] shadow-[0_26px_64px_rgba(17,24,39,0.16)]",children:[y.jsxs("div",{className:"palette-drawer-header px-5 py-4 border-b border-[#F1ECE5] flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Canvas"}),y.jsx("div",{className:"panel-title",children:"Add node"})]}),y.jsx("button",{onClick:()=>Nn(!1),title:"Close node picker.",className:"panel-icon-button",children:y.jsx(nv,{size:14})})]}),y.jsx("div",{className:"palette-drawer-search p-4 border-b border-[#F1ECE5]",children:y.jsxs("div",{className:"search-field",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search primitives or connectors",value:Os,onChange:k=>Da(k.target.value)})]})}),y.jsxs("div",{className:"palette-drawer-body overflow-y-auto max-h-[620px]",children:[Oye.map(k=>{const T=R0e[k.key]||YE,Z=Mo===k.label;return y.jsxs("div",{className:"border-b border-[#F1ECE5] last:border-b-0",children:[y.jsxs("button",{onClick:()=>_l(Z?"":k.label),className:"w-full px-4 py-3 flex items-center gap-3 hover:bg-[#FAF8F4] transition-colors text-left",children:[y.jsx("div",{className:"w-8 h-8 rounded-[12px] flex items-center justify-center",style:{background:`${k.color}18`},children:y.jsx(T,{size:15,color:k.color})}),y.jsx("span",{className:"text-[13px] font-medium text-gray-800 flex-1",children:k.label}),y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${Z?"rotate-180":""}`})]}),Z?y.jsx("div",{className:"px-4 pb-3 grid gap-2",children:k.items.map(ee=>y.jsxs("button",{onClick:()=>UQ(ee),className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 text-left hover:bg-[#FAF8F4]",children:[y.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:ee}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:k.label})]},ee))}):null]},k.key)}),KQ.length>0?y.jsxs("div",{className:"border-b border-[#F1ECE5] last:border-b-0",children:[y.jsxs("button",{onClick:()=>_l(Mo==="Configured connectors"?"":"Configured connectors"),className:"w-full px-4 py-3 flex items-center gap-3 hover:bg-[#FAF8F4] transition-colors text-left",children:[y.jsx("div",{className:"w-8 h-8 rounded-[12px] flex items-center justify-center",style:{background:"#64748b18"},children:y.jsx(wR,{size:15,color:"#64748b"})}),y.jsx("span",{className:"text-[13px] font-medium text-gray-800 flex-1",children:"Configured connectors"}),y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${Mo==="Configured connectors"?"rotate-180":""}`})]}),Mo==="Configured connectors"?y.jsx("div",{className:"px-4 pb-3 grid gap-2",children:KQ.map(k=>y.jsx("button",{onClick:()=>UQ("connector_call",k.name),className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 text-left hover:bg-[#FAF8F4]",children:y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("span",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.type})]})},k.key))}):null]}):null]})]}):null,go.open?y.jsx("div",{className:"fixed z-40 rounded-[18px] border border-[#E8E2D9] bg-white shadow-[0_22px_46px_rgba(17,24,39,0.16)]",style:{left:go.x,top:go.y},children:y.jsx("button",{onClick:()=>{Nn(!0),ei({open:!1,x:0,y:0})},className:"px-4 py-3 text-[13px] font-medium text-gray-700 hover:bg-[#FAF8F4] rounded-[18px]",children:"Add node"})}):null,h==="editor"?y.jsxs("div",{className:"absolute bottom-6 right-5 z-30 flex items-end gap-3",children:[Jw?y.jsxs("div",{className:"ask-ai-surface w-[380px] rounded-[28px] border border-[#E8E2D9] p-4 shadow-[0_26px_64px_rgba(17,24,39,0.16)]",onClick:k=>k.stopPropagation(),children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Canvas"}),y.jsx("div",{className:"panel-title",children:"Ask AI"})]}),y.jsx("button",{onClick:()=>eC(!1),title:"Close Ask AI.",className:"panel-icon-button",children:y.jsx(nv,{size:14})})]}),y.jsx("p",{className:"mt-3 text-[12px] leading-6 text-gray-500",children:"Describe the workflow. AI reasoning streams here and the validated YAML stays in this panel until you apply it."}),y.jsx("textarea",{rows:5,className:"panel-textarea mt-4",placeholder:"Build a workflow that triages incidents, routes risky cases to human approval, and posts the result to Slack.",value:D_,onChange:k=>T_(k.target.value)}),y.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[11px] text-gray-400",children:nC?"Generating and validating YAML...":yl?"Validated YAML is ready to apply.":"Return format: workflow YAML only"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{onClick:()=>{yl.trim()&&m8(yl).then(k=>{k&>("Workflow YAML copied","success")})},className:"ghost-action !px-3",disabled:!yl.trim(),children:[y.jsx(CR,{size:14})," Copy"]}),y.jsxs("button",{onClick:()=>{yl.trim()&&nye(yl).then(()=>gt("AI workflow applied to canvas","success"),k=>gt((k==null?void 0:k.message)||"Failed to apply workflow YAML","error"))},className:"ghost-action !px-3",disabled:!yl.trim(),children:[y.jsx(Op,{size:14})," Apply"]}),y.jsxs("button",{onClick:()=>{sye()},className:"ghost-action !px-3",disabled:nC,children:[y.jsx(iv,{size:14})," ",nC?"Thinking":"Generate"]})]})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Thinking"}),y.jsx("pre",{className:"mt-2 max-h-[140px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-600",children:sd||"LLM reasoning will stream here."})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"YAML"}),y.jsx("div",{className:"text-[10px] uppercase tracking-[0.16em] text-gray-400",children:yl?"Ready to apply":"Waiting for valid YAML"})]}),y.jsx("pre",{className:"mt-2 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:tC||"Validated workflow YAML will appear here."})]})]}):null,y.jsx("button",{onClick:k=>{k.stopPropagation(),eC(T=>!T)},title:"Ask AI to generate workflow YAML.",className:"ask-ai-trigger flex h-14 w-14 items-center justify-center rounded-[20px] border border-[color:var(--accent-border)] shadow-[0_24px_56px_rgba(17,24,39,0.18)] transition-transform hover:-translate-y-0.5",style:YD,children:y.jsx(iv,{size:20})})]}):null,y.jsxs(_2e,{nodes:F_,edges:B_,nodeTypes:mft,minZoom:.14,maxZoom:1.6,defaultEdgeOptions:{type:"smoothstep",zIndex:4,style:{stroke:"#2F6FEC",strokeWidth:2.5},markerEnd:{type:U1.ArrowClosed,width:11,height:11,color:"#2F6FEC"}},connectionLineType:Nf.SmoothStep,connectionLineStyle:{stroke:"#2F6FEC",strokeWidth:2.5},onInit:k=>{M_.current=k},onNodesChange:h==="editor"?Eye:void 0,onEdgesChange:h==="editor"?Iye:void 0,onConnect:h==="editor"?Nye:void 0,onNodeClick:(k,T)=>{var Z;if(h==="execution"){const ee=typeof((Z=T.data)==null?void 0:Z.stepId)=="string"?T.data.stepId:"",be=aft(li,ee);be!==null&&Ir(be);return}Vt(T.id),m("node"),v(!0)},onPaneClick:()=>{h==="editor"&&Vt(null),ei({open:!1,x:0,y:0})},onPaneContextMenu:Dye,fitView:!0,fitViewOptions:{padding:.2,minZoom:.14,maxZoom:.92},nodesDraggable:h==="editor",nodesConnectable:h==="editor",elementsSelectable:!0,className:"studio-canvas",children:[y.jsx(y2e,{color:"#D8D2C8",variant:ig.Dots,gap:24,size:1}),y.jsx(z2e,{position:"bottom-left",zoomable:!0,pannable:!0,className:"studio-minimap",style:{width:164,height:108,marginLeft:16,marginBottom:88},maskColor:"rgba(255, 255, 255, 0.76)",bgColor:"rgba(248, 247, 244, 0.98)",nodeBorderRadius:8,nodeColor:k=>{var Z;const T=typeof((Z=k.data)==null?void 0:Z.stepType)=="string"?k.data.stepType:"";return D0e(T).color}}),y.jsx(N2e,{position:"bottom-left"})]}),h==="editor"?y.jsxs("aside",{className:`right-drawer ${b?"open":""}`,children:[y.jsxs("div",{className:"panel-header border-b border-[#F1ECE5]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Inspector"}),y.jsx("div",{className:"panel-title",children:p==="node"?"Node":p==="roles"?"Roles":"YAML"})]}),y.jsx("button",{onClick:()=>v(!1),title:"Close inspector.",className:"panel-icon-button",children:y.jsx(UM,{size:16})})]}),y.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:p==="node"?zt?y.jsxs("div",{className:"space-y-4",children:[y.jsx(Kn,{label:"Step ID",value:zt.data.stepId,onChange:k=>{np(T=>({...T,data:{...T.data,stepId:k,label:k}}))}}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Primitive"}),y.jsx("select",{className:"panel-input mt-1",value:zt.data.stepType,onChange:k=>{const T=k.target.value;np(Z=>{var be,Ke;const ee={...Jut(T),...Z.data.parameters};return T==="connector_call"&&!ee.connector&&((be=gn[0])!=null&&be.name)&&cM(ee,gn[0].name,gn),{...Z,data:{...Z.data,stepType:T,targetRole:yce(T)&&(Z.data.targetRole||((Ke=Ve[0])==null?void 0:Ke.id))||"",parameters:ee}}})},children:u4.map(k=>y.jsx("optgroup",{label:k.label,children:k.items.map(T=>y.jsx("option",{value:T,children:T},T))},k.key))})]}),yce(zt.data.stepType)?y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Target role"}),y.jsxs("select",{className:"panel-input mt-1",value:zt.data.targetRole,onChange:k=>{const T=k.target.value;np(Z=>({...Z,data:{...Z.data,targetRole:T}}))},children:[y.jsx("option",{value:"",children:"No role"}),Ve.map(k=>y.jsx("option",{value:k.id,children:k.id||k.name},k.key))]})]}):null,zt.data.stepType==="connector_call"?y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] p-3 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[12px] font-semibold text-gray-700",children:"Connector"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:"Use a configured connector"})]}),y.jsx("button",{onClick:()=>{W_("connectors")},className:"accent-inline-link text-[11px] font-medium",children:"Open"})]}),y.jsxs("select",{className:"panel-input",value:String(zt.data.parameters.connector||""),onChange:k=>{const T=k.target.value;np(Z=>{const ee={...Z.data.parameters};return cM(ee,T,gn),{...Z,data:{...Z.data,parameters:ee}}})},children:[y.jsx("option",{value:"",children:"Select connector"}),gn.map(k=>y.jsxs("option",{value:k.name,children:[k.name," · ",k.type]},k.key))]})]}):null,y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center justify-between mb-2",children:[y.jsx("label",{className:"field-label",children:"Parameters"}),y.jsx("button",{onClick:()=>{np(k=>{const T=Object.keys(k.data.parameters||{});let Z=1,ee=`param_${Z}`;for(;T.includes(ee);)Z+=1,ee=`param_${Z}`;return{...k,data:{...k.data,parameters:{...k.data.parameters,[ee]:""}}}})},className:"accent-inline-link text-[11px] font-medium",children:"Add"})]}),y.jsx("div",{className:"space-y-2",children:Object.entries(zt.data.parameters||{}).length===0?y.jsx("div",{className:"empty-card",children:"No parameters"}):Object.entries(zt.data.parameters||{}).map(([k,T])=>y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white p-3 space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("input",{className:"panel-input flex-1",value:k,onChange:Z=>{const ee=Z.target.value;np(be=>{if(!ee||ee===k)return be;const Ke={...be.data.parameters},it=Ke[k];return delete Ke[k],Ke[ee]=it,{...be,data:{...be.data,parameters:Ke}}})}}),y.jsx("button",{onClick:()=>{np(Z=>{const ee={...Z.data.parameters};return delete ee[k],{...Z,data:{...Z.data,parameters:ee}}})},title:"Remove parameter.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]}),y.jsx("textarea",{rows:String(T).includes(` -`)?4:2,className:"panel-textarea",value:mQ(T),onChange:Z=>{const ee=nft(Z.target.value);np(be=>({...be,data:{...be.data,parameters:{...be.data.parameters,[k]:ee}}}))}})]},k))})]}),y.jsxs("div",{children:[y.jsx("div",{className:"field-label mb-2",children:"Connections"}),y.jsx("div",{className:"space-y-2",children:JQ.length===0?y.jsx("div",{className:"empty-card",children:"No outgoing connections"}):JQ.map(k=>{var Z;const T=dt.find(ee=>ee.id===k.target);return y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[12px] font-medium text-gray-800",children:((Z=k.data)==null?void 0:Z.branchLabel)||"next"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:(T==null?void 0:T.data.stepId)||k.target})]}),y.jsx("button",{onClick:()=>{Tt(ee=>ee.filter(be=>be.id!==k.id)),Jr()},title:"Remove connection.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]},k.id)})})]}),y.jsx("button",{onClick:()=>Tye(zt.id),className:"w-full rounded-[18px] border border-red-200 bg-white px-3 py-3 text-[12px] font-medium text-red-500 hover:bg-red-50",children:"Remove node"})]}):y.jsx(ob,{icon:y.jsx(Vfe,{size:18,className:"text-gray-300"}),title:"No node selected",copy:"Select a node on the canvas."}):p==="roles"?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("div",{children:y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Roles"})}),y.jsx("button",{onClick:Mye,"data-tooltip":"Add a role to this workflow.",className:"ghost-action !px-3",children:"Add"})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(cb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search saved roles",value:gi,onChange:k=>Ra(k.target.value)})]}),y.jsxs("div",{className:"rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] p-4 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Saved roles"})}),y.jsx("button",{onClick:()=>{W_("roles")},className:"accent-inline-link text-[11px] font-medium",children:"Open catalog"})]}),ZQ.length===0?y.jsx("div",{className:"empty-card",children:"No saved roles matched"}):y.jsx("div",{className:"space-y-2 max-h-[220px] overflow-y-auto",children:ZQ.map(k=>y.jsx("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3",children:y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||k.id||"Role"}),y.jsxs("div",{className:"text-[11px] text-gray-400 truncate",children:[k.id||"role",k.provider?` · ${k.provider}`:"",k.model?` · ${k.model}`:""]})]}),y.jsx("button",{onClick:()=>jQ(k.key),className:"ghost-action !min-h-[34px] !px-3",children:"Use"})]})},k.key))})]}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsx("div",{children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Workflow roles"})})}),XQ.length===0?y.jsx("div",{className:"empty-card",children:"No workflow roles matched"}):XQ.map(k=>y.jsxs("div",{className:"rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] overflow-hidden",children:[y.jsxs("button",{onClick:()=>id(T=>T===k.key?null:k.key),className:"w-full px-4 py-3 flex items-center justify-between gap-3 text-left bg-white/80 hover:bg-white",children:[y.jsx("div",{className:"min-w-0",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.id||"role_id"})}),y.jsx("div",{className:"flex items-center",children:y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${er===k.key?"rotate-180":""}`})})]}),er===k.key?y.jsxs("div",{className:"p-4 space-y-3 border-t border-[#EEEAE4]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:k.name||k.id||"Role"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:()=>Sye(k.key),"data-tooltip":"Save this workflow role to the global role catalog.",className:"ghost-action !min-h-[34px] !px-3",children:"Save preset"}),y.jsx("button",{onClick:()=>Aye(k.key),title:"Remove role.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsx(Kn,{label:"Role ID",value:k.id,onChange:T=>{const Z=k.id,ee=k.name||T;ct(be=>be.map(Ke=>Ke.key===k.key?{...Ke,id:T,name:Ke.name||ee}:Ke)),Be(be=>be.map(Ke=>Ke.data.targetRole===Z?{...Ke,data:{...Ke.data,targetRole:T}}:Ke)),Jr()}}),y.jsx(Kn,{label:"Role name",value:k.name,onChange:T=>{GD(k.key,Z=>({...Z,name:T}))}})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:k.provider,onChange:T=>{const Z=T.target.value,ee=Y.providers.find(be=>be.providerName===Z);GD(k.key,be=>({...be,provider:Z,model:(ee==null?void 0:ee.model)||be.model}))},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(T=>y.jsx("option",{value:T.providerName,children:T.providerName},T.key))]})]}),y.jsx(Kn,{label:"Model",value:k.model,onChange:T=>{GD(k.key,Z=>({...Z,model:T}))}})]}),y.jsx(Cc,{label:"System prompt",value:k.systemPrompt,rows:5,onChange:T=>{GD(k.key,Z=>({...Z,systemPrompt:T}))}}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Allowed connectors"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:gn.length===0?y.jsx("div",{className:"text-[12px] text-gray-400",children:"No connectors configured"}):gn.map(T=>{const Z=Ll(k.connectorsText).includes(T.name);return y.jsx("button",{onClick:()=>Pye(k.key,T.name),className:`chip-button ${Z?"chip-button-active":""}`,children:T.name},T.key)})})]})]}):null]},k.key))]}):y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"YAML"}),y.jsx("div",{className:"text-[12px] text-gray-400",children:"Edit YAML to update the canvas"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{onClick:eye,className:"ghost-action !px-3",children:[y.jsx(ZE,{size:14})," Validate"]}),y.jsxs("button",{onClick:Rye,className:"ghost-action !px-3",children:[y.jsx(CR,{size:14})," Copy"]})]})]}),y.jsx("textarea",{className:"panel-textarea !min-h-[280px] !bg-[#FAF8F4]",value:ke.yaml,onChange:k=>J0e(k.target.value),spellCheck:!1}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Findings"}),ke.findings.length===0?y.jsx("div",{className:"empty-card",children:"No findings"}):ke.findings.map((k,T)=>y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3",children:[y.jsx("div",{className:`text-[12px] font-semibold ${tR(k.level)==="error"?"text-red-500":"text-amber-500"}`,children:k.message}),y.jsxs("div",{className:"text-[11px] text-gray-400 mt-1",children:[k.path||"/",k.code?` · ${k.code}`:""]})]},`${k.path||"root"}-${T}`))]}),eJ.length>0?y.jsxs("div",{className:"rounded-[18px] border border-red-200 bg-red-50 px-3 py-3 text-[12px] text-red-600 flex items-start gap-2",children:[y.jsx(Z2e,{size:15,className:"mt-0.5 shrink-0"}),y.jsxs("span",{children:[eJ.length," errors still need fixing before execution."]})]}):null]})})]}):null]}),h==="execution"?iJ():null]})}),y.jsx(W6,{open:wx,title:"Run",onClose:()=>Cl(!1),actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>Cl(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{onClick:()=>{rye()},className:"solid-action",children:[y.jsx(s0,{size:14})," Run"]})]}),children:y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"Optional input will be passed into the workflow as `$input`."}),y.jsx("textarea",{rows:6,className:"panel-textarea run-prompt-textarea",value:I_,placeholder:"What should this run do?",onChange:k=>vx(k.target.value)})]})}),y.jsx(W6,{open:Xr,title:"Add Connector",onClose:()=>{WQ()},actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>{WQ()},className:"ghost-action",children:"Close"}),y.jsxs("button",{onClick:()=>{pye()},className:"solid-action",children:[y.jsx(Sp,{size:14})," Add connector"]})]}),children:tn?y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"Close this dialog at any time and the latest text will be kept as a draft."}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Type"}),y.jsxs("select",{className:"panel-input mt-1",value:tn.type,onChange:k=>us(T=>T&&{...T,type:k.target.value}),children:[y.jsx("option",{value:"http",children:"HTTP"}),y.jsx("option",{value:"cli",children:"CLI"}),y.jsx("option",{value:"mcp",children:"MCP"})]})]}),y.jsx(Kn,{label:"Name",value:tn.name,onChange:k=>us(T=>T&&{...T,name:k})}),tn.type==="http"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(Kn,{label:"Base URL",value:tn.http.baseUrl,onChange:k=>us(T=>T&&{...T,http:{...T.http,baseUrl:k}})}),y.jsx(Cc,{label:"Allowed methods",rows:3,value:tn.http.allowedMethods.join(` -`),onChange:k=>us(T=>T&&{...T,http:{...T.http,allowedMethods:Ll(k).map(Z=>Z.toUpperCase())}})}),y.jsx(Cc,{label:"Allowed paths",rows:3,value:tn.http.allowedPaths.join(` -`),onChange:k=>us(T=>T&&{...T,http:{...T.http,allowedPaths:Ll(k)}})})]}):null,tn.type==="cli"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(Kn,{label:"Command",value:tn.cli.command,onChange:k=>us(T=>T&&{...T,cli:{...T.cli,command:k}})}),y.jsx(Cc,{label:"Fixed arguments",rows:3,value:tn.cli.fixedArguments.join(` -`),onChange:k=>us(T=>T&&{...T,cli:{...T.cli,fixedArguments:Ll(k)}})})]}):null,tn.type==="mcp"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(Kn,{label:"Server name",value:tn.mcp.serverName,onChange:k=>us(T=>T&&{...T,mcp:{...T.mcp,serverName:k}})}),y.jsx(Kn,{label:"Command",value:tn.mcp.command,onChange:k=>us(T=>T&&{...T,mcp:{...T.mcp,command:k}})}),y.jsx(Cc,{label:"Arguments",rows:3,value:tn.mcp.arguments.join(` -`),onChange:k=>us(T=>T&&{...T,mcp:{...T.mcp,arguments:Ll(k)}})})]}):null]}):null}),y.jsx(W6,{open:Hn,title:mo==="workflow"?"Add Workflow Role":"Add Role",onClose:()=>{zQ()},actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>{zQ()},className:"ghost-action",children:"Close"}),y.jsxs("button",{onClick:()=>{Cye()},className:"solid-action",children:[y.jsx(Sp,{size:14})," ",mo==="workflow"?"Add to workflow":"Add role"]})]}),children:Tn?y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"The latest unfinished role draft is stored automatically when you close this dialog."}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(Kn,{label:"Role ID",value:Tn.id,onChange:k=>Er(T=>T&&{...T,id:k})}),y.jsx(Kn,{label:"Role name",value:Tn.name,onChange:k=>Er(T=>T&&{...T,name:k})})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:Tn.provider,onChange:k=>{const T=k.target.value,Z=Y.providers.find(ee=>ee.providerName===T);Er(ee=>ee&&{...ee,provider:T,model:(Z==null?void 0:Z.model)||ee.model})},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(k=>y.jsx("option",{value:k.providerName,children:k.providerName},k.key))]})]}),y.jsx(Kn,{label:"Model",value:Tn.model,onChange:k=>Er(T=>T&&{...T,model:k})})]}),y.jsx(Cc,{label:"System prompt",rows:6,value:Tn.systemPrompt,onChange:k=>Er(T=>T&&{...T,systemPrompt:k})}),y.jsx(Cc,{label:"Allowed connectors",rows:4,value:Tn.connectorsText,onChange:k=>Er(T=>T&&{...T,connectorsText:k})})]}):null}),sC?y.jsx("div",{className:`absolute bottom-5 left-1/2 -translate-x-1/2 px-4 py-2 rounded-[16px] shadow-[0_18px_36px_rgba(17,24,39,0.16)] text-[13px] font-medium z-50 ${sC.type==="success"?"bg-green-500 text-white":sC.type==="error"?"bg-red-500 text-white":"bg-gray-900 text-white"}`,children:sC.text}):null]})}function zft(){return y.jsx("div",{className:"min-h-screen bg-[#F2F1EE] text-gray-800 px-6 py-8",children:y.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-[960px] items-center justify-center",children:y.jsxs("div",{className:"w-full max-w-[460px] rounded-[32px] border border-[#E6E3DE] bg-white/96 p-8 shadow-[0_28px_70px_rgba(15,23,42,0.08)]",children:[y.jsx("div",{className:"panel-eyebrow",children:"Aevatar App"}),y.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[y.jsx(P0e,{size:48,className:"shrink-0 rounded-[18px]"}),y.jsxs("div",{children:[y.jsx("div",{className:"text-[24px] font-semibold text-gray-900",children:"Preparing studio"}),y.jsx("div",{className:"text-[13px] text-gray-500",children:"Loading workspace context, catalogs, and runtime settings."})]})]})]})})})}function jft(n){return y.jsx("div",{className:"studio-shell min-h-screen bg-[#F2F1EE] px-6 py-8 text-gray-800","data-appearance":"blue","data-color-mode":"light",children:y.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-[1040px] items-center justify-center",children:y.jsxs("div",{className:"grid w-full max-w-[920px] gap-6 rounded-[36px] border border-[#E6E3DE] bg-white/96 p-6 shadow-[0_30px_72px_rgba(15,23,42,0.08)] md:grid-cols-[minmax(0,1.1fr)_320px] md:p-8",children:[y.jsxs("div",{className:"rounded-[28px] border border-[#ECE7DF] bg-[#FAF8F4] p-6 md:p-7",children:[y.jsx("div",{className:"panel-eyebrow",children:"Aevatar App"}),y.jsxs("div",{className:"mt-3 flex items-start gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-[20px] bg-white text-[var(--accent,#2563eb)] shadow-[0_12px_30px_rgba(37,99,235,0.08)]",children:y.jsx(ZE,{size:22})}),y.jsxs("div",{children:[y.jsx("div",{className:"text-[28px] font-semibold leading-tight text-gray-900",children:"Sign in to open Workflow Studio"}),y.jsxs("div",{className:"mt-3 max-w-[520px] text-[14px] leading-6 text-gray-500",children:["Studio content, workflow execution, and scope-backed assets are only available after ",n.providerDisplayName||"NyxID"," authentication succeeds."]})]})]}),y.jsxs("div",{className:"mt-6 rounded-[22px] border border-[#E8E2D9] bg-white px-5 py-4",children:[y.jsx("div",{className:"text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Access policy"}),y.jsx("div",{className:"mt-2 text-[14px] leading-6 text-gray-600",children:"When the app is not authenticated, the workflow canvas, execution panel, and runtime actions stay locked. Sign in first, then Studio will load normally."})]})]}),y.jsxs("div",{className:"flex flex-col justify-between rounded-[28px] border border-[#ECE7DF] bg-white p-6",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[13px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Authentication"}),y.jsx("div",{className:"mt-3 text-[22px] font-semibold text-gray-900",children:n.providerDisplayName||"NyxID"}),y.jsx("div",{className:"mt-2 text-[14px] leading-6 text-gray-500",children:"Use your existing identity session to continue into the app."}),n.errorMessage?y.jsx("div",{className:"mt-4 rounded-[18px] border border-amber-200 bg-amber-50 px-4 py-3 text-[13px] leading-5 text-amber-800",children:n.errorMessage}):null]}),y.jsxs("div",{className:"mt-6 space-y-3",children:[y.jsxs("a",{href:n.loginUrl||"/auth/login",className:"solid-action w-full justify-center !no-underline",title:`Sign in with ${n.providerDisplayName||"NyxID"}.`,children:[y.jsx(ZE,{size:14})," Sign in"]}),y.jsx("div",{className:"text-[12px] leading-5 text-gray-400",children:"After sign-in completes, the app will return to Studio automatically."})]})]})]})})})}function sb(n){return y.jsx("button",{onClick:n.onClick,title:n.label,className:`rail-button ${n.active?"active":""}`,children:n.icon})}function B6(n){return y.jsxs("button",{onClick:n.onClick,title:n.description,className:`settings-nav-button ${n.active?"active":""}`,children:[y.jsx("div",{className:"settings-nav-icon",children:n.icon}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:n.title})})]})}function $ft(n){const e=n.status==="success"?"Reachable":n.status==="testing"?"Testing":n.status==="error"?"Unreachable":"Idle";return y.jsx("span",{className:`settings-status-pill ${n.status}`,children:e})}function Uft(n){const[e,t]=$.useState(!1),i=$.useRef(null);return $.useEffect(()=>{if(!e)return;const s=o=>{var a;const r=o.target;(!(r instanceof globalThis.Node)||!((a=i.current)!=null&&a.contains(r)))&&t(!1)};return document.addEventListener("pointerdown",s),()=>{document.removeEventListener("pointerdown",s)}},[e]),y.jsxs("div",{ref:i,className:"info-popover",children:[y.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),t(o=>!o)},className:`info-popover-button ${e?"active":""} ${n.buttonClassName||""}`,title:n.buttonTooltip||n.title,children:y.jsx(X2e,{size:14})}),e?y.jsxs("div",{className:`info-popover-card ${n.align==="left"?"left-0":"right-0"} ${n.cardClassName||""}`,onClick:s=>s.stopPropagation(),children:[n.hideTitle?null:y.jsx("div",{className:"info-popover-title",children:n.title}),y.jsx("div",{className:n.hideTitle?"":"mt-2",children:n.content})]}):null]})}function W6(n){return n.open?y.jsx("div",{className:"modal-overlay",onClick:n.onClose,children:y.jsxs("div",{className:"modal-shell",onClick:e=>e.stopPropagation(),children:[y.jsxs("div",{className:"modal-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:n.title})]}),y.jsx("button",{onClick:n.onClose,title:"Close dialog.",className:"panel-icon-button",children:y.jsx(nv,{size:16})})]}),y.jsx("div",{className:"modal-body",children:n.children}),y.jsx("div",{className:"modal-footer",children:n.actions})]})}):null}function Rce(n){return y.jsx("button",{onClick:n.onClick,title:n.label,className:`drawer-icon-button ${n.active?"active":""}`,children:n.icon})}function Kn(n){return y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:n.label}),y.jsx("input",{className:"panel-input mt-1",value:n.value,onChange:e=>n.onChange(e.target.value)})]})}function Cc(n){return y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:n.label}),y.jsx("textarea",{rows:n.rows??4,className:"panel-textarea mt-1",value:n.value,onChange:e=>n.onChange(e.target.value)})]})}function ob(n){return y.jsxs("div",{className:"h-full rounded-[22px] border border-dashed border-[#E6E0D6] bg-[#FAF8F4] px-5 py-8 text-center flex flex-col items-center justify-center",children:[y.jsx("div",{className:"w-12 h-12 rounded-[16px] bg-white flex items-center justify-center shadow-[0_10px_20px_rgba(17,24,39,0.05)]",children:n.icon}),y.jsx("div",{className:"text-[14px] font-semibold text-gray-700 mt-3",children:n.title}),y.jsx("p",{className:"text-[12px] text-gray-400 mt-1",children:n.copy})]})}H6.createRoot(document.getElementById("root")).render(y.jsx(hm.StrictMode,{children:y.jsx(Vft,{})}));const qft={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},Kft={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},Gft=Object.freeze(Object.defineProperty({__proto__:null,conf:qft,language:Kft},Symbol.toStringTag,{value:"Module"})); +`):""}function Mft(){return{runtimeBaseUrl:GL,appearanceTheme:"blue",colorMode:"light",secretsFilePath:"",defaultProviderName:"",providerTypes:[],providers:[]}}function Aft(n,e,t){const i=e.find(s=>s.id===n)||e[0]||{id:n,displayName:n,category:"configured",description:"",defaultEndpoint:"",defaultModel:""};return{key:`provider_${crypto.randomUUID()}`,providerName:Oft(i.id,t),providerType:i.id,displayName:i.displayName,category:i.category,description:i.description,endpoint:i.defaultEndpoint,model:i.defaultModel,apiKey:"",apiKeyConfigured:!1}}function Pft(n,e){const t=e.find(i=>i.id===(n==null?void 0:n.providerType))||null;return{key:`provider_${crypto.randomUUID()}`,providerName:(n==null?void 0:n.providerName)||"",providerType:(n==null?void 0:n.providerType)||(t==null?void 0:t.id)||"openai",displayName:(n==null?void 0:n.displayName)||(t==null?void 0:t.displayName)||(n==null?void 0:n.providerType)||"Provider",category:(n==null?void 0:n.category)||(t==null?void 0:t.category)||"configured",description:(n==null?void 0:n.description)||(t==null?void 0:t.description)||"",endpoint:(n==null?void 0:n.endpoint)||(t==null?void 0:t.defaultEndpoint)||"",model:(n==null?void 0:n.model)||(t==null?void 0:t.defaultModel)||"",apiKey:(n==null?void 0:n.apiKey)||"",apiKeyConfigured:!!(n!=null&&n.apiKeyConfigured)}}function Oft(n,e){const t=(n||"provider").replace(/[^a-z0-9]+/gi,"-").toLowerCase(),i=new Set(e.map(r=>r.providerName.trim().toLowerCase()));let s=1,o=`${t}-main`;for(;i.has(o);)s+=1,o=`${t}-${s}`;return o}function kce(n,e="role"){const t=(e||"role").replace(/[^a-z0-9_]+/gi,"_").toLowerCase()||"role",i=new Set(n.map(r=>r.id.trim().toLowerCase()).filter(Boolean));let s=1,o=t;for(;i.has(o);)s+=1,o=`${t}_${s}`;return o}function O6(n,e){const t=e.trim().toLowerCase();return t?[n.id,n.name,n.systemPrompt,n.provider,n.model,n.connectorsText].join(" ").toLowerCase().includes(t):!0}function Fft(){return Nm(1,{id:"",name:"",systemPrompt:"",provider:"",model:"",connectorsText:""})}function Ice(n){if(!n)return!1;const e=Object.entries(n.http.defaultHeaders||{}).some(([s,o])=>s.trim()||String(o||"").trim()),t=Object.entries(n.cli.environment||{}).some(([s,o])=>s.trim()||String(o||"").trim()),i=Object.entries(n.mcp.environment||{}).some(([s,o])=>s.trim()||String(o||"").trim());return!!(n.name.trim()||n.http.baseUrl.trim()||n.http.allowedMethods.some(s=>s.trim()&&s.trim().toUpperCase()!=="POST")||n.http.allowedPaths.some(s=>s.trim()&&s.trim()!=="/")||n.http.allowedInputKeys.some(s=>s.trim())||e||n.cli.command.trim()||n.cli.fixedArguments.some(s=>s.trim())||n.cli.allowedOperations.some(s=>s.trim())||n.cli.allowedInputKeys.some(s=>s.trim())||n.cli.workingDirectory.trim()||t||n.mcp.serverName.trim()||n.mcp.command.trim()||n.mcp.arguments.some(s=>s.trim())||n.mcp.defaultTool.trim()||n.mcp.allowedTools.some(s=>s.trim())||n.mcp.allowedInputKeys.some(s=>s.trim())||i)}function Bft(n){var i,s,o;const e=n.defaultProviderName||((i=n.providers[0])==null?void 0:i.providerName)||"",t=((s=n.providers.find(r=>r.providerName===e))==null?void 0:s.model)||((o=n.providers[0])==null?void 0:o.model)||"";return Nm(1,{id:"",name:"",systemPrompt:"",provider:e,model:t,connectorsText:""})}function Ece(n){return n?!!(n.id.trim()||n.name.trim()||n.systemPrompt.trim()||n.provider.trim()||n.model.trim()||n.connectorsText.trim()):!1}function Wft(){var iJ;const n=$.useMemo(()=>Cft(),[]),e=n.isPopout,t=n.executionId,[i,s]=$.useState(bft()),[o,r]=$.useState(Ift()),[a,l]=$.useState(()=>xft()),[c,d]=$.useState(()=>Lft()),[h,u]=$.useState("editor"),[f,g]=$.useState("runtime"),[p,m]=$.useState("node"),[b,v]=$.useState(!1),[w,C]=$.useState(!1),[S,L]=$.useState(!1),[x,I]=$.useState({runtimeBaseUrl:GL,directories:[]}),[E,R]=$.useState([]),[M,A]=$.useState(""),[W,P]=$.useState("grid"),[B,V]=$.useState(""),[K,z]=$.useState(""),[j,X]=$.useState(!1),[Y,te]=$.useState(Mft()),[ce,Ce]=$.useState(""),[xe,Be]=$.useState(null),[Ee,Le]=$.useState(A6()),[ze,Ct]=$.useState(Cb()),[ct,Ue]=$.useState([]),[tt,_t]=$.useState([]),[yi,Pt]=$.useState(null),[Cn,Xn]=$.useState(!1),[Ks,kr]=$.useState(""),[Ir,fc]=$.useState("AI"),[Er,Ta]=$.useState({x:420,y:220}),[po,gn]=$.useState({open:!1,x:0,y:0}),[yn,tn]=$.useState([]),[Ra,gc]=$.useState({homeDirectory:"",filePath:"",fileExists:!1}),[_l,id]=$.useState({filePath:"",fileExists:!1,updatedAtUtc:""}),[Os,Jr]=$.useState(""),[er,pc]=$.useState(null),[Mi,Dn]=$.useState(null),[ks,Nr]=$.useState(!1),[nd,Dr]=$.useState(!1),[fs,Bn]=$.useState([]),[Sn,mc]=$.useState({homeDirectory:"",filePath:"",fileExists:!1}),[Q,hh]=$.useState({filePath:"",fileExists:!1,updatedAtUtc:""}),[uh,Ki]=$.useState(""),[tr,it]=$.useState(""),[ir,zt]=$.useState(null),[li,Ro]=$.useState(null),[Qn,Mo]=$.useState(null),[Jn,Yg]=$.useState("catalog"),[_c,sd]=$.useState(!1),[fh,Hu]=$.useState(!1),[Qe,re]=$.useState([]),[ke,dt]=$.useState(null),[Et,$n]=$.useState(null),[ci,Un]=$.useState(null),[Gs,Ao]=$.useState(null),[Vu,es]=$.useState(null),[od,gh]=$.useState(!1),[Yw,_x]=$.useState(""),[bx,bl]=$.useState(!1),[I_,Zg]=$.useState(""),[ph,E_]=$.useState(""),[Xg,Zw]=$.useState(!1),[Xw,Qw]=$.useState(!1),[N_,mh]=$.useState(""),[vx,D_]=$.useState(""),[Jw,UD]=$.useState(""),[bc,wx]=$.useState(""),[zu,qD]=$.useState(!1),[rd,Qg]=$.useState({status:"idle",message:""}),[T_,Cx]=$.useState(null),R_=$.useRef(null),_h=$.useRef(!0),M_=$.useRef(0),Jg=$.useRef(null),ep=$.useRef(0),yx=$.useRef(0),ju=$.useRef(null),$u=$.useRef(null),ue=$.useRef(null),pe=$.useRef(null),Oe=$.useRef(null),We=$.useRef(null),Mt=$.useRef(null),at=$.useRef(()=>{}),jt=ct.find(k=>k.id===yi)||null,St=$.useMemo(()=>Eft(i.scopeId),[i.scopeId]),kt=yn.find(k=>k.key===er)||null,Tn=fs.find(k=>k.key===ir)||null,A_=Ra.filePath.startsWith("chrono-storage://"),P_=Sn.filePath.startsWith("chrono-storage://"),ts=Y.providers.find(k=>k.key===xe)||null,tp=$.useMemo(()=>new Map(Y.providerTypes.map(k=>[k.id,k])),[Y.providerTypes]),ad=Qe.filter(k=>{const T=Lce(Ee.name);return!T||Lce(k.workflowName)===T}),O_=h==="execution"?nft(ct,ci,Gs):ct,F_=h==="execution"?sft(tt,ct,ci,Gs):tt,vc=ci&&Number.isInteger(Gs)&&ci.logs[Gs]||null,mi=vc!=null&&vc.interaction&&(Et==null?void 0:Et.status)==="waiting"&&vc.stepId&&((iJ=ci==null?void 0:ci.stepStates.get(vc.stepId))==null?void 0:iJ.status)==="waiting"?vc.interaction:null,ip=ke&&mi?`${ke}:${mi.stepId}`:"",NQ=!!ke&&((Et==null?void 0:Et.status)==="running"||(Et==null?void 0:Et.status)==="waiting");$.useEffect(()=>{M0e()},[]),$.useEffect(()=>lRe(k=>{bl(!1),r(T=>({...T,loading:!1,enabled:!0,authenticated:!1,loginUrl:(k==null?void 0:k.loginUrl)||T.loginUrl||"/auth/login",errorMessage:(k==null?void 0:k.message)||"Sign in to continue."}))}),[]),$.useEffect(()=>()=>{$u.current&&window.clearTimeout($u.current)},[]),$.useEffect(()=>()=>{pe.current&&window.clearInterval(pe.current)},[]),$.useEffect(()=>{at.current=()=>{OQ()}}),$.useEffect(()=>{if(Zg(""),!mi)return;const k=window.requestAnimationFrame(()=>{var T,Z;(T=ue.current)==null||T.focus(),(Z=ue.current)==null||Z.select()});return()=>window.cancelAnimationFrame(k)},[mi==null?void 0:mi.kind,mi==null?void 0:mi.runId,mi==null?void 0:mi.stepId]),$.useEffect(()=>{if(a!=="studio")return;const k=T=>{T.altKey||T.shiftKey||!(T.metaKey||T.ctrlKey)||T.key.toLowerCase()!=="s"||(T.preventDefault(),at.current())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[a]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(N0e,a)}catch{}},[a]),$.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(D0e,c)}catch{}},[c]),$.useEffect(()=>{!o.loading&&(!o.enabled||o.authenticated)&&a==="scripts"&&!i.scriptsEnabled&&l("studio")},[o.authenticated,o.enabled,o.loading,i.scriptsEnabled,a]),$.useEffect(()=>{const k=(ee,be=!1)=>{const Ke=ee.replace(/\s+/g," ").replace(/[.!?]+$/g,"").trim();if(!Ke)return"";if(be)return Ke;const nt=Ke.toLowerCase();if(nt.startsWith("sign out"))return"Sign out";if(nt.startsWith("sign in"))return"Sign in";if(nt.startsWith("zoom in"))return"Zoom in";if(nt.startsWith("zoom out"))return"Zoom out";if(nt.startsWith("fit view"))return"Fit view";const Yt=Ke.split(" ").filter(Boolean);return Yt.length<=2?Yt.join(" "):["close","save","run","export","import","copy","validate","open","edit"].includes(Yt[0].toLowerCase())?Yt[0]:Yt.slice(0,2).join(" ")},T=()=>{document.querySelectorAll("button, a.ghost-action, a.solid-action, a.panel-icon-button").forEach(ee=>{var Ys,ld,tC,W_;const be=((Ys=ee.textContent)==null?void 0:Ys.replace(/\s+/g," ").trim())||"",Ke=((ld=ee.getAttribute("aria-label"))==null?void 0:ld.trim())||"",nt=((tC=ee.getAttribute("title"))==null?void 0:tC.trim())||"",Yt=((W_=ee.getAttribute("data-tooltip"))==null?void 0:W_.trim())||"",nn=k(Yt||Ke||nt||be,!!(Yt||Ke||nt));!nn||ee.getAttribute("title")===nn||ee.setAttribute("title",nn)})};T();const Z=new MutationObserver(()=>{window.requestAnimationFrame(T)});return Z.observe(document.body,{subtree:!0,childList:!0,characterData:!0}),()=>Z.disconnect()},[]),$.useEffect(()=>()=>{ju.current&&window.clearTimeout(ju.current),Jg.current&&window.clearTimeout(Jg.current)},[]),$.useEffect(()=>{if(!(Ee.name||ct.length>0||ze.length>0))return;if(_h.current){_h.current=!1;return}const T=window.setTimeout(()=>{K0e()},280);return()=>{window.clearTimeout(T)}},[Ee.name,Ee.description,ze,ct,tt,E]),$.useEffect(()=>{li&&!ze.some(k=>k.key===li)&&Ro(null)},[ze,li]),$.useEffect(()=>{Zg(""),E_("")},[ke,Gs]),$.useEffect(()=>{if(e){document.title=ke?`Execution Logs · ${(Et==null?void 0:Et.workflowName)||"Aevatar App"}`:"Execution Logs · Aevatar App";return}document.title="Aevatar App"},[Et==null?void 0:Et.workflowName,e,ke]),$.useEffect(()=>{!e||o.loading||o.enabled&&!o.authenticated||!t||ke===t||GD(t)},[o.authenticated,o.enabled,o.loading,t,e,ke]),$.useEffect(()=>{if(!(e||!S))return pe.current=window.setInterval(()=>{const k=Oe.current;k&&!k.closed||(Oe.current=null,L(!1),C(!1),pe.current&&(window.clearInterval(pe.current),pe.current=null))},500),()=>{pe.current&&(window.clearInterval(pe.current),pe.current=null)}},[e,S]),$.useEffect(()=>{if(e||!ke)return;const k=Oe.current;if(!(!k||k.closed))try{k.location.replace(xce(ke))}catch{}},[e,ke]),$.useEffect(()=>{const k=(Et==null?void 0:Et.status)==="running"||(Et==null?void 0:Et.status)==="waiting";if(!ke||!k)return;let T=!1,Z=0;const ee=async()=>{try{const be=await V_.get(ke);if(T)return;Lx(be),((be==null?void 0:be.status)==="running"||(be==null?void 0:be.status)==="waiting")&&(Z=window.setTimeout(()=>{ee()},700))}catch{if(T)return;Z=window.setTimeout(()=>{ee()},1200)}};return Z=window.setTimeout(()=>{ee()},350),()=>{T=!0,window.clearTimeout(Z)}},[Et==null?void 0:Et.status,ke]);async function M0e(){var k;try{const T=await cRe.getSession(),Z={loading:!1,enabled:(T==null?void 0:T.enabled)!==!1,authenticated:!!(T!=null&&T.authenticated),providerDisplayName:(T==null?void 0:T.providerDisplayName)||"NyxID",loginUrl:(T==null?void 0:T.loginUrl)||"/auth/login",logoutUrl:(T==null?void 0:T.logoutUrl)||"/auth/logout",name:(T==null?void 0:T.name)||"",email:(T==null?void 0:T.email)||"",picture:(T==null?void 0:T.picture)||"",errorMessage:(T==null?void 0:T.errorMessage)||""};if(r(Z),Z.enabled&&!Z.authenticated)return;const[ee,be,Ke,nt,Yt,nn,Ys,ld,tC]=await Promise.allSettled([wl.getContext(),lp.getSettings(),lp.listWorkflows(),sC.getCatalog(),sC.getDraft(),oC.getCatalog(),oC.getDraft(),V_.list(),ET.get()]),W_=[{label:"app context",result:ee},{label:"workspace settings",result:be},{label:"workflow list",result:Ke},{label:"connectors catalog",result:nt},{label:"connector draft",result:Yt},{label:"roles catalog",result:nn},{label:"role draft",result:Ys},{label:"execution list",result:ld},{label:"studio settings",result:tC}].flatMap(ta=>ta.result.status==="rejected"?[{label:ta.label,error:ta.result.reason}]:[]),y8=W_.find(ta=>Sce(ta.error));if(y8){r(ta=>{var rJ,aJ;return{...ta,loading:!1,enabled:!0,authenticated:!1,loginUrl:((rJ=y8.error)==null?void 0:rJ.loginUrl)||ta.loginUrl||"/auth/login",errorMessage:((aJ=y8.error)==null?void 0:aJ.message)||"Sign in to continue."}});return}W_.forEach(ta=>{console.warn(`[Aevatar App] Failed to load bootstrap resource: ${ta.label}`,ta.error)});const cd=ee.status==="fulfilled"?ee.value:null,H_=be.status==="fulfilled"?be.value:null,nJ=Ke.status==="fulfilled"?Ke.value:[],zye=nt.status==="fulfilled"?nt.value:null,jye=Yt.status==="fulfilled"?Yt.value:null,$ye=nn.status==="fulfilled"?nn.value:null,Uye=Ys.status==="fulfilled"?Ys.value:null,sJ=ld.status==="fulfilled"?ld.value:[],JD=tC.status==="fulfilled"?tC.value:null,qye=(cd==null?void 0:cd.workflowStorageMode)==="scope"?"scope":"workspace",eT=cd!=null&&cd.scopeResolved&&(cd!=null&&cd.scopeId)?cd.scopeId:null,oJ=qye==="scope"&&eT?[{directoryId:`scope:${eT}`,label:eT,path:`scope://${eT}`,isBuiltIn:!0}]:Array.isArray(H_==null?void 0:H_.directories)?H_.directories:[],Kye=(JD==null?void 0:JD.runtimeBaseUrl)||(H_==null?void 0:H_.runtimeBaseUrl)||GL;s(vft(cd)),I({runtimeBaseUrl:Kye,directories:oJ}),R(Array.isArray(nJ)?nJ:[]),DQ(JD),u8(zye),g8(jye),f8($ye),p8(Uye),re(Array.isArray(sJ)?sJ:[]);const Gye=((k=oJ[0])==null?void 0:k.directoryId)||null;Le(ta=>({...ta,directoryId:Gye})),W_.length>0&>(wft(W_.map(ta=>ta.label)),"info")}catch(T){if(Sce(T)){r(Z=>({...Z,loading:!1,enabled:!0,authenticated:!1,loginUrl:(T==null?void 0:T.loginUrl)||Z.loginUrl||"/auth/login",errorMessage:(T==null?void 0:T.message)||"Sign in to continue."}));return}r(Z=>({...Z,loading:!1,errorMessage:Z.errorMessage||(T==null?void 0:T.message)||"Failed to load app session."})),gt((T==null?void 0:T.message)||"Failed to load studio","error")}}function DQ(k){var ee;const T=Array.isArray(k==null?void 0:k.providerTypes)?k.providerTypes.map(be=>({id:be.id,displayName:be.displayName,category:be.category,description:be.description,recommended:!!be.recommended,defaultEndpoint:be.defaultEndpoint||"",defaultModel:be.defaultModel||""})):[],Z=Array.isArray(k==null?void 0:k.providers)?k.providers.map(be=>Pft(be,T)):[];te({runtimeBaseUrl:(k==null?void 0:k.runtimeBaseUrl)||GL,appearanceTheme:(k==null?void 0:k.appearanceTheme)||"blue",colorMode:(k==null?void 0:k.colorMode)==="dark"?"dark":"light",secretsFilePath:(k==null?void 0:k.secretsFilePath)||"",defaultProviderName:(k==null?void 0:k.defaultProviderName)||"",providerTypes:T,providers:Z}),Be(((ee=Z[0])==null?void 0:ee.key)||null),Qg({status:"idle",message:""})}function u8(k){var Z;const T=Array.isArray(k==null?void 0:k.connectors)?k.connectors.map(ee=>_ce(ee)):[];gc({homeDirectory:(k==null?void 0:k.homeDirectory)||"",filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists)}),tn(T),pc(((Z=T[0])==null?void 0:Z.key)||null)}function f8(k){var Z;const T=Array.isArray(k==null?void 0:k.roles)?k.roles.map((ee,be)=>pce(ee,be+1)):[];mc({homeDirectory:(k==null?void 0:k.homeDirectory)||"",filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists)}),Bn(T),zt(((Z=T[0])==null?void 0:Z.key)||null)}function g8(k){id({filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists),updatedAtUtc:(k==null?void 0:k.updatedAtUtc)||""}),Dn(k!=null&&k.draft?_ce(k.draft):null)}function p8(k){hh({filePath:(k==null?void 0:k.filePath)||"",fileExists:!!(k!=null&&k.fileExists),updatedAtUtc:(k==null?void 0:k.updatedAtUtc)||""}),Mo(k!=null&&k.draft?pce(k.draft,1):null)}function gt(k,T){Cx({text:k,type:T}),ju.current&&window.clearTimeout(ju.current),ju.current=window.setTimeout(()=>{Cx(null),ju.current=null},2600)}function TQ(k,T){$u.current&&window.clearTimeout($u.current),es(k==="single"?T??null:null),gh(k==="all"),$u.current=window.setTimeout(()=>{es(null),gh(!1),$u.current=null},1600)}async function m8(k){var T;if(!k.trim())return gt("Nothing to copy","info"),!1;if(!((T=navigator.clipboard)!=null&&T.writeText))return gt("Clipboard is unavailable in this browser context","error"),!1;try{return await navigator.clipboard.writeText(k),!0}catch(Z){return gt((Z==null?void 0:Z.message)||"Failed to copy to clipboard","error"),!1}}async function A0e(k,T){Ao(T),await m8(R0e(k))&&TQ("single",T)}async function P0e(){await m8(Rft(ci))&&(TQ("all"),gt("Execution logs copied","success"))}function O0e(){const k=Oe.current;return!k||k.closed?(Oe.current=null,L(!1),C(!1),!1):(k.focus(),!0)}function F0e(){var nt,Yt;if(!ke){gt("Pick a run first","info");return}const k=xce(ke),T=Oe.current;if(T&&!T.closed){T.location.replace(k),T.focus(),L(!0),C(!0);return}const Z=Math.max(((nt=window.screen)==null?void 0:nt.availWidth)||window.innerWidth||1440,1280),ee=Math.max(((Yt=window.screen)==null?void 0:Yt.availHeight)||window.innerHeight||960,720),be=["popup=yes",`width=${Z}`,`height=${ee}`,"left=0","top=0","resizable=yes","scrollbars=yes"].join(","),Ke=window.open(k,"aevatar-execution-logs",be);if(!Ke){gt("Allow pop-ups to open execution logs in a new window","error");return}Oe.current=Ke;try{Ke.moveTo(0,0),Ke.resizeTo(Z,ee)}catch{}Ke.focus(),L(!0),C(!0)}function B0e(){if(S){O0e();return}C(k=>!k)}function W0e(k){if(!(k!=null&&k.executionId))return;const T=kft(k);re(Z=>{const ee=Z.findIndex(be=>be.executionId===T.executionId);return ee<0?[T,...Z]:Z.map((be,Ke)=>Ke===ee?{...be,...T}:be)})}function Sx(){M_.current+=1}function H0e(k,T){var Z;if(T){const ee=k.find(be=>be.data.stepId===T);if(ee)return ee.id}return((Z=k[0])==null?void 0:Z.id)||null}function ea(){Le(k=>k.dirty?k:{...k,dirty:!0})}function RQ(){l("workflows"),v(!1),Xn(!1),gn({open:!1,x:0,y:0})}function V0e(){l("studio"),Xn(!1),gn({open:!1,x:0,y:0})}function z0e(){l("scripts"),v(!1),Xn(!1),gn({open:!1,x:0,y:0})}function B_(k){l(k),v(!1),Xn(!1),gn({open:!1,x:0,y:0})}function MQ(k="runtime"){a!=="settings"&&d(a),l("settings"),g(k),v(!1),Xn(!1),gn({open:!1,x:0,y:0})}function j0e(){l(c)}function xx(k){if(b&&p===k){v(!1);return}m(k),v(!0)}function $0e(k){var T;_h.current=!0,Sx(),Ct(Cb()),Ue([]),_t([]),Pt(null),dt(null),$n(null),Un(null),Ao(null),Le({...A6(),directoryId:k??((T=x.directories[0])==null?void 0:T.directoryId)??null,dirty:!0}),l("studio"),u("editor"),m("node"),v(!1),KD()}function KD(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{var k;(k=R_.current)==null||k.fitView({padding:.22,minZoom:.14,maxZoom:.92,duration:220})})})}async function _8(){const k=await lp.listWorkflows();R(Array.isArray(k)?k:[])}async function U0e(k){const T=await V_.list(),Z=Array.isArray(T)?T:[];re(Z);const ee=k?Z.find(be=>be.executionId===k):null;ee!=null&&ee.executionId&&await GD(ee.executionId)}async function AQ(){var ee,be,Ke;const[k,T]=await Promise.all([wl.getContext(),lp.getSettings()]);s({hostMode:(k==null?void 0:k.mode)==="proxy"?"proxy":"embedded",scopeId:k!=null&&k.scopeResolved&&(k!=null&&k.scopeId)?k.scopeId:null,scopeResolved:!!(k!=null&&k.scopeResolved&&(k!=null&&k.scopeId)),scopeSource:(k==null?void 0:k.scopeSource)||"",workflowStorageMode:(k==null?void 0:k.workflowStorageMode)==="scope"?"scope":"workspace",scriptStorageMode:(k==null?void 0:k.scriptStorageMode)==="scope"?"scope":"draft",scriptsEnabled:!!((ee=k==null?void 0:k.features)!=null&&ee.scripts),scriptContract:{inputType:((be=k==null?void 0:k.scriptContract)==null?void 0:be.inputType)||"",readModelFields:Array.isArray((Ke=k==null?void 0:k.scriptContract)==null?void 0:Ke.readModelFields)?k.scriptContract.readModelFields:[]}});const Z={runtimeBaseUrl:x.runtimeBaseUrl,directories:Array.isArray(T==null?void 0:T.directories)?T.directories:[]};I(Z),Le(nt=>{var Yt;return{...nt,directoryId:nt.directoryId||((Yt=Z.directories[0])==null?void 0:Yt.directoryId)||null}})}function PQ(k){var Z,ee,be,Ke,nt,Yt,nn,Ys;const T=tR((k==null?void 0:k.document)||k,k==null?void 0:k.layout,Cb());_h.current=!0,Sx(),Ct(T.roles),Ue(T.nodes),_t(T.edges),Pt(((Z=T.nodes[0])==null?void 0:Z.id)||null),dt(null),bl(!1),Le({workflowId:(k==null?void 0:k.workflowId)||null,directoryId:(k==null?void 0:k.directoryId)||((ee=x.directories[0])==null?void 0:ee.directoryId)||null,fileName:(k==null?void 0:k.fileName)||"",filePath:(k==null?void 0:k.filePath)||"",name:(k==null?void 0:k.name)||((be=k==null?void 0:k.document)==null?void 0:be.name)||((Ke=k==null?void 0:k.rootWorkflow)==null?void 0:Ke.name)||"draft",description:((nt=k==null?void 0:k.document)==null?void 0:nt.description)||((Yt=k==null?void 0:k.rootWorkflow)==null?void 0:Yt.description)||"",closedWorldMode:!!((Ys=(nn=k==null?void 0:k.document)==null?void 0:nn.configuration)!=null&&Ys.closedWorldMode),yaml:(k==null?void 0:k.yaml)||"",findings:Array.isArray(k==null?void 0:k.findings)?k.findings:[],dirty:!1,lastSavedAt:(k==null?void 0:k.updatedAtUtc)||null}),u("editor"),KD()}async function q0e(k){try{const T=await lp.getWorkflow(k);PQ(T),l("studio"),v(!1)}catch(T){gt((T==null?void 0:T.message)||"Failed to open workflow","error")}}async function K0e(){const k=++M_.current;try{const T=P6(Ee,ze,ct,tt),Z=await ap.serializeYaml(T,E.map(ee=>ee.name));if(k!==M_.current)return;Le(ee=>({...ee,yaml:(Z==null?void 0:Z.yaml)||"",findings:Array.isArray(Z==null?void 0:Z.findings)?Z.findings:[]}))}catch(T){if(k!==M_.current)return;Le(Z=>({...Z,findings:[{level:2,message:(T==null?void 0:T.message)||"Failed to sync YAML.",path:"/"}]}))}}async function G0e(k,T){try{const Z=await ap.parseYaml(k,E.map(be=>be.name)),ee=Array.isArray(Z==null?void 0:Z.findings)?Z.findings:[];if(!(Z!=null&&Z.document)){T===ep.current&&Le(be=>({...be,findings:ee.length>0?ee:[{level:2,message:"YAML parse returned an empty document.",path:"/"}]}));return}if(T>yx.current){const be=(jt==null?void 0:jt.data.stepId)||null,Ke=tR(Z.document,wce(Ee,ct),Cb());yx.current=T,_h.current=!0,Sx(),Ct(Ke.roles),Ue(Ke.nodes),_t(Ke.edges),Pt(H0e(Ke.nodes,be)),Le(nt=>{var Yt,nn,Ys,ld;return{...nt,name:((Yt=Z.document)==null?void 0:Yt.name)||nt.name||"draft",description:((nn=Z.document)==null?void 0:nn.description)||"",closedWorldMode:!!((ld=(Ys=Z.document)==null?void 0:Ys.configuration)!=null&&ld.closedWorldMode),findings:T===ep.current?ee:nt.findings,dirty:!0,lastSavedAt:null}});return}T===ep.current&&Le(be=>({...be,findings:ee}))}catch(Z){if(T!==ep.current)return;Le(ee=>({...ee,findings:Array.isArray(Z==null?void 0:Z.findings)&&Z.findings.length>0?Z.findings:[{level:2,message:(Z==null?void 0:Z.message)||"Failed to parse YAML.",path:"/"}]}))}}function Y0e(k){const T=++ep.current;Jg.current&&window.clearTimeout(Jg.current),Le(Z=>({...Z,yaml:k,dirty:!0,lastSavedAt:null})),Jg.current=window.setTimeout(()=>{G0e(k,T)},180)}async function b8(){const k=P6(Ee,ze,ct,tt),T=await ap.serializeYaml(k,E.map(Z=>Z.name));return Le(Z=>({...Z,yaml:(T==null?void 0:T.yaml)||"",findings:Array.isArray(T==null?void 0:T.findings)?T.findings:[]})),T}async function OQ(){var T;const k=Ee.directoryId||((T=x.directories[0])==null?void 0:T.directoryId);if(!k){gt("Add a workflow directory first","error"),RQ();return}try{const Z=await b8(),ee=await lp.saveWorkflow({workflowId:Ee.workflowId,directoryId:k,workflowName:Ee.name.trim()||"draft",fileName:Ee.fileName||null,yaml:(Z==null?void 0:Z.yaml)||Ee.yaml,layout:wce(Ee,ct)});PQ(ee),await _8(),gt("Workflow saved","success")}catch(Z){gt((Z==null?void 0:Z.message)||"Save failed","error")}}async function Z0e(){try{const k=await ap.parseYaml(Ee.yaml||"",E.map(be=>be.name)),T=Array.isArray(k==null?void 0:k.findings)?k.findings:[];if(!(k!=null&&k.document)){Le(be=>({...be,findings:T.length>0?T:[{level:2,message:"YAML parse returned an empty document.",path:"/"}]})),xx("yaml"),gt("Fix YAML errors before validating","error");return}const Z=await ap.validate(k.document,E.map(be=>be.name));Le(be=>({...be,findings:Array.isArray(Z==null?void 0:Z.findings)?Z.findings:T}));const ee=((Z==null?void 0:Z.findings)||[]).filter(be=>iR(be.level)==="error").length;ee>0&&xx("yaml"),gt(ee>0?`${ee} validation errors`:"Validation passed",ee>0?"error":"success")}catch(k){gt((k==null?void 0:k.message)||"Validation failed","error")}}async function X0e(){try{const k=Ee.yaml?{yaml:Ee.yaml}:await b8(),T=new Blob([(k==null?void 0:k.yaml)||""],{type:"text/yaml"}),Z=URL.createObjectURL(T),ee=document.createElement("a");ee.href=Z,ee.download=`${Ee.name||"workflow"}.yaml`,ee.click(),URL.revokeObjectURL(Z),gt("YAML exported","success")}catch(k){gt((k==null?void 0:k.message)||"Export failed","error")}}function Q0e(){const k=document.createElement("input");k.type="file",k.accept=".yaml,.yml",k.onchange=async T=>{var be,Ke,nt,Yt;const Z=(be=T.target.files)==null?void 0:be[0];if(!Z)return;const ee=await Z.text();try{const nn=await ap.parseYaml(ee,E.map(ld=>ld.name));if(!(nn!=null&&nn.document))throw new Error("YAML parse returned an empty document.");const Ys=tR(nn.document,null,Cb());_h.current=!0,Sx(),Ct(Ys.roles),Ue(Ys.nodes),_t(Ys.edges),Pt(((Ke=Ys.nodes[0])==null?void 0:Ke.id)||null),Le({...A6(),directoryId:Ee.directoryId||((nt=x.directories[0])==null?void 0:nt.directoryId)||null,name:nn.document.name||Z.name.replace(/\.ya?ml$/i,""),description:nn.document.description||"",closedWorldMode:!!((Yt=nn.document.configuration)!=null&&Yt.closedWorldMode),yaml:ee,findings:Array.isArray(nn.findings)?nn.findings:[],dirty:!0,lastSavedAt:null}),l("studio"),u("editor"),gt("YAML imported","success")}catch(nn){gt((nn==null?void 0:nn.message)||"Import failed","error")}},k.click()}async function J0e(k){var ee;const T=await ap.parseYaml(k,E.map(be=>be.name));if(!(T!=null&&T.document))throw new Error("AI did not return a valid workflow YAML.");const Z=tR(T.document,null,Cb());_h.current=!0,Sx(),Ct(Z.roles),Ue(Z.nodes),_t(Z.edges),Pt(((ee=Z.nodes[0])==null?void 0:ee.id)||null),dt(null),$n(null),Un(null),Ao(null),bl(!1),Le(be=>{var Ke,nt,Yt,nn,Ys;return{...be,directoryId:be.directoryId||((Ke=x.directories[0])==null?void 0:Ke.directoryId)||null,name:((nt=T.document)==null?void 0:nt.name)||be.name||"draft",description:((Yt=T.document)==null?void 0:Yt.description)||"",closedWorldMode:!!((Ys=(nn=T.document)==null?void 0:nn.configuration)!=null&&Ys.closedWorldMode),yaml:k,findings:Array.isArray(T.findings)?T.findings:[],dirty:!0,lastSavedAt:null}}),l("studio"),u("editor"),KD()}async function eye(){if(!N_.trim()){gt("Describe the workflow you want to generate","error");return}qD(!0),D_(""),UD(""),wx("");try{const T=ct.length>0||tt.length>0||!!Ee.yaml.trim()?await ap.serializeYaml(P6(Ee,ze,ct,tt),E.map(Ke=>Ke.name)):null,Z=(T==null?void 0:T.yaml)||Ee.yaml||"",ee=await Hfe.authorWorkflow({prompt:N_.trim(),currentYaml:Z,availableWorkflowNames:E.map(Ke=>Ke.name),metadata:St},{onText:Ke=>D_(Ke),onReasoning:Ke=>UD(Ke)}),be=String(ee||"").trim();if(!be)throw new Error("AI did not return workflow YAML.");D_(be),wx(be),gt("AI workflow YAML is ready to apply","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to generate workflow YAML","error")}finally{qD(!1)}}function tye(){bl(!0)}async function iye(){try{if(o.enabled&&!o.authenticated){bl(!1),gt("Sign in before running workflows","error");return}const k=await b8();if(((k==null?void 0:k.findings)||[]).filter(be=>iR(be.level)==="error").length>0){bl(!1),xx("yaml"),u("editor"),gt("Fix YAML errors before running","error");return}const Z=i.workflowStorageMode==="scope"&&!!i.scopeId&&!!Ee.workflowId&&!Ee.dirty,ee=await V_.start({workflowName:Ee.name.trim()||"draft",prompt:Yw.trim(),workflowYamls:[(k==null?void 0:k.yaml)||Ee.yaml],runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null,scopeId:Z?i.scopeId:null,workflowId:Z?Ee.workflowId:null,eventFormat:Z?"workflow":null});bl(!1),u("execution"),C(!1),L(!1),Lx(ee),U0e((ee==null?void 0:ee.executionId)||null),gt(Z?"Published workflow run started":"Execution started","success")}catch(k){gt((k==null?void 0:k.message)||"Execution failed","error")}}function Lx(k){const T=ift(k);dt((k==null?void 0:k.executionId)||null),$n(k),Un(T),Ao((T==null?void 0:T.defaultLogIndex)??null),W0e(k),KD()}async function GD(k){try{const T=await V_.get(k);Lx(T),u("execution"),S||C(!1)}catch(T){gt((T==null?void 0:T.message)||"Failed to load execution","error")}}async function v8(k,T){if(!ke)return;const Z=I_.trim();if(k.kind==="human_input"&&!Z){gt("Input is required for this step","error");return}const ee=`${ke}:${k.stepId}:${T}`;E_(ee);try{const be=await V_.resume(ke,{runId:k.runId,stepId:k.stepId,approved:k.kind==="human_input"?!0:T==="approve",userInput:Z||null,suspensionType:k.kind});Lx(be),Zg(""),u("execution"),C(!1),gt(k.kind==="human_approval"?T==="approve"?"Approval sent":"Rejection sent":"Input submitted","success")}catch(be){gt((be==null?void 0:be.message)||"Failed to resume execution","error")}finally{E_("")}}async function nye(){if(!(!ke||!NQ)){Zw(!0);try{const k=await V_.stop(ke,{reason:"user requested stop"});Lx(k),gt("Stop requested","info")}catch(k){gt((k==null?void 0:k.message)||"Failed to stop execution","error")}finally{Zw(!1)}}}async function sye(){if(i.workflowStorageMode==="scope"){gt("Workflow storage is bound to the current scope.","info");return}if(!B.trim()){gt("Directory path required","error");return}try{await lp.addDirectory({path:B.trim(),label:K.trim()||null}),V(""),z(""),X(!1),await AQ(),await _8(),gt("Directory added","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to add directory","error")}}async function oye(k){if(i.workflowStorageMode==="scope"){gt("Workflow storage is bound to the current scope.","info");return}try{await lp.removeDirectory(k),await AQ(),await _8(),gt("Directory removed","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to remove directory","error")}}async function rye(){try{const k=await sC.saveCatalog({connectors:yn.map(bce)});u8(k),gt("Connectors saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save connectors","error")}}function aye(){var k;(k=We.current)==null||k.click()}async function lye(k){var Z;const T=(Z=k.target.files)==null?void 0:Z[0];if(k.target.value="",!!T)try{Dr(!0);const ee=await sC.importCatalog(T);u8(ee),gt(`Imported ${(ee==null?void 0:ee.importedCount)??0} connectors from ${(ee==null?void 0:ee.sourceFilePath)||T.name}`,"success")}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to import connector catalog","error")}finally{Dr(!1)}}async function FQ(){await sC.deleteDraft(),g8(null)}async function cye(k){if(!Ice(k)){await FQ();return}const T=await sC.saveDraft({draft:bce(k)});g8(T)}function dye(k="http"){Dn(T=>T||Gut(k,"")),Nr(!0)}async function BQ(){const k=Mi;Nr(!1);try{await cye(k),Ice(k)&>("Connector draft saved","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to save connector draft","error")}}async function hye(){if(!Mi)return;const k=Mi.type||"http",T=Mi.name.trim()||Yut(yn,k),Z={...Mi,key:`connector_${crypto.randomUUID()}`,name:T,type:k};tn(ee=>[Z,...ee]),pc(Z.key),B_("connectors"),Dn(null),Nr(!1);try{await FQ()}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to clear connector draft","error")}gt(`Connector ${T} added`,"success")}function uye(k){tn(T=>{var ee;const Z=T.filter(be=>be.key!==k);return pc(((ee=Z[0])==null?void 0:ee.key)||null),Z})}function wc(k,T){tn(Z=>Z.map(ee=>ee.key===k?T(ee):ee))}async function fye(){try{const k=await oC.saveCatalog({roles:fs.map(mce)});f8(k),gt("Roles saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save roles","error")}}function gye(){var k;(k=Mt.current)==null||k.click()}async function pye(k){var Z;const T=(Z=k.target.files)==null?void 0:Z[0];if(k.target.value="",!!T)try{Hu(!0);const ee=await oC.importCatalog(T);f8(ee),gt(`Imported ${(ee==null?void 0:ee.importedCount)??0} roles from ${(ee==null?void 0:ee.sourceFilePath)||T.name}`,"success")}catch(ee){gt((ee==null?void 0:ee.message)||"Failed to import role catalog","error")}finally{Hu(!1)}}async function WQ(){await oC.deleteDraft(),p8(null)}async function mye(k){if(!Ece(k)){await WQ();return}const T=await oC.saveDraft({draft:mce(k)});p8(T)}function HQ(k="catalog"){Yg(k),Mo(T=>T||(k==="workflow"?Bft(Y):Fft())),sd(!0)}async function VQ(){const k=Qn;sd(!1);try{await mye(k),Ece(k)&>("Role draft saved","info")}catch(T){gt((T==null?void 0:T.message)||"Failed to save role draft","error")}}async function _ye(){if(!Qn)return;const k=Jn==="workflow"?ze:fs,T=Qn.id.trim()||kce(k,Qn.name||"role"),Z=Qn.name.trim()||T,ee=Nm(k.length+1,{id:T,name:Z,systemPrompt:Qn.systemPrompt,provider:Qn.provider,model:Qn.model,connectorsText:Qn.connectorsText});if(Jn==="workflow"){const be=T.trim().toLowerCase(),Ke=ze.find(Yt=>Yt.id.trim().toLowerCase()===be&&be),nt=Ke?ze.map(Yt=>Yt.key===Ke.key?{...Yt,id:ee.id,name:ee.name,systemPrompt:ee.systemPrompt,provider:ee.provider,model:ee.model,connectorsText:ee.connectorsText}:Yt):[ee,...ze];Ct(nt),Ro((Ke==null?void 0:Ke.key)||ee.key),m("roles"),v(!0),ea()}else Bn(be=>[ee,...be]),zt(ee.key),B_("roles");Mo(null),sd(!1);try{await WQ()}catch(be){gt((be==null?void 0:be.message)||"Failed to clear role draft","error")}gt(Jn==="workflow"?`Role ${T} added to workflow`:`Role ${T} added`,"success")}function bye(k){var Z;const T=fs.filter(ee=>ee.key!==k);Bn(T),zt(((Z=T[0])==null?void 0:Z.key)||null)}function eC(k,T){Bn(Z=>Z.map(ee=>ee.key===k?T(ee):ee))}function YD(k,T){Ct(Z=>Z.map(ee=>ee.key===k?T(ee):ee)),ea()}function zQ(k){var Ke;const T=fs.find(nt=>nt.key===k);if(!T)return;const Z=T.id.trim().toLowerCase(),ee=ze.find(nt=>nt.id.trim().toLowerCase()===Z&&Z),be=ee?ze.map(nt=>nt.key===ee.key?{...nt,id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}:nt):[...ze,Nm(ze.length+1,{id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText})];Ct(be),Ro((ee==null?void 0:ee.key)||((Ke=be[0])==null?void 0:Ke.key)||null),m("roles"),v(!0),ea(),gt(ee?`Role ${T.id} refreshed`:`Role ${T.id} added`,"success")}function vye(k){const T=ze.find(nt=>nt.key===k);if(!T)return;const Z=T.id.trim().toLowerCase(),ee=fs.find(nt=>nt.id.trim().toLowerCase()===Z&&Z),be=ee?null:Nm(fs.length+1,{id:T.id||kce(fs),name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}),Ke=ee?fs.map(nt=>nt.key===ee.key?{...nt,id:T.id,name:T.name,systemPrompt:T.systemPrompt,provider:T.provider,model:T.model,connectorsText:T.connectorsText}:nt):[be,...fs];Bn(Ke),zt((ee==null?void 0:ee.key)||(be==null?void 0:be.key)||null),B_("roles"),gt("Role copied to catalog. Save to persist.","info")}async function w8(){try{const k=await ET.save({runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null,appearanceTheme:Y.appearanceTheme,colorMode:Y.colorMode,defaultProviderName:Y.defaultProviderName||null,providers:Y.providers.map(T=>({providerName:T.providerName.trim(),providerType:T.providerType.trim(),model:T.model.trim(),endpoint:T.endpoint.trim(),apiKey:T.apiKey}))});DQ(k),I(T=>({...T,runtimeBaseUrl:(k==null?void 0:k.runtimeBaseUrl)||T.runtimeBaseUrl})),gt("Settings saved","success")}catch(k){gt((k==null?void 0:k.message)||"Failed to save settings","error")}}async function wye(){const k=Y.colorMode,T=Y.colorMode==="dark"?"light":"dark";te(Z=>({...Z,colorMode:T}));try{await ET.save({colorMode:T})}catch(Z){te(ee=>({...ee,colorMode:k})),gt((Z==null?void 0:Z.message)||"Failed to switch theme mode","error")}}async function Cye(){try{Qg({status:"testing",message:"Testing runtime connectivity..."});const k=await ET.testRuntime({runtimeBaseUrl:i.hostMode==="proxy"?Y.runtimeBaseUrl:null});Qg({status:k!=null&&k.reachable?"success":"error",message:(k==null?void 0:k.message)||(k!=null&&k.reachable?"Connected successfully.":"Failed to reach runtime.")})}catch(k){Qg({status:"error",message:(k==null?void 0:k.message)||"Failed to reach runtime."})}}function jQ(k){var ee,be;const T=k||((ee=Y.providerTypes.find(Ke=>Ke.recommended))==null?void 0:ee.id)||((be=Y.providerTypes[0])==null?void 0:be.id)||"openai",Z=Aft(T,Y.providerTypes,Y.providers);te(Ke=>({...Ke,providers:[Z,...Ke.providers],defaultProviderName:Ke.defaultProviderName||Z.providerName})),Be(Z.key),MQ("llm")}function kx(k,T){te(Z=>{const ee=Z.providers.map(be=>be.key!==k?be:T(be));return{...Z,providers:ee}})}function yye(k){te(T=>{var Ke,nt;const Z=T.providers.find(Yt=>Yt.key===k),ee=T.providers.filter(Yt=>Yt.key!==k),be=Z&&T.defaultProviderName===Z.providerName?((Ke=ee[0])==null?void 0:Ke.providerName)||"":T.defaultProviderName;return Be(((nt=ee[0])==null?void 0:nt.key)||null),{...T,providers:ee,defaultProviderName:be}})}function np(k){yi&&(Ue(T=>T.map(Z=>Z.id===yi?k(Z):Z)),ea())}function Sye(k){Ue(Z=>lfe(k,Z)),k.some(Z=>Z.type==="position")&&ea()}function xye(k){_t(T=>cfe(k,T)),k.length>0&&ea()}function Lye(k){if(!k.source||!k.target)return;const T=ct.find(ee=>ee.id===k.source);let Z;(T==null?void 0:T.data.stepType)==="conditional"?Z=eft(k.source,tt):(T==null?void 0:T.data.stepType)==="switch"&&(Z=window.prompt("Branch label","_default")||"_default"),_t(ee=>[...ee,hM(k.source,k.target,Z)]),ea()}function $Q(k,T){const Z=Zut(k,Er,ct,ze,yn,T?{parameters:{connector:T}}:{});T&&dM(Z.data.parameters,T,yn),Ue(ee=>[...ee,Z]),Pt(Z.id),Xn(!1),gn({open:!1,x:0,y:0}),m("node"),v(!0),ea()}function kye(k){if(h!=="editor"||(k.preventDefault(),!R_.current))return;const T=R_.current.screenToFlowPosition({x:k.clientX,y:k.clientY});Ta(T),gn({open:!0,x:k.clientX,y:k.clientY})}function Iye(k){Ue(T=>T.filter(Z=>Z.id!==k)),_t(T=>T.filter(Z=>Z.source!==k&&Z.target!==k)),Pt(T=>T===k?null:T),ea()}function Eye(){var k;(k=navigator.clipboard)==null||k.writeText(Ee.yaml||""),gt("YAML copied","info")}function Nye(){HQ("workflow")}function Dye(k){const T=ze.find(Z=>Z.key===k);Ct(Z=>Z.filter(ee=>ee.key!==k)),Ue(Z=>Z.map(ee=>ee.data.targetRole&&(T==null?void 0:T.id)===ee.data.targetRole?{...ee,data:{...ee.data,targetRole:""}}:ee)),ea()}function Tye(k,T){Ct(Z=>Z.map(ee=>{if(ee.key!==k)return ee;const be=new Set(Cl(ee.connectorsText));return be.has(T)?be.delete(T):be.add(T),{...ee,connectorsText:Array.from(be).join(` +`)}})),ea()}const UQ=E.filter(k=>{const T=M.trim().toLowerCase();return T?[k.name,k.description,k.fileName,k.filePath,k.directoryLabel].join(" ").toLowerCase().includes(T):!0}),Rye=u4.map(k=>({...k,items:k.items.filter(T=>{const Z=Ks.trim().toLowerCase();return!Z||T.toLowerCase().includes(Z)||k.label.toLowerCase().includes(Z)})})).filter(k=>k.items.length>0),qQ=yn.filter(k=>{const T=Ks.trim().toLowerCase();return T?[k.name,k.type,"connector","configured connectors"].join(" ").toLowerCase().includes(T):!0}),KQ=yn.filter(k=>{const T=Os.trim().toLowerCase();return T?[k.name,k.type,k.http.baseUrl,k.cli.command,k.mcp.serverName,k.mcp.command].join(" ").toLowerCase().includes(T):!0}),GQ=fs.filter(k=>O6(k,uh)),YQ=fs.filter(k=>O6(k,tr)),ZQ=ze.filter(k=>O6(k,tr)),XQ=Y.providers.filter(k=>{const T=ce.trim().toLowerCase();return T?[k.providerName,k.providerType,k.displayName,k.model,k.endpoint].join(" ").toLowerCase().includes(T):!0}),QQ=jt?tt.filter(k=>k.source===jt.id):[],C8=x.directories.find(k=>k.directoryId===Ee.directoryId)||null,JQ=Ee.findings.filter(k=>iR(k.level)==="error"),eJ=Et?`${yb(Et.startedAtUtc)} · ${Et.status}`:ad.length>0?`${ad.length} runs`:"No runs yet",Mye=!e&&(w||S),Aye=S?"Viewing in new window":eJ,Ix={borderColor:"var(--accent-border)",background:"var(--accent-soft-end)"},ZD={background:"var(--accent-icon-surface)",color:"var(--accent)"},Pye={borderColor:"var(--accent-border)",background:"var(--accent-soft-end)",color:"var(--accent-text)"},XD=o.providerDisplayName||"NyxID",QD=o.name||o.email||XD,Oye=o.email&&o.email!==QD?o.email:`Connected with ${XD}`,Fye=QD.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(k=>{var T;return((T=k[0])==null?void 0:T.toUpperCase())||""}).join("")||"N",Bye=o.errorMessage||(o.enabled?"Sign in to load your workspace.":`${XD} sign-in is currently unavailable.`),Wye=o.authenticated?y.jsxs("div",{className:"header-auth-chip",children:[o.picture?y.jsx("img",{src:o.picture,alt:QD,className:"header-auth-avatar-image"}):y.jsx("div",{className:"header-auth-avatar",children:Fye}),y.jsxs("div",{className:"header-auth-copy",children:[y.jsx("div",{className:"header-auth-label",children:QD}),y.jsx("div",{className:"header-auth-meta",children:Oye})]}),y.jsx("button",{onClick:()=>window.location.assign(o.logoutUrl||"/auth/logout"),className:"panel-icon-button header-auth-logout",title:"Sign out from NyxID.",children:y.jsx(Q2e,{size:14})})]}):y.jsxs("div",{className:"header-auth-guest",children:[y.jsxs("div",{className:"header-auth-guest-copy",children:[y.jsx("div",{className:"header-auth-label",children:XD}),y.jsx("div",{className:"header-auth-meta",children:Bye})]}),y.jsxs("a",{href:o.loginUrl||"/auth/login",className:"solid-action header-auth-link !no-underline",children:[y.jsx(ZI,{size:14})," Sign in"]})]});function tJ(k=!1){var be,Ke;const T=!k&&Mye,Z=["execution-logs",T?"collapsed":"",k?"execution-logs-fullscreen":""].filter(Boolean).join(" "),ee=!k&&!!ke;return y.jsxs("section",{className:Z,children:[y.jsxs("div",{className:"execution-logs-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[11px] text-gray-400 uppercase tracking-[0.16em]",children:"Execution"}),y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:k?"Execution logs":"Logs"})]}),y.jsxs("div",{className:"execution-logs-header-actions",children:[(be=ci==null?void 0:ci.logs)!=null&&be.length?y.jsx("button",{type:"button",className:`panel-icon-button execution-logs-copy-action ${od?"active":""}`,title:"Copy all execution logs.","aria-label":"Copy all execution logs.","data-tooltip":"Copy logs",onClick:()=>void P0e(),children:od?y.jsx(Pp,{size:14}):y.jsx(yR,{size:14})}):null,ee?y.jsx("button",{type:"button",className:`panel-icon-button execution-logs-window-action ${S?"active":""}`,title:"Pop out","aria-label":"Pop out execution logs.","data-tooltip":"Pop out",onClick:F0e,children:y.jsx(Cte,{size:14})}):null,k?y.jsx("button",{type:"button",className:"panel-icon-button execution-logs-window-action",title:"Close window.","aria-label":"Close logs window.","data-tooltip":"Close window",onClick:()=>window.close(),children:y.jsx(i0,{size:14})}):y.jsxs("button",{type:"button",onClick:B0e,className:"execution-logs-collapse-action","aria-expanded":!T,"data-tooltip":S?"Focus logs window.":T?"Expand logs.":"Collapse logs.",children:[y.jsx("span",{className:"text-[12px] text-gray-500",children:Aye}),S?y.jsx(Cte,{size:15}):y.jsx(LL,{size:16,className:`execution-logs-collapse-icon ${T?"collapsed":""}`})]})]})]}),T?null:y.jsxs("div",{className:"execution-logs-body",children:[y.jsx("div",{className:"execution-runs-list",children:ad.length===0?y.jsx(sb,{icon:y.jsx(t0,{size:18,className:"text-gray-300"}),title:"No runs",copy:"Run the current workflow to inspect execution."}):ad.map(nt=>y.jsxs("button",{onClick:()=>void GD(nt.executionId),className:`execution-run-card ${ke===nt.executionId?"active":""}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:yb(nt.startedAtUtc)}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:nt.status})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:Tft(nt.startedAtUtc,nt.completedAtUtc)})]},nt.executionId))}),y.jsxs("div",{className:"execution-log-stream",children:[y.jsx("div",{className:"execution-log-list",children:(Ke=ci==null?void 0:ci.logs)!=null&&Ke.length?ci.logs.map((nt,Yt)=>y.jsxs("button",{onClick:()=>void A0e(nt,Yt),className:`execution-log-card tone-${nt.tone} ${Gs===Yt?"active":""}`,title:"Click to copy this log.",children:[y.jsxs("div",{className:"execution-log-card-head",children:[y.jsx("div",{className:"text-[12px] font-semibold text-gray-800",children:nt.title}),y.jsxs("div",{className:"execution-log-card-meta",children:[Vu===Yt?y.jsxs("span",{className:"execution-log-card-copied",children:[y.jsx(Pp,{size:12})," Copied"]}):null,y.jsx("div",{className:"text-[11px] text-gray-400",children:yb(nt.timestamp)})]})]}),nt.meta?y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:nt.meta}):null,nt.previewText?y.jsx("div",{className:"execution-log-card-preview",children:nt.previewText}):null]},`${nt.timestamp}-${Yt}`)):y.jsx(sb,{icon:y.jsx(e0,{size:18,className:"text-gray-300"}),title:"No logs yet",copy:"Pick a run to inspect frames and step transitions."})}),mi?y.jsxs("div",{className:"execution-action-panel",children:[y.jsxs("div",{className:"execution-action-intro",children:[y.jsxs("div",{className:"flex items-start justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[11px] text-gray-400 uppercase tracking-[0.14em]",children:"Action required"}),y.jsx("div",{className:"text-[15px] font-semibold text-gray-800 mt-1",children:mi.kind==="human_approval"?"Human approval":"Human input"}),y.jsx("div",{className:"execution-action-subtitle",children:mi.kind==="human_approval"?"Review the pending gate and approve or reject the run.":"Provide the missing value to resume this workflow step."})]}),y.jsx("span",{className:"execution-action-badge",children:mi.stepId})]}),y.jsxs("div",{className:"execution-action-meta",children:[y.jsxs("span",{className:"execution-action-chip",children:[y.jsx(kL,{size:12})," Human required"]}),mi.variableName?y.jsxs("span",{className:"execution-action-chip",children:["stores as ",mi.variableName]}):null,mi.timeoutSeconds?y.jsxs("span",{className:"execution-action-chip",children:["timeout ",mi.timeoutSeconds,"s"]}):null]})]}),mi.prompt?y.jsxs("div",{className:"execution-action-block",children:[y.jsx("div",{className:"execution-action-block-label",children:"Prompt"}),y.jsx("div",{className:"execution-action-prompt",children:mi.prompt})]}):null,y.jsxs("div",{className:"execution-action-block",children:[y.jsxs("div",{className:"execution-action-field-head",children:[y.jsx("label",{className:"field-label",children:mi.kind==="human_approval"?"Feedback":mi.variableName||"Input"}),y.jsx("span",{className:`execution-action-requirement ${mi.kind==="human_approval"?"optional":"required"}`,children:mi.kind==="human_approval"?"Optional note":"Required"})]}),y.jsx("div",{className:"execution-action-helper",children:mi.kind==="human_approval"?"Add context for the operator if needed, then approve or reject this gate.":mi.variableName?`The submitted value will resume the run and be available as ${mi.variableName}.`:"This response resumes the workflow immediately."}),y.jsx("textarea",{ref:ue,className:"panel-textarea execution-action-textarea mt-1",value:I_,placeholder:mi.kind==="human_approval"?"Optional feedback":"Enter the value to continue this step",onChange:nt=>Zg(nt.target.value)})]}),y.jsx("div",{className:"execution-action-footer",children:mi.kind==="human_approval"?y.jsxs(y.Fragment,{children:[y.jsxs("button",{type:"button",className:"ghost-action execution-danger-action",disabled:ph===`${ip}:reject`,onClick:()=>void v8(mi,"reject"),children:[y.jsx(i0,{size:14})," ",ph===`${ip}:reject`?"Rejecting...":"Reject"]}),y.jsxs("button",{type:"button",className:"solid-action",disabled:ph===`${ip}:approve`,onClick:()=>void v8(mi,"approve"),children:[y.jsx(Pp,{size:14})," ",ph===`${ip}:approve`?"Approving...":"Approve"]})]}):y.jsxs("button",{type:"button",className:"solid-action",disabled:ph===`${ip}:submit`,onClick:()=>void v8(mi,"submit"),children:[y.jsx(t0,{size:14})," ",ph===`${ip}:submit`?"Submitting...":"Submit input"]})})]}):null]})]})]})}function Hye(){return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:"Roles"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[360px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"catalog-sidebar-actions",children:[y.jsx("input",{ref:Mt,type:"file",accept:".json,application/json",className:"hidden",onChange:k=>void pye(k)}),y.jsxs("button",{onClick:()=>HQ("catalog"),className:"solid-action flex-1 justify-center",children:[y.jsx(xf,{size:14})," Add role"]}),y.jsx("button",{onClick:fye,className:"ghost-action catalog-save-action",children:"Save"}),y.jsxs("button",{onClick:gye,className:"ghost-action catalog-save-action",disabled:fh,children:[y.jsx(IT,{size:14})," ",fh?"Importing...":"Import"]})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search roles",value:uh,onChange:k=>Ki(k.target.value)})]}),y.jsx("div",{className:"text-[11px] text-gray-400 break-all",children:P_?`${Sn.fileExists?"Remote object":"Remote object pending"} · ${Sn.filePath}`:`${Sn.fileExists?"File":"Will create"} · ${Sn.filePath}`}),Q.filePath?y.jsxs("div",{className:"text-[11px] text-gray-400 break-all",children:["Draft · ",Q.filePath]}):null]}),y.jsx("div",{className:"space-y-2",children:GQ.length===0?y.jsx("div",{className:"empty-card",children:"No roles matched"}):GQ.map(k=>y.jsxs("button",{onClick:()=>zt(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:ir===k.key?Ix:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||k.id||"Role"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.id||"role"})]}),y.jsxs("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:[k.provider||"default",k.model?` · ${k.model}`:""]})]},k.key))})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto p-6",children:Tn?y.jsxs("div",{className:"max-w-[980px] space-y-3 rounded-[28px] border border-[#EEEAE4] bg-white p-5 shadow-[0_22px_54px_rgba(17,24,39,0.06)]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[18px] font-semibold text-gray-800",children:Tn.name||Tn.id||"Role"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:Tn.id||"role_id"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:()=>zQ(Tn.key),className:"ghost-action !px-3",children:"Use in workflow"}),y.jsx("button",{onClick:()=>bye(Tn.key),title:"Delete role.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(qn,{label:"Role ID",value:Tn.id,onChange:k=>eC(Tn.key,T=>({...T,id:k}))}),y.jsx(qn,{label:"Role name",value:Tn.name,onChange:k=>eC(Tn.key,T=>({...T,name:k}))})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:Tn.provider,onChange:k=>{const T=k.target.value,Z=Y.providers.find(ee=>ee.providerName===T);eC(Tn.key,ee=>({...ee,provider:T,model:(Z==null?void 0:Z.model)||ee.model}))},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(k=>y.jsx("option",{value:k.providerName,children:k.providerName},k.key))]})]}),y.jsx(qn,{label:"Model",value:Tn.model,onChange:k=>eC(Tn.key,T=>({...T,model:k}))})]}),y.jsx(yc,{label:"System prompt",value:Tn.systemPrompt,rows:8,onChange:k=>eC(Tn.key,T=>({...T,systemPrompt:k}))}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Allowed connectors"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:yn.length===0?y.jsx("div",{className:"text-[12px] text-gray-400",children:"No connectors configured"}):yn.map(k=>{const T=Cl(Tn.connectorsText).includes(k.name);return y.jsx("button",{onClick:()=>eC(Tn.key,Z=>{const ee=new Set(Cl(Z.connectorsText));return ee.has(k.name)?ee.delete(k.name):ee.add(k.name),{...Z,connectorsText:Array.from(ee).join(` +`)}}),className:`chip-button ${T?"chip-button-active":""}`,children:k.name},k.key)})})]})]}):y.jsx("div",{className:"max-w-[420px]",children:y.jsx(sb,{icon:y.jsx(kL,{size:18,className:"text-gray-300"}),title:"No role selected",copy:"Create a role or pick one from the catalog."})})})]})]})}function Vye(){return y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:"Connectors"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[360px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"catalog-sidebar-actions",children:[y.jsx("input",{ref:We,type:"file",accept:".json,application/json",className:"hidden",onChange:k=>void lye(k)}),y.jsxs("button",{onClick:()=>dye("http"),className:"solid-action flex-1 justify-center",children:[y.jsx(xf,{size:14})," Add connector"]}),y.jsx("button",{onClick:rye,className:"ghost-action catalog-save-action",children:"Save"}),y.jsxs("button",{onClick:aye,className:"ghost-action catalog-save-action",disabled:nd,children:[y.jsx(IT,{size:14})," ",nd?"Importing...":"Import"]})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search connectors",value:Os,onChange:k=>Jr(k.target.value)})]}),y.jsx("div",{className:"text-[11px] text-gray-400 break-all",children:A_?`${Ra.fileExists?"Remote object":"Remote object pending"} · ${Ra.filePath}`:`${Ra.fileExists?"File":"Will create"} · ${Ra.filePath}`}),_l.filePath?y.jsxs("div",{className:"text-[11px] text-gray-400 break-all",children:["Draft · ",_l.filePath]}):null]}),y.jsx("div",{className:"space-y-2",children:KQ.length===0?y.jsx("div",{className:"empty-card",children:"No connectors matched"}):KQ.map(k=>y.jsxs("button",{onClick:()=>pc(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:er===k.key?Ix:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||"New connector"}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.type})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:k.type==="http"?k.http.baseUrl||"HTTP connector":k.type==="cli"?k.cli.command||"CLI connector":k.mcp.serverName||k.mcp.command||"MCP connector"})]},k.key))})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto p-6",children:kt?y.jsxs("div",{className:"max-w-[980px] space-y-3 rounded-[28px] border border-[#EEEAE4] bg-white p-5 shadow-[0_22px_54px_rgba(17,24,39,0.06)]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[18px] font-semibold text-gray-800",children:kt.name||"Connector"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:kt.type.toUpperCase()})]}),y.jsx("button",{onClick:()=>uye(kt.key),title:"Delete connector.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]}),y.jsx(qn,{label:"Name",value:kt.name,onChange:k=>wc(kt.key,T=>({...T,name:k}))}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Type"}),y.jsxs("select",{className:"panel-input mt-1",value:kt.type,onChange:k=>wc(kt.key,T=>({...T,type:k.target.value})),children:[y.jsx("option",{value:"http",children:"HTTP"}),y.jsx("option",{value:"cli",children:"CLI"}),y.jsx("option",{value:"mcp",children:"MCP"})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(qn,{label:"Timeout",value:kt.timeoutMs,onChange:k=>wc(kt.key,T=>({...T,timeoutMs:k}))}),y.jsx(qn,{label:"Retry",value:kt.retry,onChange:k=>wc(kt.key,T=>({...T,retry:k}))})]}),y.jsxs("label",{className:`inline-flex items-center gap-2 rounded-[14px] border px-3 py-2 text-[12px] ${kt.enabled?"border-green-200 bg-green-50 text-green-700":"border-[#E5E1DA] bg-white text-gray-600"}`,children:[y.jsx("input",{type:"checkbox",checked:kt.enabled,onChange:k=>wc(kt.key,T=>({...T,enabled:k.target.checked}))}),"Enabled"]}),kt.type==="http"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(wte,{size:15})," HTTP"]}),y.jsx(qn,{label:"Base URL",value:kt.http.baseUrl,onChange:k=>wc(kt.key,T=>({...T,http:{...T.http,baseUrl:k}}))}),y.jsx(yc,{label:"Allowed methods",value:kt.http.allowedMethods.join(` +`),onChange:k=>wc(kt.key,T=>({...T,http:{...T.http,allowedMethods:Cl(k).map(Z=>Z.toUpperCase())}}))}),y.jsx(yc,{label:"Allowed paths",value:kt.http.allowedPaths.join(` +`),onChange:k=>wc(kt.key,T=>({...T,http:{...T.http,allowedPaths:Cl(k)}}))})]}):null,kt.type==="cli"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(rRe,{size:15})," CLI"]}),y.jsx(qn,{label:"Command",value:kt.cli.command,onChange:k=>wc(kt.key,T=>({...T,cli:{...T.cli,command:k}}))}),y.jsx(yc,{label:"Fixed arguments",value:kt.cli.fixedArguments.join(` +`),onChange:k=>wc(kt.key,T=>({...T,cli:{...T.cli,fixedArguments:Cl(k)}}))})]}):null,kt.type==="mcp"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsxs("div",{className:"flex items-center gap-2 text-[13px] font-semibold text-gray-800",children:[y.jsx(aRe,{size:15})," MCP"]}),y.jsx(qn,{label:"Server name",value:kt.mcp.serverName,onChange:k=>wc(kt.key,T=>({...T,mcp:{...T.mcp,serverName:k}}))}),y.jsx(qn,{label:"Command",value:kt.mcp.command,onChange:k=>wc(kt.key,T=>({...T,mcp:{...T.mcp,command:k}}))})]}):null]}):y.jsx("div",{className:"max-w-[420px]",children:y.jsx(sb,{icon:y.jsx(CR,{size:18,className:"text-gray-300"}),title:"No connector selected",copy:"Create a connector or pick one from the catalog."})})})]})]})}return o.loading?y.jsx(Hft,{}):o.enabled&&!o.authenticated?y.jsx(Vft,{providerDisplayName:o.providerDisplayName,loginUrl:o.loginUrl,errorMessage:o.errorMessage}):e?y.jsx("div",{className:"studio-shell execution-logs-popout-shell relative flex min-h-screen w-full overflow-hidden bg-[#F2F1EE] text-gray-800","data-appearance":Y.appearanceTheme||"blue","data-color-mode":Y.colorMode||"light",children:tJ(!0)}):y.jsxs("div",{className:"studio-shell relative flex h-screen w-full overflow-hidden bg-[#F2F1EE] text-gray-800","data-appearance":Y.appearanceTheme||"blue","data-color-mode":Y.colorMode||"light",onClick:()=>{po.open&&gn({open:!1,x:0,y:0})},children:[y.jsx("div",{className:"app-auth-anchor",children:Wye}),y.jsxs("aside",{className:"studio-rail",children:[y.jsxs("div",{className:"flex flex-col items-center gap-3",children:[y.jsx("div",{className:"flex h-11 w-11 items-center justify-center overflow-hidden rounded-[14px] border border-black/10 bg-[#18181B]",children:y.jsx(T0e,{size:44})}),y.jsx(nb,{active:a==="studio",label:"Studio",icon:y.jsx(xte,{size:18}),onClick:V0e}),y.jsx(nb,{active:a==="workflows",label:"Workflows",icon:y.jsx(e0,{size:18}),onClick:RQ}),i.scriptsEnabled?y.jsx(nb,{active:a==="scripts",label:"Scripts Studio",icon:y.jsx(YI,{size:18}),onClick:z0e}):null,y.jsx(nb,{active:a==="roles",label:"Roles",icon:y.jsx(kL,{size:18}),onClick:()=>B_("roles")}),y.jsx(nb,{active:a==="connectors",label:"Connectors",icon:y.jsx(CR,{size:18}),onClick:()=>B_("connectors")})]}),y.jsxs("div",{className:"mt-auto flex flex-col items-center gap-3",children:[y.jsx(nb,{active:Y.colorMode==="dark",label:Y.colorMode==="dark"?"Switch to light mode":"Switch to dark mode",icon:Y.colorMode==="dark"?y.jsx(Ste,{size:18}):y.jsx(yte,{size:18}),onClick:()=>{wye()}}),y.jsx(nb,{active:a==="settings",label:"Settings",icon:y.jsx(nRe,{size:18}),onClick:()=>MQ("runtime")})]})]}),y.jsx("main",{className:"flex-1 min-w-0 flex flex-col",children:a==="workflows"?y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"workspace-page-header h-[88px] flex-shrink-0 border-b border-[#E6E3DE] bg-white/92 backdrop-blur-sm px-6 flex items-center justify-between gap-4",children:y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Workspace"}),y.jsx("div",{className:"panel-title !mt-0",children:"Workflows"})]})}),y.jsxs("section",{className:"flex-1 min-h-0 grid grid-cols-[320px_minmax(0,1fr)] bg-[#F2F1EE]",children:[y.jsxs("aside",{className:"border-r border-[#E6E3DE] bg-white/94 min-h-0 overflow-y-auto p-5 space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("div",{className:"section-heading",children:i.workflowStorageMode==="scope"?"Scope":"Directories"}),y.jsx("div",{className:"text-[12px] text-gray-400 mt-1",children:i.workflowStorageMode==="scope"?"Workflows are loaded from and saved to the current login scope.":"New workflows will be created in the selected directory."})]}),i.workflowStorageMode!=="scope"?y.jsx("button",{onClick:()=>X(k=>!k),title:j?"Hide directory form.":"Add workflow directory.",className:"panel-icon-button",children:y.jsx(Y2e,{size:14})}):null]}),j&&i.workflowStorageMode!=="scope"?y.jsxs("div",{className:"space-y-2 rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:[y.jsx("input",{className:"panel-input",placeholder:"/absolute/path/to/workflows",value:B,onChange:k=>V(k.target.value)}),y.jsx("input",{className:"panel-input",placeholder:"Directory label",value:K,onChange:k=>z(k.target.value)}),y.jsx("button",{onClick:sye,className:"solid-action w-full justify-center",children:"Add directory"})]}):null,y.jsx("div",{className:"space-y-2",children:x.directories.map(k=>y.jsx("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-[#FAF8F4] px-3 py-3",style:Ee.directoryId===k.directoryId?Ix:void 0,children:y.jsxs("div",{className:"flex items-start gap-3",children:[y.jsxs("button",{onClick:()=>Le(T=>({...T,directoryId:k.directoryId})),className:"text-left flex-1 min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.label}),y.jsx("div",{className:"text-[11px] text-gray-400 truncate mt-1",children:k.path})]}),!k.isBuiltIn&&i.workflowStorageMode!=="scope"?y.jsx("button",{onClick:()=>void oye(k.directoryId),title:"Remove directory.",className:"p-2 rounded-full text-gray-400 hover:text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})}):null]})},k.directoryId))})]}),y.jsxs("div",{className:"min-h-0 flex flex-col",children:[y.jsx("div",{className:"p-5 border-b border-[#E6E3DE] bg-white/70",children:y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y.jsxs("div",{className:"search-field max-w-[420px] flex-1 min-w-[260px]",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search workflows",value:M,onChange:k=>A(k.target.value)})]}),y.jsxs("div",{className:"workflow-toolbar-actions",children:[y.jsxs("div",{className:"inline-flex items-center gap-2 rounded-[18px] border border-[#E5E1DA] bg-white px-2 py-2 shadow-[0_10px_24px_rgba(31,28,24,0.04)]",children:[y.jsx("button",{type:"button",onClick:()=>P("grid"),"data-tooltip":"Show workflows in a grid.",className:"panel-icon-button",style:W==="grid"?ZD:void 0,children:y.jsx(X2e,{size:15})}),y.jsx("button",{type:"button",onClick:()=>P("list"),"data-tooltip":"Show workflows in a list.",className:"panel-icon-button",style:W==="list"?ZD:void 0,children:y.jsx(tRe,{size:15})})]}),y.jsxs("button",{onClick:Q0e,className:"ghost-action",children:[y.jsx(IT,{size:14})," Import"]}),y.jsxs("button",{onClick:()=>{var k;return $0e(((k=x.directories[0])==null?void 0:k.directoryId)||Ee.directoryId)},className:"solid-action",title:"Create workflow",children:[y.jsx(xf,{size:16})," New workflow"]})]})]})}),y.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-6",children:UQ.length===0?y.jsx("div",{className:"max-w-[420px]",children:y.jsx(sb,{icon:y.jsx(e0,{size:18,className:"text-gray-300"}),title:"No workflows",copy:"Create a workflow with the New workflow button above."})}):y.jsx("div",{className:W==="grid"?"grid gap-4 md:grid-cols-2 xl:grid-cols-3":"space-y-3 max-w-[1080px]",children:UQ.map(k=>y.jsx("button",{onClick:()=>void q0e(k.workflowId),className:`w-full text-left rounded-[24px] border border-[#EEEAE4] bg-white transition-colors hover:bg-[#FAF8F4] ${W==="grid"?"px-5 py-5":"px-5 py-4"}`,style:k.workflowId===Ee.workflowId?Ix:void 0,children:y.jsxs("div",{className:`flex gap-4 ${W==="grid"?"items-start":"items-center"}`,children:[y.jsx("div",{className:"w-12 h-12 rounded-[16px] flex items-center justify-center bg-[#F3F0EA] text-gray-400",style:k.workflowId===Ee.workflowId?ZD:void 0,children:y.jsx(e0,{size:18})}),y.jsxs("div",{className:"min-w-0 flex-1",children:[y.jsx("div",{className:"text-[15px] font-semibold text-gray-800 truncate",children:k.name}),W==="grid"?y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"text-[12px] text-gray-400 mt-1 truncate",children:k.directoryLabel}),y.jsxs("div",{className:"text-[12px] text-gray-400 truncate",children:[k.stepCount," steps · ",yb(k.updatedAtUtc)]}),k.description?y.jsx("div",{className:"text-[12px] text-gray-500 mt-3 line-clamp-2",children:k.description}):null]}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 text-[12px] text-gray-400",children:[y.jsx("span",{className:"truncate",children:k.directoryLabel}),y.jsxs("span",{children:[k.stepCount," steps"]}),y.jsx("span",{children:yb(k.updatedAtUtc)})]}),k.description?y.jsx("div",{className:"text-[12px] text-gray-500 mt-2 truncate",children:k.description}):null]})]}),W==="list"?y.jsx("div",{className:"hidden shrink-0 text-[11px] font-semibold uppercase tracking-[0.16em] text-gray-300 sm:block",children:"Open"}):null]})},k.workflowId))})})]})]})]}):a==="roles"?Hye():a==="connectors"?Vye():a==="scripts"?y.jsx(qut,{appContext:{hostMode:i.hostMode,scopeId:i.scopeId,scopeResolved:i.scopeResolved,scriptStorageMode:i.scriptStorageMode,scriptsEnabled:i.scriptsEnabled,scriptContract:i.scriptContract},onFlash:gt}):a==="settings"?y.jsx("section",{className:"flex-1 min-h-0 bg-[#ECEAE6] p-6",children:y.jsxs("div",{className:"h-full min-h-0 overflow-hidden rounded-[38px] border border-[#E6E3DE] bg-white/96 shadow-[0_26px_64px_rgba(17,24,39,0.08)] grid grid-cols-[260px_minmax(0,1fr)]",children:[y.jsxs("aside",{className:"settings-sidebar",children:[y.jsxs("button",{onClick:j0e,className:"inline-flex items-center gap-2 text-[13px] text-gray-400 hover:text-gray-600",children:[y.jsx(vte,{size:16}),"Back to workspace"]}),y.jsxs("div",{className:"mt-8 space-y-2",children:[y.jsx(F6,{active:f==="runtime",icon:y.jsx(wte,{size:16}),title:"Runtime",description:"Base URL and connectivity",onClick:()=>g("runtime")}),y.jsx(F6,{active:f==="llm",icon:y.jsx(JC,{size:16}),title:"LLM",description:"Providers from secrets.json",onClick:()=>g("llm")}),y.jsx(F6,{active:f==="appearance",icon:y.jsx(J2e,{size:16}),title:"Appearance",description:"Studio theme and accents",onClick:()=>g("appearance")})]})]}),y.jsx("div",{className:"min-h-0 overflow-y-auto px-10 py-10",children:f==="runtime"?y.jsxs("div",{className:"max-w-[920px] space-y-8",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"Runtime"})]}),y.jsxs("div",{className:"settings-section-card space-y-5",children:[i.hostMode==="embedded"?y.jsx("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] px-4 py-3 text-[13px] text-gray-600",children:"Embedded mode runs against the in-memory local mainnet hosted by `aevatar app`."}):null,y.jsxs("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1fr)_auto_auto] lg:items-end",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:i.hostMode==="embedded"?"Local mainnet URL":"Runtime base URL"}),y.jsx("input",{className:"panel-input mt-1",value:Y.runtimeBaseUrl,onChange:k=>{const T=k.target.value;te(Z=>({...Z,runtimeBaseUrl:T})),Qg({status:"idle",message:""})},placeholder:GL,readOnly:i.hostMode==="embedded"})]}),y.jsx("button",{onClick:()=>{Cye()},className:"ghost-action justify-center",disabled:rd.status==="testing",children:rd.status==="testing"?"Testing...":i.hostMode==="embedded"?"Test local mainnet":"Test connection"}),y.jsx("button",{onClick:w8,className:"solid-action justify-center",disabled:i.hostMode==="embedded",children:i.hostMode==="embedded"?"Managed locally":"Save runtime"})]}),rd.status!=="idle"?y.jsxs("div",{className:`settings-status-card ${rd.status}`,children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:rd.status==="success"?"Connection succeeded":rd.status==="testing"?"Testing runtime":"Connection failed"}),y.jsx(zft,{status:rd.status})]}),y.jsx("div",{className:"text-[12px] text-gray-500 mt-2 break-all",children:Y.runtimeBaseUrl}),y.jsx("div",{className:"text-[13px] text-gray-600 mt-3",children:rd.message})]}):null]})]}):f==="llm"?y.jsxs("div",{className:"space-y-8",children:[y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"LLM"})]}),y.jsx("button",{onClick:w8,className:"solid-action",children:"Save providers"})]}),y.jsxs("div",{className:"settings-section-card space-y-4",children:[y.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[y.jsxs("div",{className:"text-[12px] text-gray-500 break-all",children:["Secrets · ",Y.secretsFilePath||"~/.aevatar/secrets.json"]}),y.jsxs("button",{onClick:()=>jQ(),className:"solid-action !px-3",children:[y.jsx(xf,{size:14})," Add provider"]})]}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y.jsxs("div",{className:"search-field flex-1 min-w-[260px]",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search providers",value:ce,onChange:k=>Ce(k.target.value)})]}),Y.providerTypes.filter(k=>k.recommended).slice(0,4).map(k=>y.jsx("button",{onClick:()=>jQ(k.id),className:"chip-button",children:k.displayName},k.id))]}),y.jsxs("div",{className:"grid gap-4 xl:grid-cols-[320px_minmax(0,1fr)]",children:[y.jsx("div",{className:"space-y-2 rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-4",children:XQ.length===0?y.jsx("div",{className:"empty-card",children:"No providers matched"}):XQ.map(k=>y.jsxs("button",{onClick:()=>Be(k.key),className:"w-full text-left rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 transition-colors hover:bg-[#FAF8F4]",style:xe===k.key?Ix:void 0,children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.providerName}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",style:Y.defaultProviderName===k.providerName?{color:"var(--accent-text)"}:void 0,children:Y.defaultProviderName===k.providerName?"default":k.providerType})]}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1 truncate",children:k.model||k.displayName})]},k.key))}),ts?y.jsxs("div",{className:"space-y-3 rounded-[24px] border border-[#EEEAE4] bg-[#FAF8F4] p-5",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[15px] font-semibold text-gray-800",children:ts.providerName||"Provider"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:ts.displayName})]}),y.jsx("button",{onClick:()=>yye(ts.key),className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:14})})]}),y.jsx(qn,{label:"Instance name",value:ts.providerName,onChange:k=>{const T=ts.providerName;kx(ts.key,Z=>({...Z,providerName:k})),te(Z=>({...Z,defaultProviderName:Z.defaultProviderName===T?k:Z.defaultProviderName}))}}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider type"}),y.jsx("select",{className:"panel-input mt-1",value:ts.providerType,onChange:k=>{const T=k.target.value;kx(ts.key,Z=>{const ee=tp.get(Z.providerType),be=tp.get(T),Ke=!Z.endpoint||Z.endpoint===((ee==null?void 0:ee.defaultEndpoint)||""),nt=!Z.model||Z.model===((ee==null?void 0:ee.defaultModel)||"");return{...Z,providerType:T,displayName:(be==null?void 0:be.displayName)||T,category:(be==null?void 0:be.category)||"configured",description:(be==null?void 0:be.description)||"",endpoint:Ke?(be==null?void 0:be.defaultEndpoint)||"":Z.endpoint,model:nt?(be==null?void 0:be.defaultModel)||"":Z.model}})},children:Y.providerTypes.map(k=>y.jsx("option",{value:k.id,children:k.displayName},k.id))})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsx(qn,{label:"Model",value:ts.model,onChange:k=>kx(ts.key,T=>({...T,model:k}))}),y.jsx(qn,{label:"Endpoint",value:ts.endpoint,onChange:k=>kx(ts.key,T=>({...T,endpoint:k}))})]}),y.jsx(yc,{label:"API key",value:ts.apiKey,rows:4,onChange:k=>kx(ts.key,T=>({...T,apiKey:k,apiKeyConfigured:!!k.trim()}))}),y.jsxs("label",{className:"inline-flex items-center gap-2 rounded-[14px] border border-[#E5E1DA] bg-white px-3 py-2 text-[12px] text-gray-600",style:Y.defaultProviderName===ts.providerName?Pye:void 0,children:[y.jsx("input",{type:"checkbox",checked:Y.defaultProviderName===ts.providerName,onChange:k=>te(T=>({...T,defaultProviderName:k.target.checked?ts.providerName:""}))}),"Use as default"]})]}):y.jsx(sb,{icon:y.jsx(JC,{size:18,className:"text-gray-300"}),title:"No provider selected",copy:"Add a provider or choose one from the list."})]})]})]}):y.jsxs("div",{className:"max-w-[920px] space-y-8",children:[y.jsxs("div",{className:"flex items-start justify-between gap-4",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Settings"}),y.jsx("div",{className:"panel-title",children:"Appearance"})]}),y.jsx("button",{onClick:w8,className:"solid-action",children:"Save appearance"})]}),y.jsxs("div",{className:"settings-section-card space-y-5",children:[y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"section-heading",children:"Mode"}),y.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[y.jsx("button",{type:"button",onClick:()=>te(k=>({...k,colorMode:"light"})),className:`appearance-card ${Y.colorMode==="light"?"active":""}`,"data-tooltip":"Use the brighter studio surface.",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"settings-mode-icon",children:y.jsx(Ste,{size:16})}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Light"})})]})}),y.jsx("button",{type:"button",onClick:()=>te(k=>({...k,colorMode:"dark"})),className:`appearance-card ${Y.colorMode==="dark"?"active":""}`,"data-tooltip":"Use the darker studio surface.",children:y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsx("div",{className:"settings-mode-icon",children:y.jsx(yte,{size:16})}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Dark"})})]})})]})]}),y.jsx("div",{className:"appearance-grid",children:_ft.map(k=>y.jsxs("button",{onClick:()=>te(T=>({...T,appearanceTheme:k.id})),"data-tooltip":k.description,className:`appearance-card ${Y.appearanceTheme===k.id?"active":""}`,children:[y.jsx("div",{className:"appearance-swatches",children:k.swatches.map(T=>y.jsx("span",{className:"appearance-swatch",style:{background:T}},T))}),y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:k.label})]},k.id))})]})]})})]})}):y.jsxs(y.Fragment,{children:[y.jsx("header",{className:"studio-editor-header",children:y.jsxs("div",{className:"studio-editor-toolbar",children:[y.jsx("div",{className:"studio-view-switch",children:["editor","execution"].map(k=>y.jsx("button",{onClick:()=>u(k),"data-tooltip":k==="editor"?"Edit the current workflow.":"Inspect past runs and logs.",className:`studio-view-switch-button ${h===k?"active":""}`,children:k==="editor"?"Edit":"Runs"},k))}),y.jsxs("div",{className:"studio-title-bar",children:[y.jsxs("div",{className:"studio-title-group",children:[y.jsx("input",{className:"studio-title-input",value:Ee.name,onChange:k=>{Le(T=>({...T,name:k.target.value})),ea()},placeholder:"draft","aria-label":"Workflow title"}),y.jsx(jft,{title:"Description",align:"left",buttonTooltip:"Edit the workflow description.",buttonClassName:"header-help-button",cardClassName:"header-help-card header-description-card",hideTitle:!0,content:y.jsx("textarea",{rows:5,className:"panel-textarea description-editor",value:Ee.description,placeholder:"Workflow description",onChange:k=>{Le(T=>({...T,description:k.target.value})),ea()}})})]}),y.jsxs("div",{className:"studio-header-actions",children:[y.jsx("button",{onClick:OQ,"data-tooltip":"Save","aria-label":"Save",className:"panel-icon-button header-toolbar-action header-save-action",children:y.jsx(Pp,{size:15})}),y.jsx("button",{onClick:X0e,"data-tooltip":"Export","aria-label":"Export",className:"panel-icon-button header-toolbar-action header-export-action",children:y.jsx(IT,{size:15})}),y.jsx("button",{onClick:tye,"data-tooltip":"Run","aria-label":"Run",className:"panel-icon-button header-toolbar-action header-run-action",children:y.jsx(t0,{size:15})}),h==="execution"&&NQ?y.jsx("button",{onClick:()=>void nye(),"data-tooltip":"Stop","aria-label":"Stop",disabled:Xg,className:"panel-icon-button header-toolbar-action",children:y.jsx(sRe,{size:15})}):null]})]})]})}),y.jsxs("section",{className:"flex-1 min-h-0 relative overflow-hidden bg-[#F2F1EE]",children:[y.jsxs("div",{className:"canvas-overlay-stack",children:[y.jsxs("div",{className:"canvas-meta-card",children:[y.jsx("div",{className:"canvas-meta-label",children:(C8==null?void 0:C8.label)||"No directory"}),y.jsxs("div",{className:"canvas-meta-value",children:[ct.length," nodes · ",tt.length," edges"]})]}),h==="execution"?y.jsxs("div",{className:"canvas-meta-card canvas-meta-card-wide",children:[y.jsx("div",{className:"canvas-meta-label",children:"Run"}),y.jsxs("select",{className:"canvas-meta-select",value:ke||"",onChange:k=>{k.target.value&&GD(k.target.value)},children:[y.jsx("option",{value:"",children:eJ}),ad.map(k=>y.jsxs("option",{value:k.executionId,children:[yb(k.startedAtUtc)," · ",k.status]},k.executionId))]})]}):null]}),y.jsx("div",{className:"canvas-overlay-tools",children:h==="editor"?y.jsxs(y.Fragment,{children:[y.jsx(Nce,{active:b&&p==="roles",label:"Roles",icon:y.jsx(kL,{size:16}),onClick:()=>xx("roles")}),y.jsx(Nce,{active:b&&p==="yaml",label:"YAML",icon:y.jsx(xte,{size:16}),onClick:()=>xx("yaml")})]}):null}),Cn?y.jsxs("div",{className:"palette-drawer absolute right-5 top-20 z-30 w-[360px] max-h-[calc(100%-180px)] overflow-hidden rounded-[28px] border border-[#E8E2D9] shadow-[0_26px_64px_rgba(17,24,39,0.16)]",children:[y.jsxs("div",{className:"palette-drawer-header px-5 py-4 border-b border-[#F1ECE5] flex items-center justify-between",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Canvas"}),y.jsx("div",{className:"panel-title",children:"Add node"})]}),y.jsx("button",{onClick:()=>Xn(!1),title:"Close node picker.",className:"panel-icon-button",children:y.jsx(i0,{size:14})})]}),y.jsx("div",{className:"palette-drawer-search p-4 border-b border-[#F1ECE5]",children:y.jsxs("div",{className:"search-field",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search primitives or connectors",value:Ks,onChange:k=>kr(k.target.value)})]})}),y.jsxs("div",{className:"palette-drawer-body overflow-y-auto max-h-[620px]",children:[Rye.map(k=>{const T=E0e[k.key]||YI,Z=Ir===k.label;return y.jsxs("div",{className:"border-b border-[#F1ECE5] last:border-b-0",children:[y.jsxs("button",{onClick:()=>fc(Z?"":k.label),className:"w-full px-4 py-3 flex items-center gap-3 hover:bg-[#FAF8F4] transition-colors text-left",children:[y.jsx("div",{className:"w-8 h-8 rounded-[12px] flex items-center justify-center",style:{background:`${k.color}18`},children:y.jsx(T,{size:15,color:k.color})}),y.jsx("span",{className:"text-[13px] font-medium text-gray-800 flex-1",children:k.label}),y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${Z?"rotate-180":""}`})]}),Z?y.jsx("div",{className:"px-4 pb-3 grid gap-2",children:k.items.map(ee=>y.jsxs("button",{onClick:()=>$Q(ee),className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 text-left hover:bg-[#FAF8F4]",children:[y.jsx("div",{className:"text-[13px] font-medium text-gray-800",children:ee}),y.jsx("div",{className:"text-[11px] text-gray-400 mt-1",children:k.label})]},ee))}):null]},k.key)}),qQ.length>0?y.jsxs("div",{className:"border-b border-[#F1ECE5] last:border-b-0",children:[y.jsxs("button",{onClick:()=>fc(Ir==="Configured connectors"?"":"Configured connectors"),className:"w-full px-4 py-3 flex items-center gap-3 hover:bg-[#FAF8F4] transition-colors text-left",children:[y.jsx("div",{className:"w-8 h-8 rounded-[12px] flex items-center justify-center",style:{background:"#64748b18"},children:y.jsx(CR,{size:15,color:"#64748b"})}),y.jsx("span",{className:"text-[13px] font-medium text-gray-800 flex-1",children:"Configured connectors"}),y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${Ir==="Configured connectors"?"rotate-180":""}`})]}),Ir==="Configured connectors"?y.jsx("div",{className:"px-4 pb-3 grid gap-2",children:qQ.map(k=>y.jsx("button",{onClick:()=>$Q("connector_call",k.name),className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 text-left hover:bg-[#FAF8F4]",children:y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("span",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name}),y.jsx("span",{className:"text-[10px] uppercase tracking-wide text-gray-400",children:k.type})]})},k.key))}):null]}):null]})]}):null,po.open?y.jsx("div",{className:"fixed z-40 rounded-[18px] border border-[#E8E2D9] bg-white shadow-[0_22px_46px_rgba(17,24,39,0.16)]",style:{left:po.x,top:po.y},children:y.jsx("button",{onClick:()=>{Xn(!0),gn({open:!1,x:0,y:0})},className:"px-4 py-3 text-[13px] font-medium text-gray-700 hover:bg-[#FAF8F4] rounded-[18px]",children:"Add node"})}):null,h==="editor"?y.jsxs("div",{className:"absolute bottom-6 right-5 z-30 flex items-end gap-3",children:[Xw?y.jsxs("div",{className:"ask-ai-surface w-[380px] rounded-[28px] border border-[#E8E2D9] p-4 shadow-[0_26px_64px_rgba(17,24,39,0.16)]",onClick:k=>k.stopPropagation(),children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Canvas"}),y.jsx("div",{className:"panel-title",children:"Ask AI"})]}),y.jsx("button",{onClick:()=>Qw(!1),title:"Close Ask AI.",className:"panel-icon-button",children:y.jsx(i0,{size:14})})]}),y.jsx("p",{className:"mt-3 text-[12px] leading-6 text-gray-500",children:"Describe the workflow. AI reasoning streams here and the validated YAML stays in this panel until you apply it."}),y.jsx("textarea",{rows:5,className:"panel-textarea mt-4",placeholder:"Build a workflow that triages incidents, routes risky cases to human approval, and posts the result to Slack.",value:N_,onChange:k=>mh(k.target.value)}),y.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[11px] text-gray-400",children:zu?"Generating and validating YAML...":bc?"Validated YAML is ready to apply.":"Return format: workflow YAML only"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{onClick:()=>{bc.trim()&&m8(bc).then(k=>{k&>("Workflow YAML copied","success")})},className:"ghost-action !px-3",disabled:!bc.trim(),children:[y.jsx(yR,{size:14})," Copy"]}),y.jsxs("button",{onClick:()=>{bc.trim()&&J0e(bc).then(()=>gt("AI workflow applied to canvas","success"),k=>gt((k==null?void 0:k.message)||"Failed to apply workflow YAML","error"))},className:"ghost-action !px-3",disabled:!bc.trim(),children:[y.jsx(Pp,{size:14})," Apply"]}),y.jsxs("button",{onClick:()=>{eye()},className:"ghost-action !px-3",disabled:zu,children:[y.jsx(JC,{size:14})," ",zu?"Thinking":"Generate"]})]})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"Thinking"}),y.jsx("pre",{className:"mt-2 max-h-[140px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-600",children:Jw||"LLM reasoning will stream here."})]}),y.jsxs("div",{className:"mt-4 rounded-[20px] border border-[#F1ECE5] bg-[#FAF8F4] p-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-gray-400",children:"YAML"}),y.jsx("div",{className:"text-[10px] uppercase tracking-[0.16em] text-gray-400",children:bc?"Ready to apply":"Waiting for valid YAML"})]}),y.jsx("pre",{className:"mt-2 max-h-[220px] overflow-auto whitespace-pre-wrap break-words text-[12px] leading-6 text-gray-700",children:vx||"Validated workflow YAML will appear here."})]})]}):null,y.jsx("button",{onClick:k=>{k.stopPropagation(),Qw(T=>!T)},title:"Ask AI to generate workflow YAML.",className:"ask-ai-trigger flex h-14 w-14 items-center justify-center rounded-[20px] border border-[color:var(--accent-border)] shadow-[0_24px_56px_rgba(17,24,39,0.18)] transition-transform hover:-translate-y-0.5",style:ZD,children:y.jsx(JC,{size:20})})]}):null,y.jsxs(f2e,{nodes:O_,edges:F_,nodeTypes:gft,minZoom:.14,maxZoom:1.6,defaultEdgeOptions:{type:"smoothstep",zIndex:4,style:{stroke:"#2F6FEC",strokeWidth:2.5},markerEnd:{type:z1.ArrowClosed,width:11,height:11,color:"#2F6FEC"}},connectionLineType:Df.SmoothStep,connectionLineStyle:{stroke:"#2F6FEC",strokeWidth:2.5},onInit:k=>{R_.current=k},onNodesChange:h==="editor"?Sye:void 0,onEdgesChange:h==="editor"?xye:void 0,onConnect:h==="editor"?Lye:void 0,onNodeClick:(k,T)=>{var Z;if(h==="execution"){const ee=typeof((Z=T.data)==null?void 0:Z.stepId)=="string"?T.data.stepId:"",be=oft(ci,ee);be!==null&&Ao(be);return}Pt(T.id),m("node"),v(!0)},onPaneClick:()=>{h==="editor"&&Pt(null),gn({open:!1,x:0,y:0})},onPaneContextMenu:kye,fitView:!0,fitViewOptions:{padding:.2,minZoom:.14,maxZoom:.92},nodesDraggable:h==="editor",nodesConnectable:h==="editor",elementsSelectable:!0,className:"studio-canvas",children:[y.jsx(b2e,{color:"#D8D2C8",variant:ig.Dots,gap:24,size:1}),y.jsx(B2e,{position:"bottom-left",zoomable:!0,pannable:!0,className:"studio-minimap",style:{width:164,height:108,marginLeft:16,marginBottom:88},maskColor:"rgba(255, 255, 255, 0.76)",bgColor:"rgba(248, 247, 244, 0.98)",nodeBorderRadius:8,nodeColor:k=>{var Z;const T=typeof((Z=k.data)==null?void 0:Z.stepType)=="string"?k.data.stepType:"";return k0e(T).color}}),y.jsx(L2e,{position:"bottom-left"})]}),h==="editor"?y.jsxs("aside",{className:`right-drawer ${b?"open":""}`,children:[y.jsxs("div",{className:"panel-header border-b border-[#F1ECE5]",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Inspector"}),y.jsx("div",{className:"panel-title",children:p==="node"?"Node":p==="roles"?"Roles":"YAML"})]}),y.jsx("button",{onClick:()=>v(!1),title:"Close inspector.",className:"panel-icon-button",children:y.jsx(vte,{size:16})})]}),y.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:p==="node"?jt?y.jsxs("div",{className:"space-y-4",children:[y.jsx(qn,{label:"Step ID",value:jt.data.stepId,onChange:k=>{np(T=>({...T,data:{...T.data,stepId:k,label:k}}))}}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Primitive"}),y.jsx("select",{className:"panel-input mt-1",value:jt.data.stepType,onChange:k=>{const T=k.target.value;np(Z=>{var be,Ke;const ee={...Xut(T),...Z.data.parameters};return T==="connector_call"&&!ee.connector&&((be=yn[0])!=null&&be.name)&&dM(ee,yn[0].name,yn),{...Z,data:{...Z.data,stepType:T,targetRole:vce(T)&&(Z.data.targetRole||((Ke=ze[0])==null?void 0:Ke.id))||"",parameters:ee}}})},children:u4.map(k=>y.jsx("optgroup",{label:k.label,children:k.items.map(T=>y.jsx("option",{value:T,children:T},T))},k.key))})]}),vce(jt.data.stepType)?y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Target role"}),y.jsxs("select",{className:"panel-input mt-1",value:jt.data.targetRole,onChange:k=>{const T=k.target.value;np(Z=>({...Z,data:{...Z.data,targetRole:T}}))},children:[y.jsx("option",{value:"",children:"No role"}),ze.map(k=>y.jsx("option",{value:k.id,children:k.id||k.name},k.key))]})]}):null,jt.data.stepType==="connector_call"?y.jsxs("div",{className:"rounded-[20px] border border-[#EEEAE4] bg-[#FAF8F4] p-3 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[12px] font-semibold text-gray-700",children:"Connector"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:"Use a configured connector"})]}),y.jsx("button",{onClick:()=>{B_("connectors")},className:"accent-inline-link text-[11px] font-medium",children:"Open"})]}),y.jsxs("select",{className:"panel-input",value:String(jt.data.parameters.connector||""),onChange:k=>{const T=k.target.value;np(Z=>{const ee={...Z.data.parameters};return dM(ee,T,yn),{...Z,data:{...Z.data,parameters:ee}}})},children:[y.jsx("option",{value:"",children:"Select connector"}),yn.map(k=>y.jsxs("option",{value:k.name,children:[k.name," · ",k.type]},k.key))]})]}):null,y.jsxs("div",{children:[y.jsxs("div",{className:"flex items-center justify-between mb-2",children:[y.jsx("label",{className:"field-label",children:"Parameters"}),y.jsx("button",{onClick:()=>{np(k=>{const T=Object.keys(k.data.parameters||{});let Z=1,ee=`param_${Z}`;for(;T.includes(ee);)Z+=1,ee=`param_${Z}`;return{...k,data:{...k.data,parameters:{...k.data.parameters,[ee]:""}}}})},className:"accent-inline-link text-[11px] font-medium",children:"Add"})]}),y.jsx("div",{className:"space-y-2",children:Object.entries(jt.data.parameters||{}).length===0?y.jsx("div",{className:"empty-card",children:"No parameters"}):Object.entries(jt.data.parameters||{}).map(([k,T])=>y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white p-3 space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("input",{className:"panel-input flex-1",value:k,onChange:Z=>{const ee=Z.target.value;np(be=>{if(!ee||ee===k)return be;const Ke={...be.data.parameters},nt=Ke[k];return delete Ke[k],Ke[ee]=nt,{...be,data:{...be.data,parameters:Ke}}})}}),y.jsx("button",{onClick:()=>{np(Z=>{const ee={...Z.data.parameters};return delete ee[k],{...Z,data:{...Z.data,parameters:ee}}})},title:"Remove parameter.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]}),y.jsx("textarea",{rows:String(T).includes(` +`)?4:2,className:"panel-textarea",value:pQ(T),onChange:Z=>{const ee=tft(Z.target.value);np(be=>({...be,data:{...be.data,parameters:{...be.data.parameters,[k]:ee}}}))}})]},k))})]}),y.jsxs("div",{children:[y.jsx("div",{className:"field-label mb-2",children:"Connections"}),y.jsx("div",{className:"space-y-2",children:QQ.length===0?y.jsx("div",{className:"empty-card",children:"No outgoing connections"}):QQ.map(k=>{var Z;const T=ct.find(ee=>ee.id===k.target);return y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3 flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[12px] font-medium text-gray-800",children:((Z=k.data)==null?void 0:Z.branchLabel)||"next"}),y.jsx("div",{className:"text-[11px] text-gray-400",children:(T==null?void 0:T.data.stepId)||k.target})]}),y.jsx("button",{onClick:()=>{_t(ee=>ee.filter(be=>be.id!==k.id)),ea()},title:"Remove connection.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]},k.id)})})]}),y.jsx("button",{onClick:()=>Iye(jt.id),className:"w-full rounded-[18px] border border-red-200 bg-white px-3 py-3 text-[12px] font-medium text-red-500 hover:bg-red-50",children:"Remove node"})]}):y.jsx(sb,{icon:y.jsx(Bfe,{size:18,className:"text-gray-300"}),title:"No node selected",copy:"Select a node on the canvas."}):p==="roles"?y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsx("div",{children:y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"Roles"})}),y.jsx("button",{onClick:Nye,"data-tooltip":"Add a role to this workflow.",className:"ghost-action !px-3",children:"Add"})]}),y.jsxs("div",{className:"search-field",children:[y.jsx(lb,{size:14,className:"text-gray-400"}),y.jsx("input",{className:"search-input",placeholder:"Search saved roles",value:tr,onChange:k=>it(k.target.value)})]}),y.jsxs("div",{className:"rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] p-4 space-y-3",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsx("div",{children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Saved roles"})}),y.jsx("button",{onClick:()=>{B_("roles")},className:"accent-inline-link text-[11px] font-medium",children:"Open catalog"})]}),YQ.length===0?y.jsx("div",{className:"empty-card",children:"No saved roles matched"}):y.jsx("div",{className:"space-y-2 max-h-[220px] overflow-y-auto",children:YQ.map(k=>y.jsx("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3",children:y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{className:"min-w-0",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.name||k.id||"Role"}),y.jsxs("div",{className:"text-[11px] text-gray-400 truncate",children:[k.id||"role",k.provider?` · ${k.provider}`:"",k.model?` · ${k.model}`:""]})]}),y.jsx("button",{onClick:()=>zQ(k.key),className:"ghost-action !min-h-[34px] !px-3",children:"Use"})]})},k.key))})]}),y.jsx("div",{className:"flex items-center justify-between",children:y.jsx("div",{children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:"Workflow roles"})})}),ZQ.length===0?y.jsx("div",{className:"empty-card",children:"No workflow roles matched"}):ZQ.map(k=>y.jsxs("div",{className:"rounded-[22px] border border-[#EEEAE4] bg-[#FAF8F4] overflow-hidden",children:[y.jsxs("button",{onClick:()=>Ro(T=>T===k.key?null:k.key),className:"w-full px-4 py-3 flex items-center justify-between gap-3 text-left bg-white/80 hover:bg-white",children:[y.jsx("div",{className:"min-w-0",children:y.jsx("div",{className:"text-[13px] font-semibold text-gray-800 truncate",children:k.id||"role_id"})}),y.jsx("div",{className:"flex items-center",children:y.jsx(LL,{size:14,className:`text-gray-400 transition-transform ${li===k.key?"rotate-180":""}`})})]}),li===k.key?y.jsxs("div",{className:"p-4 space-y-3 border-t border-[#EEEAE4]",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y.jsx("div",{className:"text-[13px] font-semibold text-gray-800",children:k.name||k.id||"Role"}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:()=>vye(k.key),"data-tooltip":"Save this workflow role to the global role catalog.",className:"ghost-action !min-h-[34px] !px-3",children:"Save preset"}),y.jsx("button",{onClick:()=>Dye(k.key),title:"Remove role.",className:"panel-icon-button text-red-500 hover:bg-red-50",children:y.jsx(gp,{size:13})})]})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsx(qn,{label:"Role ID",value:k.id,onChange:T=>{const Z=k.id,ee=k.name||T;Ct(be=>be.map(Ke=>Ke.key===k.key?{...Ke,id:T,name:Ke.name||ee}:Ke)),Ue(be=>be.map(Ke=>Ke.data.targetRole===Z?{...Ke,data:{...Ke.data,targetRole:T}}:Ke)),ea()}}),y.jsx(qn,{label:"Role name",value:k.name,onChange:T=>{YD(k.key,Z=>({...Z,name:T}))}})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:k.provider,onChange:T=>{const Z=T.target.value,ee=Y.providers.find(be=>be.providerName===Z);YD(k.key,be=>({...be,provider:Z,model:(ee==null?void 0:ee.model)||be.model}))},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(T=>y.jsx("option",{value:T.providerName,children:T.providerName},T.key))]})]}),y.jsx(qn,{label:"Model",value:k.model,onChange:T=>{YD(k.key,Z=>({...Z,model:T}))}})]}),y.jsx(yc,{label:"System prompt",value:k.systemPrompt,rows:5,onChange:T=>{YD(k.key,Z=>({...Z,systemPrompt:T}))}}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Allowed connectors"}),y.jsx("div",{className:"flex flex-wrap gap-2",children:yn.length===0?y.jsx("div",{className:"text-[12px] text-gray-400",children:"No connectors configured"}):yn.map(T=>{const Z=Cl(k.connectorsText).includes(T.name);return y.jsx("button",{onClick:()=>Tye(k.key,T.name),className:`chip-button ${Z?"chip-button-active":""}`,children:T.name},T.key)})})]})]}):null]},k.key))]}):y.jsxs("div",{className:"space-y-4",children:[y.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:"YAML"}),y.jsx("div",{className:"text-[12px] text-gray-400",children:"Edit YAML to update the canvas"})]}),y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsxs("button",{onClick:Z0e,className:"ghost-action !px-3",children:[y.jsx(ZI,{size:14})," Validate"]}),y.jsxs("button",{onClick:Eye,className:"ghost-action !px-3",children:[y.jsx(yR,{size:14})," Copy"]})]})]}),y.jsx("textarea",{className:"panel-textarea !min-h-[280px] !bg-[#FAF8F4]",value:Ee.yaml,onChange:k=>Y0e(k.target.value),spellCheck:!1}),y.jsxs("div",{className:"space-y-2",children:[y.jsx("div",{className:"field-label",children:"Findings"}),Ee.findings.length===0?y.jsx("div",{className:"empty-card",children:"No findings"}):Ee.findings.map((k,T)=>y.jsxs("div",{className:"rounded-[18px] border border-[#EEEAE4] bg-white px-3 py-3",children:[y.jsx("div",{className:`text-[12px] font-semibold ${iR(k.level)==="error"?"text-red-500":"text-amber-500"}`,children:k.message}),y.jsxs("div",{className:"text-[11px] text-gray-400 mt-1",children:[k.path||"/",k.code?` · ${k.code}`:""]})]},`${k.path||"root"}-${T}`))]}),JQ.length>0?y.jsxs("div",{className:"rounded-[18px] border border-red-200 bg-red-50 px-3 py-3 text-[12px] text-red-600 flex items-start gap-2",children:[y.jsx(U2e,{size:15,className:"mt-0.5 shrink-0"}),y.jsxs("span",{children:[JQ.length," errors still need fixing before execution."]})]}):null]})})]}):null]}),h==="execution"?tJ():null]})}),y.jsx(B6,{open:bx,title:"Run",onClose:()=>bl(!1),actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>bl(!1),className:"ghost-action",children:"Cancel"}),y.jsxs("button",{onClick:()=>{iye()},className:"solid-action",children:[y.jsx(t0,{size:14})," Run"]})]}),children:y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"Optional input will be passed into the workflow as `$input`."}),y.jsx("textarea",{rows:6,className:"panel-textarea run-prompt-textarea",value:Yw,placeholder:"What should this run do?",onChange:k=>_x(k.target.value)})]})}),y.jsx(B6,{open:ks,title:"Add Connector",onClose:()=>{BQ()},actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>{BQ()},className:"ghost-action",children:"Close"}),y.jsxs("button",{onClick:()=>{hye()},className:"solid-action",children:[y.jsx(xf,{size:14})," Add connector"]})]}),children:Mi?y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"Close this dialog at any time and the latest text will be kept as a draft."}),y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Type"}),y.jsxs("select",{className:"panel-input mt-1",value:Mi.type,onChange:k=>Dn(T=>T&&{...T,type:k.target.value}),children:[y.jsx("option",{value:"http",children:"HTTP"}),y.jsx("option",{value:"cli",children:"CLI"}),y.jsx("option",{value:"mcp",children:"MCP"})]})]}),y.jsx(qn,{label:"Name",value:Mi.name,onChange:k=>Dn(T=>T&&{...T,name:k})}),Mi.type==="http"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(qn,{label:"Base URL",value:Mi.http.baseUrl,onChange:k=>Dn(T=>T&&{...T,http:{...T.http,baseUrl:k}})}),y.jsx(yc,{label:"Allowed methods",rows:3,value:Mi.http.allowedMethods.join(` +`),onChange:k=>Dn(T=>T&&{...T,http:{...T.http,allowedMethods:Cl(k).map(Z=>Z.toUpperCase())}})}),y.jsx(yc,{label:"Allowed paths",rows:3,value:Mi.http.allowedPaths.join(` +`),onChange:k=>Dn(T=>T&&{...T,http:{...T.http,allowedPaths:Cl(k)}})})]}):null,Mi.type==="cli"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(qn,{label:"Command",value:Mi.cli.command,onChange:k=>Dn(T=>T&&{...T,cli:{...T.cli,command:k}})}),y.jsx(yc,{label:"Fixed arguments",rows:3,value:Mi.cli.fixedArguments.join(` +`),onChange:k=>Dn(T=>T&&{...T,cli:{...T.cli,fixedArguments:Cl(k)}})})]}):null,Mi.type==="mcp"?y.jsxs("div",{className:"space-y-3 rounded-[18px] border border-[#EAE4DB] bg-[#FAF8F4] p-4",children:[y.jsx(qn,{label:"Server name",value:Mi.mcp.serverName,onChange:k=>Dn(T=>T&&{...T,mcp:{...T.mcp,serverName:k}})}),y.jsx(qn,{label:"Command",value:Mi.mcp.command,onChange:k=>Dn(T=>T&&{...T,mcp:{...T.mcp,command:k}})}),y.jsx(yc,{label:"Arguments",rows:3,value:Mi.mcp.arguments.join(` +`),onChange:k=>Dn(T=>T&&{...T,mcp:{...T.mcp,arguments:Cl(k)}})})]}):null]}):null}),y.jsx(B6,{open:_c,title:Jn==="workflow"?"Add Workflow Role":"Add Role",onClose:()=>{VQ()},actions:y.jsxs(y.Fragment,{children:[y.jsx("button",{onClick:()=>{VQ()},className:"ghost-action",children:"Close"}),y.jsxs("button",{onClick:()=>{_ye()},className:"solid-action",children:[y.jsx(xf,{size:14})," ",Jn==="workflow"?"Add to workflow":"Add role"]})]}),children:Qn?y.jsxs("div",{className:"space-y-3",children:[y.jsx("div",{className:"text-[12px] text-gray-500",children:"The latest unfinished role draft is stored automatically when you close this dialog."}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsx(qn,{label:"Role ID",value:Qn.id,onChange:k=>Mo(T=>T&&{...T,id:k})}),y.jsx(qn,{label:"Role name",value:Qn.name,onChange:k=>Mo(T=>T&&{...T,name:k})})]}),y.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:"Provider"}),y.jsxs("select",{className:"panel-input mt-1",value:Qn.provider,onChange:k=>{const T=k.target.value,Z=Y.providers.find(ee=>ee.providerName===T);Mo(ee=>ee&&{...ee,provider:T,model:(Z==null?void 0:Z.model)||ee.model})},children:[y.jsx("option",{value:"",children:"Default"}),Y.providers.map(k=>y.jsx("option",{value:k.providerName,children:k.providerName},k.key))]})]}),y.jsx(qn,{label:"Model",value:Qn.model,onChange:k=>Mo(T=>T&&{...T,model:k})})]}),y.jsx(yc,{label:"System prompt",rows:6,value:Qn.systemPrompt,onChange:k=>Mo(T=>T&&{...T,systemPrompt:k})}),y.jsx(yc,{label:"Allowed connectors",rows:4,value:Qn.connectorsText,onChange:k=>Mo(T=>T&&{...T,connectorsText:k})})]}):null}),T_?y.jsx("div",{className:`absolute bottom-5 left-1/2 -translate-x-1/2 px-4 py-2 rounded-[16px] shadow-[0_18px_36px_rgba(17,24,39,0.16)] text-[13px] font-medium z-50 ${T_.type==="success"?"bg-green-500 text-white":T_.type==="error"?"bg-red-500 text-white":"bg-gray-900 text-white"}`,children:T_.text}):null]})}function Hft(){return y.jsx("div",{className:"min-h-screen bg-[#F2F1EE] text-gray-800 px-6 py-8",children:y.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-[960px] items-center justify-center",children:y.jsxs("div",{className:"w-full max-w-[460px] rounded-[32px] border border-[#E6E3DE] bg-white/96 p-8 shadow-[0_28px_70px_rgba(15,23,42,0.08)]",children:[y.jsx("div",{className:"panel-eyebrow",children:"Aevatar App"}),y.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[y.jsx(T0e,{size:48,className:"shrink-0 rounded-[18px]"}),y.jsxs("div",{children:[y.jsx("div",{className:"text-[24px] font-semibold text-gray-900",children:"Preparing studio"}),y.jsx("div",{className:"text-[13px] text-gray-500",children:"Loading workspace context, catalogs, and runtime settings."})]})]})]})})})}function Vft(n){return y.jsx("div",{className:"studio-shell min-h-screen bg-[#F2F1EE] px-6 py-8 text-gray-800","data-appearance":"blue","data-color-mode":"light",children:y.jsx("div",{className:"mx-auto flex min-h-[calc(100vh-4rem)] max-w-[1040px] items-center justify-center",children:y.jsxs("div",{className:"grid w-full max-w-[920px] gap-6 rounded-[36px] border border-[#E6E3DE] bg-white/96 p-6 shadow-[0_30px_72px_rgba(15,23,42,0.08)] md:grid-cols-[minmax(0,1.1fr)_320px] md:p-8",children:[y.jsxs("div",{className:"rounded-[28px] border border-[#ECE7DF] bg-[#FAF8F4] p-6 md:p-7",children:[y.jsx("div",{className:"panel-eyebrow",children:"Aevatar App"}),y.jsxs("div",{className:"mt-3 flex items-start gap-4",children:[y.jsx("div",{className:"flex h-14 w-14 flex-shrink-0 items-center justify-center rounded-[20px] bg-white text-[var(--accent,#2563eb)] shadow-[0_12px_30px_rgba(37,99,235,0.08)]",children:y.jsx(ZI,{size:22})}),y.jsxs("div",{children:[y.jsx("div",{className:"text-[28px] font-semibold leading-tight text-gray-900",children:"Sign in to open Workflow Studio"}),y.jsxs("div",{className:"mt-3 max-w-[520px] text-[14px] leading-6 text-gray-500",children:["Studio content, workflow execution, and scope-backed assets are only available after ",n.providerDisplayName||"NyxID"," authentication succeeds."]})]})]}),y.jsxs("div",{className:"mt-6 rounded-[22px] border border-[#E8E2D9] bg-white px-5 py-4",children:[y.jsx("div",{className:"text-[12px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Access policy"}),y.jsx("div",{className:"mt-2 text-[14px] leading-6 text-gray-600",children:"When the app is not authenticated, the workflow canvas, execution panel, and runtime actions stay locked. Sign in first, then Studio will load normally."})]})]}),y.jsxs("div",{className:"flex flex-col justify-between rounded-[28px] border border-[#ECE7DF] bg-white p-6",children:[y.jsxs("div",{children:[y.jsx("div",{className:"text-[13px] font-semibold uppercase tracking-[0.14em] text-gray-400",children:"Authentication"}),y.jsx("div",{className:"mt-3 text-[22px] font-semibold text-gray-900",children:n.providerDisplayName||"NyxID"}),y.jsx("div",{className:"mt-2 text-[14px] leading-6 text-gray-500",children:"Use your existing identity session to continue into the app."}),n.errorMessage?y.jsx("div",{className:"mt-4 rounded-[18px] border border-amber-200 bg-amber-50 px-4 py-3 text-[13px] leading-5 text-amber-800",children:n.errorMessage}):null]}),y.jsxs("div",{className:"mt-6 space-y-3",children:[y.jsxs("a",{href:n.loginUrl||"/auth/login",className:"solid-action w-full justify-center !no-underline",title:`Sign in with ${n.providerDisplayName||"NyxID"}.`,children:[y.jsx(ZI,{size:14})," Sign in"]}),y.jsx("div",{className:"text-[12px] leading-5 text-gray-400",children:"After sign-in completes, the app will return to Studio automatically."})]})]})]})})})}function nb(n){return y.jsx("button",{onClick:n.onClick,title:n.label,className:`rail-button ${n.active?"active":""}`,children:n.icon})}function F6(n){return y.jsxs("button",{onClick:n.onClick,title:n.description,className:`settings-nav-button ${n.active?"active":""}`,children:[y.jsx("div",{className:"settings-nav-icon",children:n.icon}),y.jsx("div",{className:"min-w-0 text-left",children:y.jsx("div",{className:"text-[14px] font-semibold text-gray-800",children:n.title})})]})}function zft(n){const e=n.status==="success"?"Reachable":n.status==="testing"?"Testing":n.status==="error"?"Unreachable":"Idle";return y.jsx("span",{className:`settings-status-pill ${n.status}`,children:e})}function jft(n){const[e,t]=$.useState(!1),i=$.useRef(null);return $.useEffect(()=>{if(!e)return;const s=o=>{var a;const r=o.target;(!(r instanceof globalThis.Node)||!((a=i.current)!=null&&a.contains(r)))&&t(!1)};return document.addEventListener("pointerdown",s),()=>{document.removeEventListener("pointerdown",s)}},[e]),y.jsxs("div",{ref:i,className:"info-popover",children:[y.jsx("button",{type:"button",onClick:s=>{s.stopPropagation(),t(o=>!o)},className:`info-popover-button ${e?"active":""} ${n.buttonClassName||""}`,title:n.buttonTooltip||n.title,children:y.jsx(q2e,{size:14})}),e?y.jsxs("div",{className:`info-popover-card ${n.align==="left"?"left-0":"right-0"} ${n.cardClassName||""}`,onClick:s=>s.stopPropagation(),children:[n.hideTitle?null:y.jsx("div",{className:"info-popover-title",children:n.title}),y.jsx("div",{className:n.hideTitle?"":"mt-2",children:n.content})]}):null]})}function B6(n){return n.open?y.jsx("div",{className:"modal-overlay",onClick:n.onClose,children:y.jsxs("div",{className:"modal-shell",onClick:e=>e.stopPropagation(),children:[y.jsxs("div",{className:"modal-header",children:[y.jsxs("div",{children:[y.jsx("div",{className:"panel-eyebrow",children:"Catalog"}),y.jsx("div",{className:"panel-title !mt-0",children:n.title})]}),y.jsx("button",{onClick:n.onClose,title:"Close dialog.",className:"panel-icon-button",children:y.jsx(i0,{size:16})})]}),y.jsx("div",{className:"modal-body",children:n.children}),y.jsx("div",{className:"modal-footer",children:n.actions})]})}):null}function Nce(n){return y.jsx("button",{onClick:n.onClick,title:n.label,className:`drawer-icon-button ${n.active?"active":""}`,children:n.icon})}function qn(n){return y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:n.label}),y.jsx("input",{className:"panel-input mt-1",value:n.value,onChange:e=>n.onChange(e.target.value)})]})}function yc(n){return y.jsxs("div",{children:[y.jsx("label",{className:"field-label",children:n.label}),y.jsx("textarea",{rows:n.rows??4,className:"panel-textarea mt-1",value:n.value,onChange:e=>n.onChange(e.target.value)})]})}function sb(n){return y.jsxs("div",{className:"h-full rounded-[22px] border border-dashed border-[#E6E0D6] bg-[#FAF8F4] px-5 py-8 text-center flex flex-col items-center justify-center",children:[y.jsx("div",{className:"w-12 h-12 rounded-[16px] bg-white flex items-center justify-center shadow-[0_10px_20px_rgba(17,24,39,0.05)]",children:n.icon}),y.jsx("div",{className:"text-[14px] font-semibold text-gray-700 mt-3",children:n.title}),y.jsx("p",{className:"text-[12px] text-gray-400 mt-1",children:n.copy})]})}W6.createRoot(document.getElementById("root")).render(y.jsx(dm.StrictMode,{children:y.jsx(Wft,{})}));const $ft={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\$\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"'",close:"'",notIn:["string","comment"]},{open:'"',close:'"',notIn:["string","comment"]}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:"'",close:"'"},{open:'"',close:'"'}],folding:{markers:{start:new RegExp("^\\s*#region\\b"),end:new RegExp("^\\s*#endregion\\b")}}},Uft={defaultToken:"",tokenPostfix:".cs",brackets:[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}],keywords:["extern","alias","using","bool","decimal","sbyte","byte","short","ushort","int","uint","long","ulong","char","float","double","object","dynamic","string","assembly","is","as","ref","out","this","base","new","typeof","void","checked","unchecked","default","delegate","var","const","if","else","switch","case","while","do","for","foreach","in","break","continue","goto","return","throw","try","catch","finally","lock","yield","from","let","where","join","on","equals","into","orderby","ascending","descending","select","group","by","namespace","partial","class","field","event","method","param","public","protected","internal","private","abstract","sealed","static","struct","readonly","volatile","virtual","override","params","get","set","add","remove","operator","true","false","implicit","explicit","interface","enum","null","async","await","fixed","sizeof","stackalloc","unsafe","nameof","when"],namespaceFollows:["namespace","using"],parenFollows:["if","for","while","switch","foreach","using","catch","when"],operators:["=","??","||","&&","|","^","&","==","!=","<=",">=","<<","+","-","*","/","%","!","~","++","--","+=","-=","*=","/=","%=","&=","|=","^=","<<=",">>=",">>","=>"],symbols:/[=>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/[0-9_]*\.[0-9_]+([eE][\-+]?\d+)?[fFdD]?/,"number.float"],[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[bB][01_]+/,"number.hex"],[/[0-9_]+/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/"/,{token:"string.quote",next:"@string"}],[/\$\@"/,{token:"string.quote",next:"@litinterpstring"}],[/\@"/,{token:"string.quote",next:"@litstring"}],[/\$"/,{token:"string.quote",next:"@interpolatedstring"}],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],qualified:[[/[a-zA-Z_][\w]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/\./,"delimiter"],["","","@pop"]],namespace:[{include:"@whitespace"},[/[A-Z]\w*/,"namespace"],[/[\.=]/,"delimiter"],["","","@pop"]],comment:[[/[^\/*]+/,"comment"],["\\*/","comment","@pop"],[/[\/*]/,"comment"]],string:[[/[^\\"]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/"/,{token:"string.quote",next:"@pop"}]],litstring:[[/[^"]+/,"string"],[/""/,"string.escape"],[/"/,{token:"string.quote",next:"@pop"}]],litinterpstring:[[/[^"{]+/,"string"],[/""/,"string.escape"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.litinterpstring"}],[/"/,{token:"string.quote",next:"@pop"}]],interpolatedstring:[[/[^\\"{]+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/{{/,"string.escape"],[/}}/,"string.escape"],[/{/,{token:"string.quote",next:"root.interpolatedstring"}],[/"/,{token:"string.quote",next:"@pop"}]],whitespace:[[/^[ \t\v\f]*#((r)|(load))(?=\s)/,"directive.csx"],[/^[ \t\v\f]*#\w.*$/,"namespace.cpp"],[/[ \t\v\f\r\n]+/,""],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]]}},qft=Object.freeze(Object.defineProperty({__proto__:null,conf:$ft,language:Uft},Symbol.toStringTag,{value:"Module"})); diff --git a/tools/observability/README.md b/tools/observability/README.md index b9d95cbe2..a208da96c 100644 --- a/tools/observability/README.md +++ b/tools/observability/README.md @@ -11,7 +11,7 @@ export OTEL_SERVICE_NAME=Aevatar.Workflow.Host.Api export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 export OTEL_EXPORTER_OTLP_PROTOCOL=grpc -ASPNETCORE_URLS=http://localhost:5000 \ +ASPNETCORE_URLS=http://localhost:5100 \ dotnet run --project src/workflow/Aevatar.Workflow.Host.Api ```
TimeStageAgentStepIdStepTypeMessage
{E(evt.Timestamp.ToString("HH:mm:ss.fff"))}